-
Notifications
You must be signed in to change notification settings - Fork 11
/
.release-scripts-hooks.sh
117 lines (100 loc) · 3.45 KB
/
.release-scripts-hooks.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#!/bin/bash
# ********************** INFO *********************
# This file is used to define default settings.
# Please do not change it.
# To override these settings please define functions
# with the same name in file hooks.sh in this directory
# or in file .release-script-hook.sh in parent directory
# *************************************************
set -e
# Hook method to format your release tag
# Parameter $1 - version as text
# Returns tag as text
function format_release_tag {
echo "v$1"
}
# Hook method to format your next snapshot version
# Parameter $1 - version as text
# Returns snapshot version as text
function format_snapshot_version {
echo "$1-SNAPSHOT"
}
# Hook method to define the remote repository name
# Returns the name of the remote repository as text
function get_remote_repo_name {
echo "origin"
}
# Hook method to define the develop branch name
# Returns the develop branch name as text
function get_develop_branch_name {
echo "develop"
}
# Hook method to define the master branch name
# Returns the master branch name as text
function get_master_branch_name {
echo "master"
}
# Hook method to format the release branch name
# Parameter $1 - version as text
# Returns the formatted release branch name as text
function format_release_branch_name {
echo "release-$1"
}
# Hook method to format the hotfix branch name
# Parameter $1 - version as text
# Returns the formatted hotfix branch name as text
function format_hotfix_branch_name {
echo "hotfix-$1"
}
# Hook to build the snapshot modules before release
# You can build and run your tests here to avoid releasing an unstable build
function build_snapshot_modules {
echo "do nothing" >> /dev/null
}
# Hook to build the released modules after release
# You can deploy your artifacts here
function build_release_modules {
echo "do nothing" >> /dev/null
}
# Should set version numbers in your modules
# Parameter $1 - version as text
function set_modules_version {
cd $SCRIPT_PATH/.. && mvn -B versions:set -DnewVersion=$1
cd $SCRIPT_PATH/../sts-client-example && npm version --no-git-tag-version $1
}
# Builds the commit message used for your commit which setups the next snapshot version
# Parameter $1 - release version as text
function get_next_snapshot_commit_message {
echo "[skip ci] Start next iteration with $1"
}
# Builds the commit message for your commit which setups the hotfix branch
# Parameter $1 - hotfix snapshot version
function get_start_hotfix_commit_message {
echo "[skip ci] Start hotfix $1"
}
# Builds the commit message used for setup the next snapshot version after hotfix is released
# Parameter $1 - next snapshot version
# Parameter $2 - released hotfix version
function get_next_snapshot_commit_message_after_hotfix {
echo "[skip ci] Start next iteration with $1 after hotfix $2"
}
# Builds the commit message used for your release commit
# Parameter $1 - release version as text
function get_release_commit_message {
echo "[release] Prepare release $1"
}
# Builds the tag message used for your release tag
# Parameter $1 - release version as text
function get_release_tag_message {
echo "[release] Release $1"
}
# Builds the chommit message for your hotfix release commit
# Parameter $1 - hotfix release version
function get_release_hotfix_commit_message {
echo "[release] Release hotfix $1"
}
# Builds the tag message used for your hotfix release tag
# Parameter $1 - hotfix release version
function get_hotfix_relesae_tag_message {
echo "[release] Release $1"
}