[Qa-jenkins-scm] [jenkins.debian.net] 01/01: reproducible_{openwrt, lede}: move toolchain.html creation to remote node

Holger Levsen holger at layer-acht.org
Sun Jun 18 22:10:58 UTC 2017


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit 31df403c8b33cc54a16d07f1930a7079ccaba3a2
Author: Alexander Couzens <lynxis at fe80.eu>
Date:   Sun Jun 18 23:40:05 2017 +0200

    reproducible_{openwrt,lede}: move toolchain.html creation to remote node
    
    There is no sense in creating the toolchain part on the jenkins master.
    
    Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
 bin/reproducible_lede.sh        | 26 +++-----------------------
 bin/reproducible_lede_common.sh | 32 ++++++++++++++++++++++++++++++++
 bin/reproducible_openwrt.sh     | 26 +++-----------------------
 3 files changed, 38 insertions(+), 46 deletions(-)

diff --git a/bin/reproducible_lede.sh b/bin/reproducible_lede.sh
index 845e91c..701bf25 100755
--- a/bin/reproducible_lede.sh
+++ b/bin/reproducible_lede.sh
@@ -76,29 +76,9 @@ build_two_times lede ar71xx_generic_ARCHERC7 "CONFIG_TARGET_ar71xx=y\nCONFIG_TAR
 echo "============================================================================="
 echo "$(date -u) - Creating Documentation HTML"
 echo "============================================================================="
-TOOLCHAIN_HTML=$(mktemp --tmpdir=$TMPDIR)
-echo "<table><tr><th>Target toolchains built</th></tr>" > $TOOLCHAIN_HTML
-for i in $(ls -1d staging_dir/toolchain*|cut -d "-" -f2-|xargs echo) ; do
-	echo " <tr><td><code>$i</code></td></tr>" >> $TOOLCHAIN_HTML
-done
-echo "</table>" >> $TOOLCHAIN_HTML
-echo "<table><tr><th>Contents of <code>build_dir/host/</code></th></tr>" >> $TOOLCHAIN_HTML
-for i in $(ls -1 build_dir/host/) ; do
-	echo " <tr><td>$i</td></tr>" >> $TOOLCHAIN_HTML
-done
-echo "</table>" >> $TOOLCHAIN_HTML
-echo "<table><tr><th>Downloaded software</th></tr>" >> $TOOLCHAIN_HTML
-for i in $(ls -1 dl/) ; do
-	echo " <tr><td>$i</td></tr>" >> $TOOLCHAIN_HTML
-done
-echo "</table>" >> $TOOLCHAIN_HTML
-echo "<table><tr><th>Debian $(cat /etc/debian_version) package on $(dpkg --print-architecture)</th><th>installed version</th></tr>" >> $TOOLCHAIN_HTML
-for i in gcc binutils bzip2 flex python perl make findutils grep diffutils unzip gawk util-linux zlib1g-dev libc6-dev git subversion ; do
-	echo " <tr><td>$i</td><td>" >> $TOOLCHAIN_HTML
-	dpkg -s $i|grep '^Version'|cut -d " " -f2 >> $TOOLCHAIN_HTML
-	echo " </td></tr>" >> $TOOLCHAIN_HTML
-done
-echo "</table>" >> $TOOLCHAIN_HTML
+
+# created & copied by build_two_times()
+TOOLCHAIN_HTML=$TMPDIR/toolchain.html
 
 # clean up builddir to save space on tmpfs
 rm -rf $TMPBUILDDIR/lede
diff --git a/bin/reproducible_lede_common.sh b/bin/reproducible_lede_common.sh
index 3dfc7d3..37dda72 100644
--- a/bin/reproducible_lede_common.sh
+++ b/bin/reproducible_lede_common.sh
@@ -74,6 +74,35 @@ create_results_dirs() {
 	mkdir -p $BASE/$project/dbd
 }
 
