1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-20 13:50:12 +01:00
fdroidserver/tests/run-tests.sh
Hans-Christoph Steiner 3829d37d34 support repo signing with a key on a smartcard
This assumes that the smartcard is already setup with a signing key.  init
does not generate a key on the smartcard, and skips genkey() if things are
configured to use a smartcard.

This also does not touch APK signing because that is a much more elaborate
question, since each app is signed by its own key.
2014-04-07 16:00:18 -04:00

62 lines
1.4 KiB
Bash
Executable File

#!/bin/sh
set -e
set -x
copy_apks_into_repo() {
for f in `ls -1 ../../*/bin/*.apk`; do
name=$(basename $(dirname `dirname $f`))
echo "name $name"
apk=${name}_`basename $f`
echo "apk $apk"
cp $f $1/repo/$apk
done
# delete any 'unaligned' duplicates
rm -f $1/repo/*unaligned*.apk
}
if [ -z $WORKSPACE ]; then
WORKSPACE=`dirname $(pwd)`
echo "Setting Workspace to $WORKSPACE"
fi
# allow the location of the script to be overridden
if [ -z $fdroid ]; then
fdroid="$WORKSPACE/fdroid"
fi
#------------------------------------------------------------------------------#
# setup a new repo from scratch
REPOROOT=`mktemp --directory --tmpdir=$WORKSPACE`
cd $REPOROOT
$fdroid init
copy_apks_into_repo $REPOROOT
$fdroid update -c
$fdroid update
#------------------------------------------------------------------------------#
# setup a new repo from scratch and generate a keystore
REPOROOT=`mktemp --directory --tmpdir=$WORKSPACE`
KEYSTORE=$REPOROOT/keystore.jks
cd $REPOROOT
$fdroid init --keystore $KEYSTORE
test -e $KEYSTORE
copy_apks_into_repo $REPOROOT
$fdroid update -c
$fdroid update
test -e repo/index.xml
test -e repo/index.jar
#------------------------------------------------------------------------------#
# setup a new repo from scratch with a HSM/smartcard
REPOROOT=`mktemp --directory --tmpdir=$WORKSPACE`
cd $REPOROOT
$fdroid init --keystore NONE
test -e opensc-fdroid.cfg
test ! -e NONE