jenkins-pipeline
How to view Jenkins workspace on a Pipeline job?
Go to the Jenkins build On the left hand side click the Pipeline steps Then on the right click on the link that says “Allocate node : Start – (x min in block)” On the the left side click the workspace. Done! The image below might help : Check out this link it shows how … Read more
How to limit Jenkins concurrent multibranch pipeline builds?
Found what I was looking for. You can limit the concurrent builds using the following block in your Jenkinsfile. node { // This limits build concurrency to 1 per branch properties([disableConcurrentBuilds()]) //do stuff … } The same can be achieved with a declarative syntax: pipeline { options { disableConcurrentBuilds() } }
How to specify when branch NOT (branch name) in jenkinsfile?
With this issue resolved, you can now do this: stage(‘Example (Not master)’) { when { not { branch ‘master’ } } steps { sh ‘do-non-master.sh’ } }
How do I make a Jenkins job start after multiple simultaneous upstream jobs succeed?
Pipeline plugin You can use the Pipeline Plugin (formerly workflow-plugin). It comes with many examples, and you can follow this tutorial. e.g. // build stage ‘build’ … // deploy stage ‘deploy’ … // run tests in parallel stage ‘test’ parallel ‘functional’: { … }, ‘performance’: { … } // promote artifacts stage ‘promote’ … Build … Read more
Can I create dynamically stages in a Jenkins pipeline?
Use the scripted syntax that allows more flexibility than the declarative syntax, even though the declarative is more documented and recommended. For example stages can be created in a loop: def tests = params.Tests.split(‘,’) for (int i = 0; i < tests.length; i++) { stage(“Test ${tests[i]}”) { sh ‘….’ } }