Code Review
/
infra
/
cicd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
move all schedules 2-3 hrs earlier
[infra/cicd.git]
/
jjb
/
infra
/
update-jenkins-slave.sh
diff --git
a/jjb/infra/update-jenkins-slave.sh
b/jjb/infra/update-jenkins-slave.sh
index a9b649b2cb8eebc76ac4b42146b848cbc7870417..1fe6202090eff9d2d54767e8eb6de0763d7b47ef 100644
(file)
--- a/
jjb/infra/update-jenkins-slave.sh
+++ b/
jjb/infra/update-jenkins-slave.sh
@@
-17,7
+17,7
@@
while sudo lsof ${DPKG_LOCK} > /dev/null 2>&1 ; do
try=$((try + 1))
done
try=$((try + 1))
done
-sudo apt install -y -q=3 python3-minimal python3-pip virtualenv
+sudo apt install -y -q=3 python3
.8
-minimal python3-pip virtualenv
# workaround for https://github.com/pypa/virtualenv/issues/1029
export PS1=${PS1:-}
# workaround for https://github.com/pypa/virtualenv/issues/1029
export PS1=${PS1:-}
@@
-25,7
+25,7
@@
export PS1=${PS1:-}
cd "$WORKSPACE"
echo "----------------------------------------------------"
echo "Info: Create virtualenv to update Jenkins slaves"
cd "$WORKSPACE"
echo "----------------------------------------------------"
echo "Info: Create virtualenv to update Jenkins slaves"
-virtualenv -p python3 --quiet --no-site-packages .venv
+virtualenv -p python3
.8
--quiet --no-site-packages .venv
source .venv/bin/activate
pip install python-openstackclient
echo "----------------------------------------------------"
source .venv/bin/activate
pip install python-openstackclient
echo "----------------------------------------------------"
@@
-43,7
+43,11
@@
echo "----------------------------------------------------"
echo "Info: Create backup of existing image"
cd "$WORKSPACE"
BACKUP_ZONE_ID=$(openstack image list --property name=${IMAGE} -f value -c ID)
echo "Info: Create backup of existing image"
cd "$WORKSPACE"
BACKUP_ZONE_ID=$(openstack image list --property name=${IMAGE} -f value -c ID)
-openstack image set --name "${IMAGE}-backup-$GIT_COMMIT" "$BACKUP_ZONE_ID"
+if [ -z ${BACKUP_ZONE_ID} ] ; then
+ echo "Warning: No previous image found to backup"
+else
+ openstack image set --name "${IMAGE}-backup-$GIT_COMMIT" "$BACKUP_ZONE_ID"
+fi
echo "----------------------------------------------------"
echo "Info: Updating the CI slave image"
cd "infra/jenkins/slave-setup/${TARGET}/"
echo "----------------------------------------------------"
echo "Info: Updating the CI slave image"
cd "infra/jenkins/slave-setup/${TARGET}/"