Last active
April 4, 2018 17:28
-
-
Save tnsasse/41636cf0deacb8a1cce20994888d8bdc to your computer and use it in GitHub Desktop.
Jenkinsfile for Gitflow Pipeline: different deployments for dev/release/master branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@AdamBien maybe this is useful for you too...