release-scripts (also called Boris' magic scripts 😇) are designed to be used to perform software releases synchronously in multi-module mono-repositories despite of bunches of different technologies. Using release-scripts may redundantize plugins like maven-release-plugin.
This scripts can help you if you have are working in a git-flow workflow on your project.
Especially the release and hotfix step of git-flow requires a lot commits and merge processes this scripts can help your out. Your can use them locally as well as in ci-pipelines.
- bash terminal
- git version control
- checkout this repo
- copy all *.sh files into your project
- adjust
hooks.sh
for your project environment
- Perform this steps in terminal:
$ git submodule add https://github.com/borisskert/release-scripts release-scripts
$ cp release-scripts/.hooks-default.sh .release-scripts-hooks.sh
- adjust
.release-scripts-hooks.sh
for your project environment
$ ./release.sh <release-version> <snapshot-version>
# Perform next steps the script is telling
$ ./release.sh --no-snapshots <release-version>
# Perform next steps the script is telling
$ ./release.sh [-q|--(no-)quiet] [-v|--(no-)verbose] [-s|--(no-)snapshots] [-h|--help] <release-version> [<snapshot-version>]
Short option | Long option | Default | Description |
---|---|---|---|
-s | --(no-)snapshots | on | Turn on snapshots mode. If enabled the argument is mandatory |
-q | --(no-)quiet | off | Turn on quiet mode for automation |
-v | --(no-)verbose | off | Turn on verbose mode for debugging |
$ ./hotfix_start.sh [-q|--(no-)quiet] [-v|--(no-)verbose] [-s|--(no-)snapshots] [-h|--help] <hotfix-version>
and
$ ./hotfix_finish.sh [-q|--(no-)quiet] [-v|--(no-)verbose] [-s|--(no-)snapshots] [-h|--help] <hotfix-version> [<snapshot-version>]
$ ./hotfix_start.sh <hotfix-version>
# commit and push your work into the hotfix-branch
$ ./hotfix_finish.sh <hotfix-version> <snapshot-version>
$ ./hotfix_start.sh --no-snapshots <hotfix-version>
# commit and push your work into the hotfix-branch
$ ./hotfix_finish.sh --no-snapshots <hotfix-version>
$ ./revert_release <release-version>
If you need to make releases from support branches and also from develop, take care to adjust your hooks to calculate master and develop branches according to versions.
Example: For releasing versions that start with 12.
, i.e. 12.2
we'll use support-12.x
branch, otherwise develop
branch:
function get_develop_branch_name {
if [[ "$1" =~ ^12\..* ]]
then
echo "support-12.x"
else
echo "develop"
fi
}
function get_master_branch_name {
if [[ "$1" =~ ^12\..* ]]
then
echo "master-12.x"
else
echo "master"
fi
}
- Install bats-core
- Go to tests directory
- Run
bats *.bats
$ find . -maxdepth 1 -type f -name '*.sh' -print0 | xargs -0 shellcheck
Make sure you have installed shellcheck on your system.