'Pass upstream build number to downstream build jenkins
I have two pipeline projects in Jenkins.
pipeline 1
pipeline {
agent any
parameters {
string(name: 'PERSON', defaultValue: 'Mr Jenkins', description: 'Who should I say hello to?')
}
stages {
stage('Build') {
steps {
echo 'pipeline-triggers-upstream-job1 executed'
}
}
}
}
pipeline two
pipeline {
agent any
triggers {
upstream(upstreamProjects: 'triggers_upstream_job2',
threshold: hudson.model.Result.SUCCESS)//UNSTABLE, FAILURE, NOT_BUILT, ABORTED
}
stages {
stage('Build') {
steps {
echo 'pipeline-triggers-upstream executed'
echo "Hello ${params.PERSON}"
echo "${env.BUILD_NUMBER}"
}
}
}
}
**Here I want to get the build number of pipeline 1 job in pipeline 2 ** From my research, I found a plugin Parameterized Trigger for this. But am confused to use it.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
