Skip to content

Instantly share code, notes, and snippets.

@tnsasse
Last active April 4, 2018 17:28
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tnsasse/41636cf0deacb8a1cce20994888d8bdc to your computer and use it in GitHub Desktop.
Save tnsasse/41636cf0deacb8a1cce20994888d8bdc to your computer and use it in GitHub Desktop.
Jenkinsfile for Gitflow Pipeline: different deployments for dev/release/master branch
node {
checkout scm
stage('Build') {
def mvnHome = tool 'M3'
sh "${mvnHome}/bin/mvn package"
}
stage('Deploy') {
if (env.BRANCH_NAME == 'develop') {
println 'Deploy to dev'
} else if (env.BRANCH_NAME == 'master') {
println 'Deploy to test'
} else if (env.BRANCH_NAME == 'release'){
println 'Deploy to staging'
} else {
println "No deployment for branch ${env.BRANCH_NAME}"
}
}
}
@tnsasse
Copy link
Author

tnsasse commented Apr 19, 2017

@AdamBien maybe this is useful for you too...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment