2014-10-18 19:42:49 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
cd "${BASH_SOURCE%/*}"
|
2017-04-06 19:04:15 +00:00
|
|
|
tag=$(git describe --match '*-cli*')
|
|
|
|
commit=$(git describe --long --dirty --match '*-cli*')
|
|
|
|
[[ $commit != *-dirty ]] || { echo >&2 "Tree is dirty, first commit any changes."; exit 1; }
|
2014-10-18 19:56:31 +00:00
|
|
|
git show --show-signature --pretty=format:%H --quiet "$tag" > VERSION
|
|
|
|
|
|
|
|
mpwArchive=mpw-$commit.tar.gz
|
2017-04-06 19:04:15 +00:00
|
|
|
[[ -e $mpwArchive ]] && echo >&2 "WARNING: $mpwArchive already exists. Will overwrite."
|
2014-10-18 19:42:49 +00:00
|
|
|
read -n1 -p "Will prepare and release $mpwArchive. Press a key to continue or ^C to abort."
|
|
|
|
|
2017-04-22 15:15:07 +00:00
|
|
|
echo "Cleaning .."
|
2017-04-22 16:20:52 +00:00
|
|
|
( git clean -fdx . && cd core && git clean -fdx . )
|
2017-04-22 15:15:07 +00:00
|
|
|
|
2017-04-06 19:04:15 +00:00
|
|
|
echo "Creating archive $mpwArchive .."
|
2014-12-22 04:55:10 +00:00
|
|
|
git ls-files -z . | xargs -0 tar -Lcvzf "$mpwArchive"
|
2017-04-22 15:15:07 +00:00
|
|
|
|
2017-04-06 19:04:15 +00:00
|
|
|
echo "Creating archive signature $mpwArchive.sig .."
|
|
|
|
gpg --detach-sign "$mpwArchive"
|
2014-10-18 19:42:49 +00:00
|
|
|
|
2017-04-06 19:04:15 +00:00
|
|
|
echo "Installing archive and signature in current site .."
|
2017-04-06 14:14:13 +00:00
|
|
|
cd ../../public/site/current
|
|
|
|
ln -sf "../../../platform-independent/cli-c/$mpwArchive"; [[ -e $_ ]]
|
2017-04-06 19:04:15 +00:00
|
|
|
ln -sf "../../../platform-independent/cli-c/$mpwArchive.sig"; [[ -e $_ ]]
|
2017-04-06 14:14:13 +00:00
|
|
|
ln -sf "$mpwArchive" "masterpassword-cli.tar.gz"; [[ -e $_ ]]
|
2017-04-06 19:04:15 +00:00
|
|
|
ln -sf "$mpwArchive.sig" "masterpassword-cli.tar.gz.sig"; [[ -e $_ ]]
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "Done. Don't forget to publish the site."
|
|
|
|
echo "package: $mpwArchive"
|
|
|
|
echo "signature: $mpwArchive.sig"
|