From 000d545d03aa46b2dadebc9c53eaccc0b1994faa Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Wed, 7 Jun 2017 20:04:45 +0200 Subject: reproducible fdroid: do full git reset/clean like Jenkins does Signed-off-by: Holger Levsen --- bin/reproducible_setup_fdroid_build_environment.sh | 32 ++++++++++++++-------- 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'bin/reproducible_setup_fdroid_build_environment.sh') diff --git a/bin/reproducible_setup_fdroid_build_environment.sh b/bin/reproducible_setup_fdroid_build_environment.sh index 438c1f80..257c0767 100755 --- a/bin/reproducible_setup_fdroid_build_environment.sh +++ b/bin/reproducible_setup_fdroid_build_environment.sh @@ -14,10 +14,26 @@ common_init "$@" # common code . /srv/jenkins/bin/reproducible_common.sh -# define and clean work space (differently than jenkins would normally do as we run via ssh on a different node…) -WORKSPACE=$BASE/fdroid -rm $WORKSPACE -rf -mkdir -p $WORKSPACE +# define and clean work space on the machine actually running the +# build. jenkins.debian.net does not use Jenkins slaves. Instead +# /srv/jenkins/bin/jenkins_master_wrapper.sh runs this script on the +# slave using a directly call to ssh, so this script has to do all +# of the workspace setup. +export WORKSPACE=$BASE/`basename $0 | sed 's,\.sh,,'` +if [ -e $WORKSPACE/.git ]; then + # reuse the git repo if possible, to keep all the setup in fdroiddata/ + cd $WORKSPACE + git fetch --tags + git clean -fdx + git reset --hard + git checkout master + git reset --hard origin/master + git clean -fdx +else + rm -rf $WORKSPACE + git clone https://gitlab.com/eighthave/fdroidserver-for-jenkins.debian.net $WORKSPACE + cd $WORKSPACE +fi cleanup_all() { echo "$(date -u) - cleanup in progress..." @@ -47,14 +63,6 @@ cat /etc/issue virsh --connect qemu:///system undefine builder_default || echo nothing to undefine virsh --connect qemu:///system vol-delete --pool default /var/lib/libvirt/images/builder_default.img || echo nothing to delete -# the way we handle jenkins slaves doesn't copy the workspace to the slaves -# so we need to "manually" clone the git repo here… -cd $WORKSPACE -#git clone https://gitlab.com/fdroid/fdroidserver.git -git clone https://gitlab.com/uniqx/fdroidserver.git -cd fdroidserver -git checkout jenkins.debian.net # normally master too - # set up Android SDK to use the Debian packages in stretch export ANDROID_HOME=/usr/lib/android-sdk -- cgit v1.2.3-54-g00ecf