Skip to content

Instantly share code, notes, and snippets.

@joseb0rges
Last active May 15, 2021 14:51
Show Gist options
  • Save joseb0rges/0fbaa25d64d3f3b338e92902d3c00fa0 to your computer and use it in GitHub Desktop.
Save joseb0rges/0fbaa25d64d3f3b338e92902d3c00fa0 to your computer and use it in GitHub Desktop.
Script_Groovy_Multibranch
node {
stage('checkout') {
checkout scm
}
stage('deploy') {
echo 'branch name ' + env.BRANCH_NAME
if (env.BRANCH_NAME.startsWith("Feature_")) {
sh "mvn sonar:sonar"
sh "mvn test"
} else if (env.BRANCH_NAME.startsWith("Release_")) {
sh "mvn sonar:sonar"
sh "mvn test"
} else if (env.BRANCH_NAME.startsWith("master")) {
sh "mvn sonar:sonar"
sh "mvn test"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment