I passed params to pipeline B and set the environment variables from parameters. However, "${params.URL}"
is evaluated as null.
Pipeline A is declared in Jenkinsfile
:
pipeline {
agent any
stages {
stage('Run on all repos') {
steps {
script {
sh 'ls'
build job: 'run-on-single-repo'
parameters:
[string(name:'URL', value:'val')]
}}}}}
Pipeline B is declared in run-on-single-repo.groovy
:
pipeline {
agent any
stages {
stage('Find missing dependencies') {
environment {
URL = "${params.URL}"
}
steps {
...
Both pipelines are configured in Jenkins as 'Pipeline script from SCM' and work.
How to pass environment variables from pipeline job A to pipeline job B?