Skip to content

Commit

Permalink
[sonic-utilities] Add 'env.' prefix to GHPRB environment variables (s…
Browse files Browse the repository at this point in the history
…onic-net#190)

Apparently, environment variables must be accessed from `env` in pipelines. Reference: https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables
  • Loading branch information
jleveque authored Nov 19, 2020
1 parent fa41f0a commit 8892823
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions jenkins/common/sonic-utilities-build-pr/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pipeline {
}

script {
if ('${ghprbTargetBranch}' == '201911') {
if ('${env.ghprbTargetBranch}' == '201911') {
copyArtifacts(projectName: 'vs/buildimage-vs-201911', filter: '**/*', target: 'buildimage', flatten: false)
} else {
copyArtifacts(projectName: 'common/sonic-swss-common-build', filter: '**/*.deb', target: 'swss-common', flatten: true)
Expand All @@ -28,7 +28,7 @@ pipeline {
steps {
withCredentials([usernamePassword(credentialsId: 'sonicdev-cr', usernameVariable: 'REGISTRY_USERNAME', passwordVariable: 'REGISTRY_PASSWD')]) {
script {
if ('${ghprbTargetBranch}' == '201911') {
if ('${env.ghprbTargetBranch}' == '201911') {
sh './scripts/common/sonic-utilities-build/build_201911.sh'
} else {
sh './scripts/common/sonic-utilities-build/build.sh'
Expand All @@ -51,7 +51,7 @@ pipeline {
wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'xterm']) {
script {
/* We will only run SwSS tests against master branch PRs */
if ('${ghprbTargetBranch}' == 'master') {
if ('${env.ghprbTargetBranch}' == 'master') {
sh './scripts/common/sonic-utilities-build/test.sh'
}
}
Expand Down

0 comments on commit 8892823

Please sign in to comment.