Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Duplicate
Description
Here is my pipeline code:
node { checkout changelog: true, poll: true, scm: [ $class: 'GitSCM', branches: [[name: "${env.gitlabSourceRepoName}/${env.gitlabSourceBranch}"]], doGenerateSubmoduleConfigurations: false, extensions: [ [$class: 'PruneStaleBranch'], [ $class: 'PreBuildMerge', options: [ fastForwardMode: 'FF', mergeRemote: 'origin', mergeStrategy: 'default', mergeTarget: "${env.gitlabTargetBranch}" ] ], [$class: 'CleanCheckout'] ], userRemoteConfigs: [ [name: 'origin', url: 'git@gitlab.mydomain.com:user/project.git', credentialsId: '8949144f-cca9-4385-8597-ad3c14bbd7ce'], [name: "${env.gitlabSourceRepoName}", url: "${env.gitlabSourceRepoURL}", credentialsId: '8949144f-cca9-4385-8597-ad3c14bbd7ce'] ], browser: [$class: 'GitLab', repoUrl: 'http://gitlab.mydomain.com', version: '8.8'] ] echo """ |GIT_COMMIT: ${GIT_COMMIT} |GIT_BRANCH: ${GIT_BRANCH } """.stripMargin('|') }
But finally it gives me this error:
groovy.lang.MissingPropertyException: No such property: GIT_BRANCH for class: WorkflowScript
Is the environment variables still working for pipeline?
Attachments
Issue Links
- duplicates
-
JENKINS-26100 SCM steps should return revision state
-
- Resolved
-
- is duplicated by
-
JENKINS-36436 Environment variables are always NULL
-
- Closed
-
- links to
Activity
Field | Original Value | New Value |
---|---|---|
Description |
Here is my pipeline code: {code} node { checkout changelog: true, poll: true, scm: [ $class: 'GitSCM', branches: [[name: "${env.gitlabSourceRepoName}/${env.gitlabSourceBranch}"]], doGenerateSubmoduleConfigurations: false, extensions: [ [$class: 'PruneStaleBranch'], [ $class: 'PreBuildMerge', options: [ fastForwardMode: 'FF', mergeRemote: 'origin', mergeStrategy: 'default', mergeTarget: "${env.gitlabTargetBranch}" ] ], [$class: 'CleanCheckout'] ], userRemoteConfigs: [ [name: 'origin', url: 'git@gitlab.mydomain.com:user/project.git', credentialsId: '8949144f-cca9-4385-8597-ad3c14bbd7ce'], [name: "${env.gitlabSourceRepoName}", url: "${env.gitlabSourceRepoURL}", credentialsId: '8949144f-cca9-4385-8597-ad3c14bbd7ce'] ], browser: [$class: 'GitLab', repoUrl: 'http://gitlab.mydomain.com', version: '8.8'] ] } echo """ |GIT_COMMIT: ${GIT_COMMIT} |GIT_BRANCH: ${GIT_BRANCH } """.stripMargin('|') {code} But finally it gives me this error: {code} groovy.lang.MissingPropertyException: No such property: GIT_BRANCH for class: WorkflowScript {code} Is the environment variables still working for pipeline? |
Here is my pipeline code: {code} node { checkout changelog: true, poll: true, scm: [ $class: 'GitSCM', branches: [[name: "${env.gitlabSourceRepoName}/${env.gitlabSourceBranch}"]], doGenerateSubmoduleConfigurations: false, extensions: [ [$class: 'PruneStaleBranch'], [ $class: 'PreBuildMerge', options: [ fastForwardMode: 'FF', mergeRemote: 'origin', mergeStrategy: 'default', mergeTarget: "${env.gitlabTargetBranch}" ] ], [$class: 'CleanCheckout'] ], userRemoteConfigs: [ [name: 'origin', url: 'git@gitlab.mydomain.com:user/project.git', credentialsId: '8949144f-cca9-4385-8597-ad3c14bbd7ce'], [name: "${env.gitlabSourceRepoName}", url: "${env.gitlabSourceRepoURL}", credentialsId: '8949144f-cca9-4385-8597-ad3c14bbd7ce'] ], browser: [$class: 'GitLab', repoUrl: 'http://gitlab.mydomain.com', version: '8.8'] ] echo """ |GIT_COMMIT: ${GIT_COMMIT} |GIT_BRANCH: ${GIT_BRANCH } """.stripMargin('|') } {code} But finally it gives me this error: {code} groovy.lang.MissingPropertyException: No such property: GIT_BRANCH for class: WorkflowScript {code} Is the environment variables still working for pipeline? |
Assignee | Mark Waite [ markewaite ] |
Link |
This issue is duplicated by |
Workflow | JNJira [ 171461 ] | JNJira + In-Review [ 184315 ] |
Component/s | workflow-scm-step-plugin [ 21717 ] |
Labels | pipeline |
Link |
This issue duplicates |
Resolution | Duplicate [ 3 ] | |
Status | Open [ 1 ] | Resolved [ 5 ] |
Assignee | Mark Waite [ markewaite ] |
Assignee | Mark Waite [ markewaite ] |
Remote Link | This issue links to "CloudBees Internal OSS-1639 (Web Link)" [ 18616 ] |
Status | Resolved [ 5 ] | Closed [ 6 ] |