Hello,
Is there anyway to return env variables from a job?
It works fine in pipeline, but with jenkinsfile scm pipeline I can't def variable inside steps.
This works fine inside pipeline:
stage('pre') {
build job: 'Test1'
}
stage('main') {
def result = build job: 'Test', parameters: [string(name: 'VM', value: String.valueOf(VM))]
println result.getBuildVariables()
}
This doesn't:
pipeline {
agent any
stages {
stage('pre') {
steps {
build job: 'Test1'
}
}
stage('main') {
steps {
def result = build job: 'Test', parameters: [string(name: 'VM', value: String.valueOf(VM))]
println result.getBuildVariables()
}
}
}
}
Any help is appreciated.
Thanks