2
0
MasterPassword/platform-independent/cli-c/distribute

35 lines
1.3 KiB
Plaintext
Raw Normal View History

2014-10-18 19:42:49 +00:00
#!/usr/bin/env bash
set -e
cd "${BASH_SOURCE%/*}"
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; }
mpwArchive=mpw-$commit.tar.gz
[[ -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."
echo "Cleaning .."
2017-04-22 16:30:07 +00:00
( git clean -ffdx . && cd core && git clean -ffdx . )
echo "Creating archive $mpwArchive .."
git show --show-signature --pretty=format:%H --quiet "$tag" > VERSION
2017-09-04 18:37:39 +00:00
{ git ls-files -z .; printf VERSION; } | xargs -0 tar -Lcvzf "$mpwArchive"
echo "Creating archive signature $mpwArchive.sig .."
gpg --detach-sign "$mpwArchive"
2014-10-18 19:42:49 +00:00
echo "Installing archive and signature in current site .."
cd ../../public/site/current
2017-04-22 16:30:07 +00:00
mv "../../../platform-independent/cli-c/$mpwArchive" .; [[ -e $_ ]]
mv "../../../platform-independent/cli-c/$mpwArchive.sig" .; [[ -e $_ ]]
ln -sf "$mpwArchive" "masterpassword-cli.tar.gz"; [[ -e $_ ]]
ln -sf "$mpwArchive.sig" "masterpassword-cli.tar.gz.sig"; [[ -e $_ ]]
echo
2017-04-22 16:30:07 +00:00
echo "Done. Ready to publish the site."
echo " package: $mpwArchive"
echo " signature: $mpwArchive.sig"
echo " url: https://ssl.masterpasswordapp.com/$mpwArchive"