[Qa-jenkins-scm] [jenkins.debian.net] 02/02: reproducible arch: automatically use the latest bootstrap.tgz

Holger Levsen holger at moszumanska.debian.org
Sat Oct 17 11:38:47 UTC 2015


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 9e0734ea6051292bbdd7ce1866e97ac6f3eb8c19
Author: Holger Levsen <holger at layer-acht.org>
Date:   Sat Oct 17 13:37:51 2015 +0200

    reproducible arch: automatically use the latest bootstrap.tgz
---
 TODO                                   |  5 ++---
 bin/reproducible_arch_schroot_setup.sh | 14 ++++++++++----
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/TODO b/TODO
index e880c44..2596bf1 100644
--- a/TODO
+++ b/TODO
@@ -292,9 +292,8 @@ properties:
 
 ==== reproducible Arch Linux
 
-* create a job, to bootstrap an arch schroot: done. needs to be made idempotent.
-** BOOTSTRAP_TAR_GZ=2015.08.01/archlinux-bootstrap-2015.08.01-x86_64.tar.gz needs to be replaced with a future proof filename
-** download bootstrap.tar.gz sig and verify
+* job, to bootstrap an arch schroot needs to be made idempotent
+** needs to download bootstrap.tar.gz sig and verify
 * use regular maintenace job to update the arch schroot: 'schroot --directory /tmp -c source:jenkins-reproducible-arch -u root -- pacman -Syu --noconfirm'
 * arch build.sh:
 ** introduce variations: USER, TZ, LANG, LC_ALL, umask
diff --git a/bin/reproducible_arch_schroot_setup.sh b/bin/reproducible_arch_schroot_setup.sh
index d0d9e92..d9a78e3 100755
--- a/bin/reproducible_arch_schroot_setup.sh
+++ b/bin/reproducible_arch_schroot_setup.sh
@@ -12,13 +12,19 @@ DEBUG=true
 . /srv/jenkins/bin/common-functions.sh
 common_init "$@"
 
-# define URL for bootstrap.tgz
-BOOTSTRAP_BASE=http://mirror.one.com/archlinux/iso/
-BOOTSTRAP_DATE=2015.10.01
-BOOTSTRAP_TAR_GZ=$BOOTSTRAP_DATE/archlinux-bootstrap-$BOOTSTRAP_DATE-x86_64.tar.gz
 
 
 bootstrap() {
+	# define URL for bootstrap.tgz
+	BOOTSTRAP_BASE=http://mirror.one.com/archlinux/iso/
+	echo "$(date -u) - downloading Archlinux latest/sha1sums.txt"
+	BOOTSTRAP_DATE=$(curl $BOOTSTRAP_BASE/latest/sha1sums.txt 2>/dev/null| grep x86_64.tar.gz| cut -d " " -f3|cut -d "-" -f3|egrep '[0-9.]{9}')
+	if [ -z $BOOTSTRAP_DATE ] ; then
+		echo "Cannot determine version of boostrap file, aborting."
+		curl $BOOTSTRAP_BASE/latest/sha1sums.txt | grep x86_64.tar.gz
+		exit 1
+	fi
+	BOOTSTRAP_TAR_GZ=$BOOTSTRAP_DATE/archlinux-bootstrap-$BOOTSTRAP_DATE-x86_64.tar.gz
 	echo "$(date -u) - downloading Archlinux bootstrap.tar.gz."
 	curl -O $BOOTSTRAP_BASE/$BOOTSTRAP_TAR_GZ
 	tar xzf archlinux-bootstrap-$BOOTSTRAP_DATE-x86_64.tar.gz

-- 
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