Skip to content

Instantly share code, notes, and snippets.

@danielsiwiec
Created March 24, 2022 21:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielsiwiec/2685b76422f9fa2c555bb086eb919b86 to your computer and use it in GitHub Desktop.
Save danielsiwiec/2685b76422f9fa2c555bb086eb919b86 to your computer and use it in GitHub Desktop.
Scripted Pipeline
node {
stage('Build and test') {
echo 'Building and testing...'
}
if (env.BRANCH_NAME == 'master') {
['qa', 'prod'].each { environment ->
stage("Deploy to $environment") {
echo 'I only execute on the master branch'
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment