Skip to content

Commit b7a6c62

Browse files
authored
[sonic-utilities] Remove quotes and ${} from around environment variable in conditions (sonic-net#191)
Remove quotes and `${}` from around environment variable in conditions. `${}` is only needed when referencing the variable in things like an `echo` statement. Also, don't install packages which aren't relevant in 201911 branch
1 parent 8892823 commit b7a6c62

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

jenkins/common/sonic-utilities-build-pr/Jenkinsfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pipeline {
1212
}
1313

1414
script {
15-
if ('${env.ghprbTargetBranch}' == '201911') {
15+
if (env.ghprbTargetBranch == '201911') {
1616
copyArtifacts(projectName: 'vs/buildimage-vs-201911', filter: '**/*', target: 'buildimage', flatten: false)
1717
} else {
1818
copyArtifacts(projectName: 'common/sonic-swss-common-build', filter: '**/*.deb', target: 'swss-common', flatten: true)
@@ -28,7 +28,7 @@ pipeline {
2828
steps {
2929
withCredentials([usernamePassword(credentialsId: 'sonicdev-cr', usernameVariable: 'REGISTRY_USERNAME', passwordVariable: 'REGISTRY_PASSWD')]) {
3030
script {
31-
if ('${env.ghprbTargetBranch}' == '201911') {
31+
if (env.ghprbTargetBranch == '201911') {
3232
sh './scripts/common/sonic-utilities-build/build_201911.sh'
3333
} else {
3434
sh './scripts/common/sonic-utilities-build/build.sh'
@@ -51,7 +51,7 @@ pipeline {
5151
wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'xterm']) {
5252
script {
5353
/* We will only run SwSS tests against master branch PRs */
54-
if ('${env.ghprbTargetBranch}' == 'master') {
54+
if (env.ghprbTargetBranch == 'master') {
5555
sh './scripts/common/sonic-utilities-build/test.sh'
5656
}
5757
}

scripts/common/sonic-utilities-build/build_201911.sh

+1-6
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,20 @@ ls -lrt
88
99
sudo apt-get install python-m2crypto
1010
sudo apt-get -y purge python-click
11+
sudo pip install --upgrade setuptools
1112
sudo pip install "click>=7.0"
1213
sudo pip install click-default-group==1.2
1314
sudo pip install tabulate
1415
sudo pip install natsort
1516
sudo pip install buildimage/target/python-wheels/swsssdk-2.0.1-py2-none-any.whl
1617
sudo pip install buildimage/target/python-wheels/sonic_py_common-1.0-py2-none-any.whl
1718
sudo pip install buildimage/target/python-wheels/sonic_config_engine-1.0-py2-none-any.whl
18-
sudo pip install buildimage/target/python-wheels/sonic_yang_mgmt-1.0-py2-none-any.whl
1919
sudo pip install mockredispy==2.9.3
2020
sudo pip install netifaces==0.10.9
21-
sudo pip install --upgrade setuptools
2221
sudo pip install pytest-runner==4.4
2322
sudo pip install xmltodict==0.12.0
2423
sudo pip install jsondiff==1.2.0
2524
26-
sudo dpkg -i buildimage/target/debs/stretch/libyang_1.0.73_amd64.deb
27-
sudo dpkg -i buildimage/target/debs/stretch/libyang-cpp_1.0.73_amd64.deb
28-
sudo dpkg -i buildimage/target/debs/stretch/python2-yang_1.0.73_amd64.deb
29-
3025
cd sonic-utilities
3126
3227
# Test building the Debian package

0 commit comments

Comments
 (0)