Quantcast
Viewing all articles
Browse latest Browse all 3

Answer by plmaheu for How to define variable in Jenkins declarative pipeline?

The variable must be defined in a script section.

pipeline {    agent none    stages {        stage("first") {            steps {                 script {                      foo = "bar"                 }                 sh "echo ${foo}"            }        }    }}

Viewing all articles
Browse latest Browse all 3

Trending Articles