forked from Qovery/Replibyte
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add a release script, version number in metadata.json file and… (
Qovery#129) * chore: add a release script, version number in metadata.json file and rename backups to dumps * refactor: add a trait to easily add more migrations
- Loading branch information
1 parent
b71f6b8
commit ab75d76
Showing
21 changed files
with
971 additions
and
230 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
TOML_FILES="\ | ||
replibyte/Cargo.toml \ | ||
subset/Cargo.toml \ | ||
dump-parser/Cargo.toml | ||
" | ||
|
||
old=$1 | ||
new=$2 | ||
|
||
if [ -z "${old}" ] || [ -z "${new}" ] | ||
then | ||
echo "please run: $0 <old version> <new version>" | ||
exit 1 | ||
fi | ||
|
||
if [ "$(git status --porcelain=v1 2>/dev/null | wc -l)" -ne 0 ] | ||
then | ||
git status | ||
echo "There are unsaved changes in the repository, press CTRL-C to abort now or return to continue." | ||
read -r answer | ||
fi | ||
|
||
echo -n "Release process from starting from '${old}' -> '${new}', do you want to continue? [y/N] " | ||
read -r answer | ||
|
||
|
||
case "${answer}" in | ||
Y*|y*) | ||
;; | ||
*) | ||
echo "Aborting" | ||
exit 0 | ||
;; | ||
esac; | ||
|
||
echo "==> ${answer}" | ||
|
||
echo -n "Updating TOML files:" | ||
for toml in ${TOML_FILES} | ||
do | ||
echo -n " ${toml}" | ||
sed -e "s/^version = \"${old}\"$/version = \"${new}\"/" -i.release "${toml}" | ||
done | ||
echo "." | ||
|
||
echo "Please review the following changes. (return to continue)" | ||
read -r answer | ||
|
||
git diff | ||
|
||
echo "Do you want to Continue or Rollback? [c/R]" | ||
read -r answer | ||
|
||
case "${answer}" in | ||
C*|c*) | ||
git checkout -b "release-v${new}" | ||
git commit -sa -m "Release v${new}" | ||
git push --set-upstream origin "release-v${new}" | ||
;; | ||
*) | ||
git checkout . | ||
exit | ||
;; | ||
esac; | ||
|
||
echo "Please open the following pull request we'll wait here continue when it is merged." | ||
echo | ||
echo " >> https://github.com/qovery/replibyte/pull/new/release-v${new} <<" | ||
echo | ||
echo "Once you continue we'll generate and push the release tag with the latest 'main'" | ||
read -r answer | ||
|
||
echo "Generating release tag v${new}" | ||
|
||
git checkout main | ||
git pull | ||
git tag -a -m"Release v${new}" "v${new}" | ||
git push --tags | ||
|
||
echo "Congrats release v${new} is done!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.