+node_document_environment() {
+	local tmpdir=$1
+	local toolchain_html=$tmpdir/toolchain.html
+
+	cd $tmpdir/build
+	echo "<table><tr><th>Target toolchains built</th></tr>" > $toolchain_html
+	for i in $(ls -1d staging_dir/toolchain*|cut -d "-" -f2-|xargs echo) ; do
+		echo " <tr><td><code>$i</code></td></tr>" >> $toolchain_html
+	done
+	echo "</table>" >> $toolchain_html
+	echo "<table><tr><th>Contents of <code>build_dir/host/</code></th></tr>" >> $toolchain_html
+	for i in $(ls -1 build_dir/host/) ; do
+		echo " <tr><td>$i</td></tr>" >> $toolchain_html
+	done
+	echo "</table>" >> $toolchain_html
+	echo "<table><tr><th>Downloaded software</th></tr>" >> $toolchain_html
+	for i in $(ls -1 dl/) ; do
+		echo " <tr><td>$i</td></tr>" >> $toolchain_html
+	done
+	echo "</table>" >> $toolchain_html
+	echo "<table><tr><th>Debian $(cat /etc/debian_version) package on $(dpkg --print-architecture)</th><th>installed version</th></tr>" >> $toolchain_html
+	for i in gcc binutils bzip2 flex python perl make findutils grep diffutils unzip gawk util-linux zlib1g-dev libc6-dev git subversion ; do
+		echo " <tr><td>$i</td><td>" >> $toolchain_html
+		dpkg -s $i|grep '^Version'|cut -d " " -f2 >> $toolchain_html
+		echo " </td></tr>" >> $toolchain_html
+	done
+	echo "</table>" >> $toolchain_html
+}
+
 # node_save_logs can be called over ssh OR called within openwrt_build
 node_save_logs() {
 	local tmpdir=$1
@@ -89,6 +118,8 @@ node_save_logs() {
 	else
 		tar cJf "$tmpdir/build_logs.tar.xz" -C "$tmpdir/build/source" ./logs
 	fi
+
+	node_document_environment $tmpdir
 }
 
 # RUN - is b1 or b2. b1 for first run, b2 for second
@@ -388,6 +419,7 @@ build_two_times() {
 	# rsync back logs and images
 	rsync -av $GENERIC_NODE1:$TMPDIR/$RUN/ $TMPDIR/$RUN/
 	rsync -av $GENERIC_NODE1:$TMPDIR/build_logs.tar.xz $WORKSPACE/results/build_logs_b1.tar.xz
+	rsync -av $GENERIC_NODE1:$TMPDIR/toolchain.html $TMPDIR/toolchain.html
 	ssh $GENERIC_NODE1 reproducible_$TYPE node node_cleanup_tmpdirs $TMPDIR
 
 	## second run
diff --git a/bin/reproducible_openwrt.sh b/bin/reproducible_openwrt.sh
index e4bc9cc..0f89476 100755
--- a/bin/reproducible_openwrt.sh
+++ b/bin/reproducible_openwrt.sh
@@ -77,29 +77,9 @@ build_two_times openwrt ar71xx_generic_ARCHERC7 "CONFIG_TARGET_ar71xx_generic=y\
 echo "============================================================================="
 echo "$(date -u) - Creating Documentation HTML"
 echo "============================================================================="
-TOOLCHAIN_HTML=$(mktemp --tmpdir=$TMPDIR)
-echo "<table><tr><th>Target toolchains built</th></tr>" > $TOOLCHAIN_HTML
-for i in $(ls -1d staging_dir/toolchain*|cut -d "-" -f2-|xargs echo) ; do
-	echo " <tr><td><code>$i</code></td></tr>" >> $TOOLCHAIN_HTML
-done
-echo "</table>" >> $TOOLCHAIN_HTML
-echo "<table><tr><th>Contents of <code>build_dir/host/</code></th></tr>" >> $TOOLCHAIN_HTML
-for i in $(ls -1 build_dir/host/) ; do
-	echo " <tr><td>$i</td></tr>" >> $TOOLCHAIN_HTML
-done
-echo "</table>" >> $TOOLCHAIN_HTML
-echo "<table><tr><th>Downloaded software</th></tr>" >> $TOOLCHAIN_HTML
-for i in $(ls -1 dl/) ; do
-	echo " <tr><td>$i</td></tr>" >> $TOOLCHAIN_HTML
-done
-echo "</table>" >> $TOOLCHAIN_HTML
-echo "<table><tr><th>Debian $(cat /etc/debian_version) package on $(dpkg --print-architecture)</th><th>installed version</th></tr>" >> $TOOLCHAIN_HTML
-for i in gcc binutils bzip2 flex python perl make findutils grep diffutils unzip gawk util-linux zlib1g-dev libc6-dev git subversion ; do
-	echo " <tr><td>$i</td><td>" >> $TOOLCHAIN_HTML
-	dpkg -s $i|grep '^Version'|cut -d " " -f2 >> $TOOLCHAIN_HTML
-	echo " </td></tr>" >> $TOOLCHAIN_HTML
-done
-echo "</table>" >> $TOOLCHAIN_HTML
+
+# created & copied by build_two_times()
+TOOLCHAIN_HTML=$TMPDIR/toolchain.html
 
 # clean up builddir to save space on tmpfs
 rm -rf $TMPBUILDDIR/openwrt

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list