-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtag.sh
executable file
·42 lines (32 loc) · 932 Bytes
/
tag.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
#!/bin/bash
shopt -s extglob
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null 2>&1 && pwd )"
function usage() {
echo "Usage: $0 <platform> <version> <suffix>"
echo ' <platform> one of java, android'
echo ' <version> the release version (x.y[...])'
echo ' <suffix> release type: probably "beta" or "vf" or some such thing'
exit 1
}
if [[ "$#" -gt 3 ]] || [[ "$#" -lt 2 ]]; then usage; fi
PLATFORM=$1
case $PLATFORM in
java|android) ;;
*) usage;;
esac
VERSION=$2
case $VERSION in
@([2-4]).@([0-9])?(.[0-9]|.1[0-9]));;
*) usage;;
esac
SUFFIX=$3
TAG="${PLATFORM}/${VERSION}"
if [[ "x${SUFFIX}" != "x" ]]; then TAG="${TAG}-${SUFFIX}"; fi
pushd "$SCRIPT_DIR/.." > /dev/null 2>&1
ROOT=`pwd`
for mod in etc common ce "."; do
cd "$ROOT/$mod"
git tag -a $TAG -m"${PLATFORM} version ${VERSION} ${SUFFIX}";
git push origin $TAG
done
popd > /dev/null 2>&1