From ba94d6f11d5f3e5e92755d14272aeef35b156429 Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Fri, 20 Mar 2015 20:22:34 +0100 Subject: eproducible: support for saving artifacts from the builds. use 'artifacts' as the first package when manual scheduling and packages will save files! --- bin/reproducible_build.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'bin/reproducible_build.sh') diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh index d76e52ed..e281e896 100755 --- a/bin/reproducible_build.sh +++ b/bin/reproducible_build.sh @@ -24,6 +24,18 @@ create_results_dirs() { } cleanup_all() { + if [ "$SAVE_ARTIFACTS" == 1 ] ; then + local hash=$(tr -cd '[:alnum:]' < /dev/urandom | fold -w5 | head -1) + local ARTIFACTS="artifacts/r00t-me/tmp-${hash}/${SUITE}/${PACKAGE}" + mkdir -p "/var/lib/jenkins/userContent/$ARTIFACTS" + cp -r $TMPDIR/* "/var/lib/jenkins/userContent/$ARTIFACTS" + echo | tee -a ${RBUILDLOG} + echo "Artifacts from this build are preserved. They will be available for very short time so download them now if you want them." | tee -a ${RBUILDLOG} + echo "You shouldn't trust packages you downloaded from this host, they can contain malware or the worst of your fear, packaged in a debian format." | tee -a ${RBUILDLOG} + echo "If you are not afraid of facing your fears helping the world by investigating reproducible build issues, you can download the artifacts from the following url:" | tee -a ${RBUILDLOG} + echo "https://reproducible.debian.net/$ARTIFACTS" | tee -a ${RBUILDLOG} + echo | tee -a ${RBUILDLOG} + fi rm -r $TMPDIR $TMPCFG } @@ -141,7 +153,7 @@ for i in $SUITES ; do done SQL_SUITES="$SQL_SUITES)" -RESULT=$(sqlite3 -init $INIT ${PACKAGES_DB} "SELECT s.suite, s.id, s.name, sch.date_scheduled FROM schedule AS sch JOIN sources AS s ON sch.package_id=s.id WHERE sch.date_build_started = '' AND s.suite IN $SQL_SUITES ORDER BY date_scheduled LIMIT 1") +RESULT=$(sqlite3 -init $INIT ${PACKAGES_DB} "SELECT s.suite, s.id, s.name, sch.date_scheduled, sch.save_artifacts FROM schedule AS sch JOIN sources AS s ON sch.package_id=s.id WHERE sch.date_build_started = '' AND s.suite IN $SQL_SUITES ORDER BY date_scheduled LIMIT 1") if [ -z "$RESULT" ] ; then echo "No packages scheduled, sleeping 30m." sleep 30m @@ -151,6 +163,7 @@ else SRCPKGID=$(echo $RESULT|cut -d "|" -f2) SRCPACKAGE=$(echo $RESULT|cut -d "|" -f3) SCHEDULED_DATE=$(echo $RESULT|cut -d "|" -f4) + SAVE_ARTIFACTS=$(echo $RESULT|cut -d "|" -f5) create_results_dirs echo "=============================================================================" echo "Trying to reproducibly build ${SRCPACKAGE} in ${SUITE} on ${ARCH} now." -- cgit v1.2.3-54-g00ecf