[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] 2 commits: reproducible OpenWrt: refactor
Holger Levsen
gitlab at salsa.debian.org
Tue Jan 29 17:18:50 GMT 2019
Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net
Commits:
1344438f by Holger Levsen at 2019-01-29T17:07:35Z
reproducible OpenWrt: refactor
Signed-off-by: Holger Levsen <holger at layer-acht.org>
- - - - -
2c70a07f by Holger Levsen at 2019-01-29T17:14:15Z
reproducible OpenWrt: make ssh usable with port!=22 (needed for OSUOSL nodes)
Signed-off-by: Holger Levsen <holger at layer-acht.org>
- - - - -
1 changed file:
- bin/reproducible_openwrt.sh
Changes:
=====================================
bin/reproducible_openwrt.sh
=====================================
@@ -10,15 +10,6 @@
# reproducible_lede_common.sh and reproducible_lede.sh
# (which in turn was based on another variant of reproducible_openwrt.sh)
-# configuration
-GENERIC_NODE1=osuosl-build171-amd64.debian.net
-GENERIC_NODE2=osuosl-build172-amd64.debian.net
-OPENWRT_GIT_REPO=https://git.openwrt.org/openwrt/openwrt.git
-OPENWRT_GIT_BRANCH=master
-DEBUG=false
-OPENWRT_CONFIG=
-OPENWRT_TARGET=
-
. /srv/jenkins/bin/common-functions.sh
common_init "$@"
@@ -26,6 +17,24 @@ common_init "$@"
. /srv/jenkins/bin/reproducible_common.sh
set -e
+# openwrt configuration
+OPENWRT_GIT_REPO=https://git.openwrt.org/openwrt/openwrt.git
+OPENWRT_GIT_BRANCH=master
+DEBUG=false
+OPENWRT_CONFIG=
+OPENWRT_TARGET=
+
+# node configuration
+GENERIC_NODE1=osuosl-build171-amd64.debian.net
+PORT=22
+get_node_ssh_port $GENERIC_NODE1
+GENERIC_PORT1=$PORT
+GENERIC_NODE2=osuosl-build172-amd64.debian.net
+get_node_ssh_port $GENERIC_NODE2
+GENERIC_PORT2=$PORT
+SSHN1="ssh -p $GENERIC_PORT1 $GENERIC_NODE1"
+SSHN2="ssh -p $GENERIC_PORT2 $GENERIC_NODE2"
+
# run on jenkins master
node_debug() {
ls -al "$1" || true
@@ -62,16 +71,16 @@ master_cleanup_tmpdirs() {
# in a success build the logs are saved on a different function
if [ "$1" != "success" ] ; then
# job failed
- ssh "$GENERIC_NODE1" "reproducible_openwrt" node node_save_logs "$TMPBUILDDIR" || true
- ssh "$GENERIC_NODE2" "reproducible_openwrt" node node_save_logs "$TMPBUILDDIR" || true
+ $SSHN1 "reproducible_openwrt" node node_save_logs "$TMPBUILDDIR" || true
+ $SSHN2 "reproducible_openwrt" node node_save_logs "$TMPBUILDDIR" || true
# save failure logs
mkdir -p "$WORKSPACE/results/"
rsync -av "$GENERIC_NODE1:$RESULTSDIR/build_logs.tar.xz" "$WORKSPACE/results/build_logs_b1.tar.xz" || true
rsync -av "$GENERIC_NODE2:$RESULTSDIR/build_logs.tar.xz" "$WORKSPACE/results/build_logs_b2.tar.xz" || true
fi
- ssh "$GENERIC_NODE1" "reproducible_openwrt" node node_cleanup_tmpdirs "$TMPBUILDDIR" || true
- ssh "$GENERIC_NODE2" "reproducible_openwrt" node node_cleanup_tmpdirs "$TMPBUILDDIR" || true
+ $SSHN1 "reproducible_openwrt" node node_cleanup_tmpdirs "$TMPBUILDDIR" || true
+ $SSHN2 "reproducible_openwrt" node node_cleanup_tmpdirs "$TMPBUILDDIR" || true
cd
# (very simple) check we are deleting the right stuff
@@ -386,30 +395,30 @@ build_two_times() {
local CONFIG=$2
# create openwrt
- ssh "$GENERIC_NODE1" "reproducible_openwrt" node node_create_tmpdirs "$TMPBUILDDIR"
- ssh "$GENERIC_NODE2" "reproducible_openwrt" node node_create_tmpdirs "$TMPBUILDDIR"
+ $SSHN1 "reproducible_openwrt" node node_create_tmpdirs "$TMPBUILDDIR"
+ $SSHN2 "reproducible_openwrt" node node_create_tmpdirs "$TMPBUILDDIR"
mkdir -p "$TMPBUILDDIR/download/"
# create results directory saved by jenkins as artifacts
mkdir -p "$WORKSPACE/results/"
# download and prepare openwrt on node b1
- ssh "$GENERIC_NODE1" "reproducible_openwrt" node openwrt_download "$TARGET" "$CONFIG" "$TMPBUILDDIR"
+ $SSHN1 "reproducible_openwrt" node openwrt_download "$TARGET" "$CONFIG" "$TMPBUILDDIR"
echo "== master"
ls -la "$TMPBUILDDIR/download/" || true
echo "== node1"
- ssh "$GENERIC_NODE1" "reproducible_openwrt" node node_debug "$TMPBUILDDIR"
+ $SSHN1 "reproducible_openwrt" node node_debug "$TMPBUILDDIR"
echo "== node2"
- ssh "$GENERIC_NODE2" "reproducible_openwrt" node node_debug "$TMPBUILDDIR"
+ $SSHN2 "reproducible_openwrt" node node_debug "$TMPBUILDDIR"
rsync -a "$GENERIC_NODE1:$TMPBUILDDIR/download/" "$TMPBUILDDIR/download/"
rsync -a "$TMPBUILDDIR/download/" "$GENERIC_NODE2:$TMPBUILDDIR/download/"
## first run
local RUN=b1
- ssh "$GENERIC_NODE1" "reproducible_openwrt" node openwrt_build "$RUN" "$TARGET" "$CONFIG" "$TMPBUILDDIR"
- ssh "$GENERIC_NODE1" "reproducible_openwrt" node openwrt_get_banner "$TMPBUILDDIR" > "$BANNER_HTML"
+ $SSHN1 "reproducible_openwrt" node openwrt_build "$RUN" "$TARGET" "$CONFIG" "$TMPBUILDDIR"
+ $SSHN1 "reproducible_openwrt" node openwrt_get_banner "$TMPBUILDDIR" > "$BANNER_HTML"
# cut away everything before begin and after the end…
# (thats noise generated by the way we run this via reproducible_common.sh)
cat "$BANNER_HTML" | sed '/===bannerend===/,$d' | tac | sed '/===bannerbegin===/,$d' | tac > "$BANNER_HTML.out"
@@ -419,16 +428,16 @@ build_two_times() {
rsync -av "$GENERIC_NODE1:$TMPBUILDDIR/$RUN/" "$RESULTSDIR/$RUN/"
rsync -av "$GENERIC_NODE1:$TMPBUILDDIR/build_logs.tar.xz" "$WORKSPACE/results/build_logs_b1.tar.xz"
rsync -av "$GENERIC_NODE1:$TMPBUILDDIR/toolchain.html" "$RESULTSDIR/toolchain.html"
- ssh "$GENERIC_NODE1" "reproducible_openwrt" node node_cleanup_tmpdirs "$TMPBUILDDIR"
+ $SSHN1 "reproducible_openwrt" node node_cleanup_tmpdirs "$TMPBUILDDIR"
## second run
local RUN=b2
- ssh "$GENERIC_NODE2" "reproducible_openwrt" node openwrt_build "$RUN" "$TARGET" "$CONFIG" "$TMPBUILDDIR"
+ $SSHN2 "reproducible_openwrt" node openwrt_build "$RUN" "$TARGET" "$CONFIG" "$TMPBUILDDIR"
# rsync back logs and images
rsync -av "$GENERIC_NODE2:$TMPBUILDDIR/$RUN/" "$RESULTSDIR/$RUN/"
rsync -av "$GENERIC_NODE2:$TMPBUILDDIR/build_logs.tar.xz" "$WORKSPACE/results/build_logs_b2.tar.xz"
- ssh "$GENERIC_NODE2" "reproducible_openwrt" node node_cleanup_tmpdirs "$TMPBUILDDIR"
+ $SSHN2 "reproducible_openwrt" node node_cleanup_tmpdirs "$TMPBUILDDIR"
}
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/compare/b6168b2387360f4f04a6f11152fe24493b22940c...2c70a07f0cff41cf3dc3966aca2386051222fcb7
--
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/compare/b6168b2387360f4f04a6f11152fe24493b22940c...2c70a07f0cff41cf3dc3966aca2386051222fcb7
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/20190129/79ccae71/attachment-0001.html>
More information about the Qa-jenkins-scm
mailing list