Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Branching in the Jenkinsfile
node{
checkout scm
def the_one_to_run
if (env.BRANCH_NAME == "master"){
the_one_to_run = load 'master.groovy'
}
else{
the_one_to_run = load 'not-master.groovy'
}
the_one_to_run.run_build()
}
def run_build(){
echo "Hello, I'm building the master branch."
}
return this
def run_build(){
echo "Hello, I'm building a branch, but it isn't the master branch."
}
return this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment