Variables and parallel stages

24 views
Skip to first unread message

Idan Adar

unread,
Dec 13, 2018, 6:46:53 AM12/13/18
to Jenkins Users
Assuming I have a Jenkinsfile similar to the following (high-level),
Can I use the variables in the parallel stages, when each of the parallel stages is running a different agent?


stages {
    stage
{
       
// Fetch some data and store in variables
   
}


   stage
{
       parallel
{
           stage
{
                agent x
               
// Use the variables
           
}
   
           stage
{
                agent y
               
// Use the variables  
           
}
       
}
   
}
}

      

Ramanathan Muthaiah

unread,
Dec 26, 2018, 7:34:58 AM12/26/18
to Jenkins Users
Assuming I have a Jenkinsfile similar to the following (high-level),
Can I use the variables in the parallel stages, when each of the parallel stages is running a different agent?

AFAIK, this is possible as long as the variables are declared globally.

/Ram 
Reply all
Reply to author
Forward
0 new messages