Quantcast
Channel: How to define variable in Jenkins declarative pipeline? - DevOps Stack Exchange
Viewing all articles
Browse latest Browse all 3

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

$
0
0

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



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>