1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-21 12:41:44 +03:00
vimr/bin/commit_and_push_appcast.sh

30 lines
907 B
Bash
Raw Normal View History

2016-10-15 10:38:09 +03:00
#!/bin/bash
2019-12-22 23:45:42 +03:00
set -Eeuo pipefail
2016-10-15 10:38:09 +03:00
2019-12-22 23:45:42 +03:00
echo "### Commit and push appcast"
pushd "$( dirname "${BASH_SOURCE[0]}" )/.." > /dev/null
2016-10-18 19:00:15 +03:00
2019-12-22 23:45:42 +03:00
readonly branch=${branch:?"Eg develop"}
readonly compound_version=${compound_version:?"Eg v0.29.0-329"}
readonly is_snapshot=${is_snapshot:?"true or false"}
readonly update_snapshot_appcast_for_release=${update_snapshot_appcast_for_release:?"true or false"}
2016-10-15 10:38:09 +03:00
2019-12-22 23:45:42 +03:00
if [[ ${is_snapshot} == true ]] ; then
2017-11-30 00:59:49 +03:00
cp ./build/Build/Products/Release/appcast_snapshot.xml .
2016-10-15 10:47:11 +03:00
else
2017-11-30 00:59:49 +03:00
cp ./build/Build/Products/Release/appcast.xml .
2016-10-15 10:47:11 +03:00
fi
2016-10-15 10:38:09 +03:00
2019-12-22 23:45:42 +03:00
if [[ ${is_snapshot} == false ]] && [[ ${update_snapshot_appcast_for_release} == true ]]; then
cp appcast.xml appcast_snapshot.xml
fi
2019-12-22 23:45:42 +03:00
echo "### Commiting and pushing appcast(s) to ${branch}"
git add appcast*
git commit -m "Bump appcast(s) to ${compound_version}"
2019-12-22 23:45:42 +03:00
git push origin HEAD:"${branch}"
2019-12-22 23:45:42 +03:00
popd > /dev/null
echo "### Committed and pushed appcast(s)"