How to trigger a Jenkins pipeline A in another Jenkins pipeline B?

0 votes
I’ve created two Jenkins pipeline, let’s say pipelineA and pipelineB. I want to invoke pipelineA in pipelineB. How can this be done?
Jul 5, 2018 in Jenkins by Tyrion anex
• 8,280 points
1,272 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

You can run the following code, its an example of running pipelineA in pipeline.

Make sure you’ve created a ‘pipelineA’ before running this code.

pipeline {
agent
    {
        node {
                label 'master'
                customWorkspace "${env.JobPath}"
              }
    }
    stages 
    {
        stage('Start') {
            steps {
                echo 'Hello'
            }
        }
        stage ('Invoke_pipelineA') {
            steps {
                build job: 'pipelineA', parameters: [
                string(name: 'param1', value: "value1")
                ]
            }
        }
        stage('End') {
            steps {
                echo 'Bye'
            }
        }
    }
}
answered Jul 5, 2018 by Sophie may
• 9,330 points
I think the question was to trigger a pipeline from another jenkins.
I think what @Tyrion meant is that he has two pipelines on same Jenkins and would like to invoke pipeline in pipelineB

Related Questions In Jenkins

0 votes
2 answers
+4 votes
7 answers

How to set the pipeline name and description for a Jenkinsfile?

You can rename pipeline jobs in jenkins ...READ MORE

answered Oct 11, 2018 in Jenkins by Hannah
• 14,080 points
4,598 views
+2 votes
5 answers
+13 votes
2 answers
0 votes
1 answer
0 votes
1 answer

How to get the Maven Version of a project in Jenkins?

Follow the below steps: 1.      Install the Groovy ...READ MORE

answered Aug 9, 2018 in Jenkins by Sophie may
• 9,330 points
229 views
0 votes
1 answer

How to start Jenkins on a different port rather than 8080?

This is simple, use the following command: java ...READ MORE

answered Jul 4, 2018 in Jenkins by Sophie may
• 9,330 points
905 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.