summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2015-08-26 01:32:10 +0200
committerHolger Levsen <holger@layer-acht.org>2015-08-26 01:33:32 +0200
commitf8c753e72a133f35bd2cdd33a37f24fb877f105b (patch)
tree17d017ffa65af4145fa519a83eeddbc720730c56
parentc6935d9a231a373b0622fe72c21b207348e62ec7 (diff)
downloadjenkins.debian.net-f8c753e72a133f35bd2cdd33a37f24fb877f105b.tar.xz
reproducible freebsd: carefully craft our own tar.xz archives...
-rwxr-xr-xbin/reproducible_freebsd.sh11
-rw-r--r--hosts/freebsd-jenkins/usr/local/etc/sudoers7
2 files changed, 13 insertions, 5 deletions
diff --git a/bin/reproducible_freebsd.sh b/bin/reproducible_freebsd.sh
index e2d13d26..816df076 100755
--- a/bin/reproducible_freebsd.sh
+++ b/bin/reproducible_freebsd.sh
@@ -27,9 +27,11 @@ save_freebsd_results(){
local RUN=$1
mkdir -p $TMPDIR/$RUN/
# copy results over
- $RSCP:$TMPDIR $TMPDIR/$RUN
- $RSSH "rm -r $TMPDIR ; mkdir $TMPDIR"
- find $TMPDIR/$RUN/ -name MD5 -o -name SHA512 -exec rm {} \;
+ DUMMY_DATE="$(date -u +'%Y-%m-%d') 00:00Z"
+ $RSSH "sudo find $TMPDIR --exec touch --date='$DUMMY_DATE'"
+ $RSSH "sudo find $TMPDIR -print0 | LC_ALL=C sort -z | sudo tar --null -T - --no-recursion -cJf $TMPDIR.tar.xz"
+ $RSCP:$TMPDIR.tar.xz $TMPDIR/$RUN
+ $RSSH "sudo rm -r $TMPDIR $TMPDIR.tar.xz ; mkdir $TMPDIR"
}
#
@@ -71,6 +73,7 @@ $RSSH "cd $TMPBUILDDIR ; TZ=$TZ sudo make -j $NUM_CPU buildkernel"
$RSSH "cd $TMPBUILDDIR ; TZ=$TZ DESTDIR=$TMPDIR sudo make -j $NUM_CPU installworld"
$RSSH "cd $TMPBUILDDIR ; TZ=$TZ DESTDIR=$TMPDIR sudo make -j $NUM_CPU installkernel"
$RSSH "cd $TMPBUILDDIR ; TZ=$TZ DESTDIR=$TMPDIR sudo make -j $NUM_CPU distribution"
+
# save results in b1
save_freebsd_results b1
@@ -97,9 +100,9 @@ $RSSH "cd $TMPBUILDDIR ; TZ=$TZ sudo make -j $NEW_NUM_CPU buildkernel"
$RSSH "cd $TMPBUILDDIR ; TZ=$TZ DESTDIR=$TMPDIR sudo make -j $NEW_NUM_CPU installworld"
$RSSH "cd $TMPBUILDDIR ; TZ=$TZ DESTDIR=$TMPDIR sudo make -j $NEW_NUM_CPU installkernel"
$RSSH "cd $TMPBUILDDIR ; TZ=$TZ DESTDIR=$TMPDIR sudo make -j $NEW_NUM_CPU distribution"
+
# save results in b2
save_freebsd_results b2
-# cleanup...
# reset environment to default values again
export LANG="en_GB.UTF-8"
diff --git a/hosts/freebsd-jenkins/usr/local/etc/sudoers b/hosts/freebsd-jenkins/usr/local/etc/sudoers
index 9a139c68..e8bcd2bc 100644
--- a/hosts/freebsd-jenkins/usr/local/etc/sudoers
+++ b/hosts/freebsd-jenkins/usr/local/etc/sudoers
@@ -99,9 +99,14 @@ jenkins ALL= NOPASSWD: /usr/bin/make -j ? buildworld, \
/usr/bin/make -j ? distribution, \
/bin/rm -r /usr/src /usr/obj, \
/bin/rm -r /usr/obj, \
+ /bin/rm -r /srv/reproducible-results/* /srv/reproducible-results/*.tar.xz, \
/bin/mkdir /usr/obj, \
/bin/mkdir /usr/src /usr/obj, \
- /usr/sbin/chown jenkins /usr/src /usr/obj
+ /usr/sbin/chown jenkins /usr/src /usr/obj, \
+ /usr/bin/find /srv/reproducible-results/* -exec touch *, \
+ /usr/bin/find /srv/reproducible-results/* -print0, \
+ /usr/bin/tar --null -T - --no-recursion -cJf *.tar.xz
+
## Uncomment to allow any user to run sudo if they know the password
## of the user they are running the command as (root by default).