Skip to content
Commits on Source (2)
......@@ -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"
}
......