X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=releng%2Forg.simantics.sdk.build.p2.site%2Fsign.sh;fp=releng%2Forg.simantics.sdk.build.p2.site%2Fsign.sh;h=04dc132286ff144ffdaf90924b95b6f791405d57;hp=0000000000000000000000000000000000000000;hb=f4086539192b186ada63d7bc791038dec3aa9312;hpb=013df68afa182f2c8d0b8a662437e3bcb889d61d diff --git a/releng/org.simantics.sdk.build.p2.site/sign.sh b/releng/org.simantics.sdk.build.p2.site/sign.sh new file mode 100755 index 000000000..04dc13228 --- /dev/null +++ b/releng/org.simantics.sdk.build.p2.site/sign.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +dir=`dirname $0` + +if [ $# -lt 3 ]; then + echo "Usage: sign.sh " + echo "" + echo " must contain the following properties:" + echo " jarsigner.alias: keystore entry alias" + echo " jarsigner.storepass: password for the keystore" + echo " jarsigner.keypass: password for the key " + echo "" + echo " can be empty is timestamping is not desired." + exit -1 +fi + +keystore=$1 +signprops=$2 +tsa=$3 + +function signprop { + grep "${1}" ${signprops}|cut -d'=' -f2 +} + +echo "----" +echo "script directory: ${dir}" +echo "keystore: ${keystore}" +echo "signing property file: ${signprops}" +echo "TSA URL: ${tsa}" + +keyalias=$(signprop 'jarsigner.alias') +storepass=$(signprop 'jarsigner.storepass') +keypass=$(signprop 'jarsigner.keypass') + +for jar in `find ${dir}/target/repository/plugins/ -type f -not -ipath '*.source_*.jar'`; do + echo "----" + if [ -z ${tsa} ]; then + echo "Signing $jar" + jarsigner -keystore ${keystore} \ + -storepass ${storepass} \ + -keypass ${keypass} \ + -verbose \ + $jar \ + ${keyalias} + else + echo "Signing and timestamping $jar" + jarsigner -keystore ${keystore} \ + -storepass ${storepass} \ + -keypass ${keypass} \ + -verbose \ + -tsa "${tsa}" \ + $jar \ + ${keyalias} + fi +done +