-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathrelease.sh
58 lines (50 loc) · 879 Bytes
/
release.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
#!/bin/sh
## Utility script to release project with a tag
## Usage:
## ./release.sh <tag-name>
usage() {
echo "Usage: $0 <component> <tag-name>"
echo "where <component> is one of:"
echo " cli - DO CMS CLI tool"
echo " runtime - DO CMS runtime"
echo " core - stable release"
exit -1
}
release() {
component="$1"
tag="$2"
echo "Tagging $component-$tag..."
git tag -f -a "$component-$tag" -m "$component-$tag"
git push origin "$component-$tag" -f
}
releaseCli() {
release cli "$1"
}
releaseRuntime() {
release rt "$1"
}
releaseCore() {
tag="$1"
#releaseCli "$tag"
#releaseRuntime "$tag"
echo "Tagging $tag..."
git tag -f -a "$tag" -m "$tag"
git push origin "$tag" -f
}
if [ "$#" -ne 2 ]; then
usage
fi
case "$1" in
"cli")
releaseCli "$2"
;;
"runtime"|"rt")
releaseRuntime "$2"
;;
"core")
releaseCore "$2"
;;
*)
usage
;;
esac