[Qa-jenkins-scm] [jenkins.debian.net] 01/01: reproducible fdroid: do full git reset/clean like Jenkins does

Holger Levsen holger at layer-acht.org
Wed Jun 7 18:48:28 UTC 2017


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 000d545d03aa46b2dadebc9c53eaccc0b1994faa
Author: Hans-Christoph Steiner <hans at eds.org>
Date:   Wed Jun 7 20:04:45 2017 +0200

    reproducible fdroid: do full git reset/clean like Jenkins does
    
    Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
 bin/reproducible_fdroid_build_apps.sh              |  7 +++--
 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 c85219d..36d8482 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 438c1f8..257c076 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
 

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