-
Bug
-
Resolution: Duplicate
-
Minor
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?
- duplicates
-
JENKINS-26100 SCM steps should return revision state
-
- Resolved
-
- is duplicated by
-
JENKINS-36436 Environment variables are always NULL
-
- Closed
-
- links to