Skip to content

Commit

Permalink
New release checks script (#480)
Browse files Browse the repository at this point in the history
* New release checks script

* Fix keystore check
  • Loading branch information
maxme authored and roundhill committed Dec 19, 2017
1 parent 02fcf0e commit 3da3cd9
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions tools/release-checks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/sh

APPDIR=Simplenote

function pOk() {
echo "[$(tput setaf 2)OK$(tput sgr0)]"
}

function pFail() {
echo "[$(tput setaf 1)KO$(tput sgr0)]"
}

function printVersion() {
gradle_version=$(grep -E 'version ".*"' $APPDIR/build.gradle | sed s/version// | grep -Eo "[a-zA-Z0-9.-]+" )
echo "$APPDIR/build.gradle version $gradle_version"
}

function checkFileAgainstHash() {
filename=$1
known_checksum=$2
checksum=`sha1sum "$filename" | cut -d" " -f1`
if [ x$checksum != x$known_checksum ]; then
pFail
exit 6
fi
pOk
}

function checkGradleProperties() {
/bin/echo -n "Check gradle.properties..."
checkFileAgainstHash $APPDIR/gradle.properties 2e36d6696bc71af3bc976b838966ac40cf06e4fe
}

function checkKeystore() {
keystore=`cat gradle.properties | grep storeFile | cut -d= -f 2 | sed -e 's/^[ ]*//'`
/bin/echo -n "Check Keystore..."
checkFileAgainstHash "$keystore" 7b20577a43b217b668fa875693c006d693679c0c
}

checkGradleProperties
checkKeystore
printVersion

0 comments on commit 3da3cd9

Please sign in to comment.