2017-11-08 09:38:02 +01:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# this is the script run by the Jenkins server to run the tools tests. Be
|
|
|
|
# sure to always run it in its dir, i.e. ./jenkins-test, otherwise it might
|
|
|
|
# remove things that you don't want it to.
|
2017-11-08 09:40:10 +01:00
|
|
|
#
|
|
|
|
# runs here:
|
|
|
|
# https://jenkins.debian.net/job/reproducible_fdroid_test
|
2017-11-08 09:38:02 +01:00
|
|
|
|
|
|
|
if [ `dirname $0` != "." ]; then
|
|
|
|
echo "only run this script like ./`basename $0`"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
# jenkins.debian.net slaves do not export WORKSPACE
|
|
|
|
if [ -z $WORKSPACE ]; then
|
|
|
|
export WORKSPACE=`pwd`
|
|
|
|
fi
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
|
|
|
# set up Android SDK to use the Debian packages in stretch
|
|
|
|
export ANDROID_HOME=/usr/lib/android-sdk
|
|
|
|
|
2017-12-28 22:51:55 +01:00
|
|
|
rm -rf "$WORKSPACE/.testfiles"
|
2017-11-08 13:14:44 +01:00
|
|
|
cd tests
|
2017-12-29 16:06:25 +01:00
|
|
|
echo "Debian's build-tools is too old, remove once the package has been updated"
|
|
|
|
sed -i '/android.permission.READ_EXTERNAL_STORAGE/d' repo/index.xml
|
|
|
|
sed -i '/^diff -uw .*index-v1.json$/d' run-tests
|
2017-12-28 22:51:55 +01:00
|
|
|
./run-tests $WORKSPACE/fdroiddata/repo
|
2017-11-08 13:14:44 +01:00
|
|
|
|
|
|
|
# this is set up and managed by jenkins-build-all
|
2017-11-08 09:38:02 +01:00
|
|
|
cd $WORKSPACE/fdroiddata
|
|
|
|
|
2017-11-28 12:03:39 +01:00
|
|
|
rm -f config.py keystore.jks
|
2017-11-26 22:45:04 +01:00
|
|
|
../fdroid init --verbose
|
|
|
|
../fdroid update
|
2017-11-08 09:38:02 +01:00
|
|
|
|
|
|
|
export GNUPGHOME=$WORKSPACE/tests/gnupghome
|
2017-12-20 13:35:20 +01:00
|
|
|
gpg --import $GNUPGHOME/secring.gpg
|
|
|
|
|
2017-11-27 09:36:01 +01:00
|
|
|
echo "build_server_always = True" >> config.py
|
2017-11-08 09:38:02 +01:00
|
|
|
echo "gpghome = '$GNUPGHOME'" >> config.py
|
|
|
|
echo "gpgkey = 'CE71F7FB'" >> config.py
|
2017-11-10 22:08:31 +01:00
|
|
|
chmod 0600 config.py
|
2017-12-13 17:39:55 +01:00
|
|
|
sed -i '/\s*repo_key_sha256\s*=.*/d' config.py
|
2017-11-08 09:38:02 +01:00
|
|
|
|
|
|
|
# publish process when building and signing are on separate machines
|
|
|
|
test -d repo || mkdir repo
|
|
|
|
test -d archive || mkdir archive
|
|
|
|
# when everything is copied over to run on SIGN machine
|
2017-11-08 13:50:08 +01:00
|
|
|
../fdroid publish
|
|
|
|
../fdroid gpgsign
|
2017-11-08 09:38:02 +01:00
|
|
|
# when everything is copied over to run on BUILD machine
|
2017-11-08 13:50:08 +01:00
|
|
|
../fdroid update --nosign
|
2017-11-08 09:38:02 +01:00
|
|
|
# when everything is copied over to run on SIGN machine
|
|
|
|
../fdroid signindex --verbose
|
|
|
|
|
2017-11-08 13:50:08 +01:00
|
|
|
../fdroid rewritemeta --quiet
|
2017-11-08 09:38:02 +01:00
|
|
|
git --no-pager diff
|