Code Review
/
releng
/
global-jjb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix: Update Gradle publish job
[releng/global-jjb.git]
/
shell
/
jenkins-configure-global-vars.sh
diff --git
a/shell/jenkins-configure-global-vars.sh
b/shell/jenkins-configure-global-vars.sh
index
af36d10
..
873e0b3
100644
(file)
--- a/
shell/jenkins-configure-global-vars.sh
+++ b/
shell/jenkins-configure-global-vars.sh
@@
-1,4
+1,4
@@
-#!/bin/bash
+#!/bin/bash
-l
# SPDX-License-Identifier: EPL-1.0
##############################################################################
# Copyright (c) 2018 The Linux Foundation and others.
# SPDX-License-Identifier: EPL-1.0
##############################################################################
# Copyright (c) 2018 The Linux Foundation and others.
@@
-18,19
+18,25
@@
# configuration to. (default: jenkins)
echo "---> jenkins-configure-global-vars.sh"
# configuration to. (default: jenkins)
echo "---> jenkins-configure-global-vars.sh"
-GROOVY_SCRIPT_FILE="
jjb/
global-jjb/jenkins-admin/set_global_properties.groovy"
+GROOVY_SCRIPT_FILE="global-jjb/jenkins-admin/set_global_properties.groovy"
-# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
-source "/tmp/v/lftools/bin/activate"
silos="${jenkins_silos:-jenkins}"
set -eu -o pipefail
silos="${jenkins_silos:-jenkins}"
set -eu -o pipefail
+# shellcheck disable=SC1090
+. ~/lf-env.sh
+
+lf-activate-venv --python python3 lftools
+
for silo in $silos; do
if [ ! -f "$WORKSPACE/jenkins-config/global-vars-$silo.sh" ]; then
echo "WARN: jenkins-config/global-vars-$silo.sh does not exist. Skipping cloud management..."
echo "We highly recommend setting up global-vars-$silo.sh to manage the Jenkins global variables."
for silo in $silos; do
if [ ! -f "$WORKSPACE/jenkins-config/global-vars-$silo.sh" ]; then
echo "WARN: jenkins-config/global-vars-$silo.sh does not exist. Skipping cloud management..."
echo "We highly recommend setting up global-vars-$silo.sh to manage the Jenkins global variables."
- echo "Refer to https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/jjb/lf-ci-jobs.html#global-environment-variables for details."
+ # shellcheck disable=SC2140
+ echo "Refer to https://docs.releng.linuxfoundation.org/"\
+"projects/global-jjb/en/latest/jjb/lf-ci-jobs.html"\
+"#global-environment-variables for details."
continue
fi
continue
fi
@@
-51,7
+57,7
@@
for silo in $silos; do
exit 1
fi
exit 1
fi
- mapfile -t vars < <(cat
$global_vars
)
+ mapfile -t vars < <(cat
"$global_vars"
)
rm -f insert.txt
for var in "${vars[@]}"; do
rm -f insert.txt
for var in "${vars[@]}"; do
@@
-60,8
+66,8
@@
for silo in $silos; do
continue
fi
continue
fi
- key=$(echo
$var | cut -d\
= -f1)
- value=$(echo
$var | cut -d\
= -f2)
+ key=$(echo
"$var" | cut -d
= -f1)
+ value=$(echo
"$var" | cut -d
= -f2)
echo " '$key': '$value'," >> insert.txt
done
echo " '$key': '$value'," >> insert.txt
done