forked from Teradata/kylo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease-git.sh
executable file
·64 lines (46 loc) · 1.74 KB
/
release-git.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
#!/bin/bash
if [ -z $1 ] || [ -z $2 ]; then
echo "Usage: release.sh <release version> <next version>"
exit 1
fi
RELEASE_VERSION=$1
NEXT_VERSION=$2
set -x
setVersion() {
NPM_VERSION=${2:-$1}
mvn versions:set versions:update-child-modules -DgenerateBackupPoms=false -DnewVersion=$1
find ui -name package.json -a \! -path '*node_modules*' -exec sed -i '' "s/\"version\": \"[0-9.A-Z-]*\"/\"version\": \"$NPM_VERSION\"/" {} \;
sed -i '' "s/\"\?ver=[0-9.A-Z-]*\"/\"?ver=$NPM_VERSION\"/" ui/ui-app/src/main/resources/static/js/systemjs.config.js
mvn package -DskipTests -am -pl services/upgrade-service
}
#############################################################
## Cleanup any existing branches and/or tags from a prior run
#############################################################
git tag -d v$RELEASE_VERSION &>/dev/null
git branch -D release-$RELEASE_VERSION &>/dev/null
git branch -D point-$RELEASE_VERSION &>/dev/null
################
## Master branch
################
git checkout master
git pull
git checkout -b release-$RELEASE_VERSION
setVersion ${RELEASE_VERSION}
git commit -a -m "Release $RELEASE_VERSION"
git tag v$RELEASE_VERSION
setVersion ${NEXT_VERSION}-SNAPSHOT
git commit -a -m "Begin $NEXT_VERSION-SNAPSHOT"
git checkout master
git merge release-$RELEASE_VERSION
git push
git push origin v$RELEASE_VERSION
##git branch -d release-$RELEASE_VERSION
#######################
## Point release branch
#######################
git checkout -b point-$RELEASE_VERSION v$RELEASE_VERSION
setVersion ${RELEASE_VERSION}.1-SNAPSHOT ${RELEASE_VERSION}-1-SNAPSHOT
git commit -a -m "Begin $RELEASE_VERSION.1-SNAPSHOT"
git push origin point-$RELEASE_VERSION:release/$RELEASE_VERSION
##git branch -d point-$RELEASE_VERSION
exit 0