Add a sketch of a defaultsFor step to "just do the right thing"

This commit is contained in:
R. Tyler Croy 2017-12-13 15:04:47 -08:00
parent d968d85eba
commit 203d402e55
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
3 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,5 @@
= Code Valet Pipeline Library
This is a
link:https://jenkins.io/doc/book/pipeline/shared-libraries[Shared Library]
which provides a number of steps for a `Jenkinsfile` executing in Code Valet.

15
vars/defaultsFor.groovy Normal file
View File

@ -0,0 +1,15 @@
/**
* This step applies the default Pipeline for the given langauge definition.
*/
def call(String platform) {
switch (platform) {
case 'java':
echo 'Hello World'
break
default:
fail "I do not know what the defaults for `${platform}` should be :("
break
}
}

View File

@ -1,3 +1,7 @@
/**
* This step just exists to override the script {} block for /most/ users in
* Declarative Pipeline
*/
def call(Closure body) { def call(Closure body) {
echo "I know you want me to run some Scripted Pipeline" echo "I know you want me to run some Scripted Pipeline"
echo "But I'm not going to" echo "But I'm not going to"