chiark / gitweb /
use 1.0.0 for release version to make pypi happy
[fdroidserver.git] / jenkins-test
1 #!/bin/bash
2 #
3 # this is the script run by the Jenkins server to run the tools tests.  Be
4 # sure to always run it in its dir, i.e. ./jenkins-test, otherwise it might
5 # remove things that you don't want it to.
6 #
7 # runs here:
8 # https://jenkins.debian.net/job/reproducible_fdroid_test
9
10 if [ `dirname $0` != "." ]; then
11     echo "only run this script like ./`basename $0`"
12     exit
13 fi
14
15 # jenkins.debian.net slaves do not export WORKSPACE
16 if [ -z $WORKSPACE ]; then
17     export WORKSPACE=`pwd`
18 fi
19
20 set -e
21 set -x
22
23 # set up Android SDK to use the Debian packages in stretch
24 export ANDROID_HOME=/usr/lib/android-sdk
25
26 rm -rf "$WORKSPACE/.testfiles"
27 cd tests
28 echo "Debian's build-tools is too old, remove once the package has been updated"
29 sed -i '/android.permission.READ_EXTERNAL_STORAGE/d' repo/index.xml
30 sed -i '/^diff -uw .*index-v1.json$/d' run-tests
31 ./run-tests $WORKSPACE/fdroiddata/repo
32
33 # this is set up and managed by jenkins-build-all
34 cd $WORKSPACE/fdroiddata
35
36 rm -f config.py keystore.jks
37 ../fdroid init --verbose
38 ../fdroid update
39
40 export GNUPGHOME=$WORKSPACE/tests/gnupghome
41 gpg --import $GNUPGHOME/secring.gpg
42
43 echo "build_server_always = True" >> config.py
44 echo "gpghome = '$GNUPGHOME'" >> config.py
45 echo "gpgkey = 'CE71F7FB'" >> config.py
46 chmod 0600 config.py
47 sed -i '/\s*repo_key_sha256\s*=.*/d' config.py
48
49 # publish process when building and signing are on separate machines
50 test -d repo || mkdir repo
51 test -d archive || mkdir archive
52 # when everything is copied over to run on SIGN machine
53 ../fdroid publish
54 ../fdroid gpgsign
55 # when everything is copied over to run on BUILD machine
56 ../fdroid update --nosign
57 # when everything is copied over to run on SIGN machine
58 ../fdroid signindex --verbose
59
60 ../fdroid rewritemeta --quiet
61 git --no-pager diff