diff options
author | Hans-Christoph Steiner <hans@eds.org> | 2017-06-07 20:04:45 +0200 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2017-06-07 20:48:08 +0200 |
commit | 000d545d03aa46b2dadebc9c53eaccc0b1994faa (patch) | |
tree | f1c16f7ec629ad8f2ba67be38ccd2b190dc1a433 /bin | |
parent | db5e8c559a3f1b86a2e43ce1ce30a499af5f0e15 (diff) | |
download | jenkins.debian.net-000d545d03aa46b2dadebc9c53eaccc0b1994faa.tar.xz |
reproducible fdroid: do full git reset/clean like Jenkins does
Signed-off-by: Holger Levsen <holger@layer-acht.org>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/reproducible_fdroid_build_apps.sh | 7 | ||||
-rwxr-xr-x | bin/reproducible_setup_fdroid_build_environment.sh | 32 |
2 files changed, 24 insertions, 15 deletions
diff --git a/bin/reproducible_fdroid_build_apps.sh b/bin/reproducible_fdroid_build_apps.sh index c85219d7..36d8482e 100755 --- a/bin/reproducible_fdroid_build_apps.sh +++ b/bin/reproducible_fdroid_build_apps.sh @@ -17,8 +17,9 @@ common_init "$@" # 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 directl call to ssh. -export WORKSPACE=$BASE/fdroid-build +# 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 @@ -30,7 +31,7 @@ if [ -e $WORKSPACE/.git ]; then git clean -fdx else rm -rf $WORKSPACE - git clone https://gitlab.com/eighthave/fdroidserver-for-jenkins.debian.net.git $WORKSPACE + git clone https://gitlab.com/eighthave/fdroidserver-for-jenkins.debian.net $WORKSPACE cd $WORKSPACE fi 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 |