[JIRA] (JENKINS-60855) Declarative Pipeline : 'parallel' make 'environments' not accessible in the 'post' block

2 views
Skip to first unread message

contact@philippedupont.fr (JIRA)

unread,
Jan 24, 2020, 3:14:03 AM1/24/20
to jenkinsc...@googlegroups.com
Philippe Dupont created an issue
 
Jenkins / Bug JENKINS-60855
Declarative Pipeline : 'parallel' make 'environments' not accessible in the 'post' block
Issue Type: Bug Bug
Assignee: Unassigned
Components: pipeline
Created: 2020-01-24 08:13
Environment: jenkins 2.210
Labels: jenkins parallel post-actions environment
Priority: Minor Minor
Reporter: Philippe Dupont

When using a parallel block alone in a stages block, the "environment" definition of variables is lost when used in a post block.

This issue can be reproduced using this pipeline:

   pipeline {
        agent any
        stages {
            stage("Tests") {
                environment {
                    foo = "${JOB_NAME}-${BUILD_ID}-${STAGE_NAME}"
                }
                parallel {
                    stage("test") {
                        steps {  
                            sh 'echo "foo_inside_parallel: ${foo}"'
                        }
                    }
                }
                post {
                    always {
                        sh 'echo "foo_inside_post: ${foo}"'
                    }
                }
            }
        }
    }
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages