How to invoke a jenkins pipeline A in another jenkins pipeline B

Following solution works for me: pipeline { agent { node { label ‘master’ customWorkspace “${env.JobPath}” } } stages { stage(‘Start’) { steps { sh ‘ls’ } } stage (‘Invoke_pipeline’) { steps { build job: ‘pipeline1’, parameters: [ string(name: ‘param1’, value: “value1”) ] } } stage(‘End’) { steps { sh ‘ls’ } } } } Adding … Read more

Using a Jenkins pipeline to checkout multiple git repos into same job

You can use the dir command to execute a pipeline step in a subdirectory: node(‘ATLAS && Linux’) { dir(‘CalibrationResults’) { git url: ‘https://github.com/AtlasBID/CalibrationResults.git’ } dir(‘Combination’) { git url: ‘https://github.com/AtlasBID/Combination.git’ } dir(‘CombinationBuilder’) { git url: ‘https://github.com/AtlasBID/CombinationBuilder.git’ } sh(‘ls’) sh(‘. CombinationBuilder/build.sh’) }

Jenkins pipeline: agent vs node?

The simple answer is, Agent is for declarative pipelines and node is for scripted pipelines. In declarative pipelines the agent directive is used for specifying which agent/slave the job/task is to be executed on. This directive only allows you to specify where the task is to be executed, which agent, slave, label or docker image. … Read more