[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] 3 commits: Revert "reproducible_debian_live_build: Stop using an ssh-indirection, run directly on the node"
Mattia Rizzolo (@mattia)
gitlab at salsa.debian.org
Mon Aug 23 13:50:36 BST 2021
Mattia Rizzolo pushed to branch master at Debian QA / jenkins.debian.net
Commits:
bd928dcb by Mattia Rizzolo at 2021-08-23T14:32:41+02:00
Revert "reproducible_debian_live_build: Stop using an ssh-indirection, run directly on the node"
This reverts commit 5db460ec12b0c03bf5a0d317cf428047f3f03f71.
- - - - -
80eb2417 by Mattia Rizzolo at 2021-08-23T14:38:54+02:00
master_wrapper: refactor to use a bash array for the parameters
Signed-off-by: Mattia Rizzolo <mattia at debian.org>
- - - - -
1734f0a7 by Mattia Rizzolo at 2021-08-23T14:50:17+02:00
ssh wrapper: pass BUILD_TAG and BUILD_URL along for the debian live jobs
Signed-off-by: Mattia Rizzolo <mattia at debian.org>
- - - - -
3 changed files:
- bin/jenkins_master_wrapper.sh
- bin/jenkins_node_wrapper.sh
- job-cfg/reproducible.yaml
Changes:
=====================================
bin/jenkins_master_wrapper.sh
=====================================
@@ -20,31 +20,34 @@ if [ "${NODE_NAME%.*}" = "$NODE_NAME" ]; then
export NODE_NAME="${NODE_NAME}.debian.net"
fi
-get_node_information $NODE_NAME
+get_node_information "$NODE_NAME"
# don't try to fetch artifacts by default
RETRIEVE_ARTIFACTS=no
+# parameters passed to the remote host
+PARAMS=("$JOB_NAME")
+
# add some more params if needed,
-# by default we just use the job name as param
case $JOB_NAME in
rebootstrap_*|chroot-installation_*|haskell-package-plan)
- PARAMS="$JOB_NAME $@"
- ;;
- *) PARAMS="$JOB_NAME"
- ;;
+ PARAMS+=("$@")
+ ;;
+ reproducible_debian_live_build_*)
+ # the BUILD_TAG and BUILD_URL are re-exported on the nodes then
+ PARAMS+=("$BUILD_TAG" "$BUILD_URL" "$@")
+ ;;
+ cleanup_nodes)
+ # pseudo job used to cleanup nodes
+ PARAMS+=("$@")
+ ;;
esac
-# pseudo job used to cleanup nodes
-if [ "$JOB_NAME" = "cleanup_nodes" ] ; then
- PARAMS="$PARAMS $@"
-fi
-
#
# main
#
set +e
-ssh -o "BatchMode = yes" $NODE_NAME /bin/true
+ssh -o "BatchMode = yes" "$NODE_NAME" /bin/true
RESULT=$?
# abort job if host is down
if [ $RESULT -ne 0 ] ; then
@@ -63,7 +66,7 @@ set -e
# actually run things on the target node
#
RETVAL=0
-ssh -o "BatchMode = yes" $NODE_NAME "$PARAMS" || {
+ssh -o "BatchMode = yes" "$NODE_NAME" "${PARAMS[@]}" || {
# mention failures, but continue since we might want the artifacts anyway
RETVAL=$?
printf "\nSSH EXIT CODE: %s\n" $RETVAL
@@ -82,7 +85,7 @@ if [ "$RETRIEVE_ARTIFACTS" = "yes" ] ; then
set -x
mkdir -p "$RESULTS"
rsync -r --delete -v -e "ssh -o 'Batchmode = yes'" "$NODE_NAME:$NODE_RESULTS/" "$RESULTS/"
- ssh -o "BatchMode = yes" $NODE_NAME "rm -r $NODE_RESULTS"
+ ssh -o "BatchMode = yes" "$NODE_NAME" "rm -r $NODE_RESULTS"
fi
#
=====================================
bin/jenkins_node_wrapper.sh
=====================================
@@ -179,7 +179,11 @@ elif [ "$1" = "/srv/jenkins/bin/reproducible_build_archlinux_pkg.sh" ] && ( [ "$
elif [ "$1" = "/srv/jenkins/bin/reproducible_build_rpm.sh" ] && ( [ "$2" = "1" ] || [ "$2" = "2" ] ) ; then
exec /srv/jenkins/bin/reproducible_build_rpm.sh "$2" "$3" "$4" "$5" "$6" "$7" ; croak "Exec failed";
elif [[ "$*" =~ ^reproducible_debian_live_build.* ]] ; then
- shift; exec /srv/jenkins/bin/reproducible_debian_live_build.sh $@; croak "Exec failed";
+ # would be nice to generalize this so that all remote jobs have these variables
+ export BUILD_TAG="$2"
+ export BUILD_URL="$3"
+ shift 3
+ exec /srv/jenkins/bin/reproducible_debian_live_build.sh $@; croak "Exec failed";
elif [ "$*" = "some_jenkins_job_name" ] ; then
exec echo run any commands here ; croak "Exec failed";
fi
=====================================
job-cfg/reproducible.yaml
=====================================
@@ -981,6 +981,6 @@
my_description: 'Build Debian {imagetype} live image for {debian_version} using live-build'
my_timed: '55 11 * * 0'
my_hname: 'osuosl173'
- my_shell: '/srv/jenkins/bin/reproducible_debian_live_build.sh {imagetype} {debian_version}'
+ my_shell: '/srv/jenkins/bin/jenkins_master_wrapper.sh {imagetype} {debian_version}'
my_trigger: 'reproducible_html_rsync_remote_results'
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/compare/aa216ae15c88d72be6061055cd4e2767c9644b39...1734f0a72a9240ca95a84a0186950d02aa1c8509
--
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/compare/aa216ae15c88d72be6061055cd4e2767c9644b39...1734f0a72a9240ca95a84a0186950d02aa1c8509
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20210823/8b224961/attachment-0001.htm>
More information about the Qa-jenkins-scm
mailing list