forked from markgrover/cdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrocana-release.sh
executable file
·75 lines (62 loc) · 2.06 KB
/
rocana-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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
set -x
MVN=$(type -p mvn)
MVN_FLAGS="-B"
if [ -z "${KITE_RELEASE_VERSION}" ] || [ -z "${KITE_DEVELOPMENT_VERSION}" ]; then
echo "You must set KITE_RELEASE_VERSION and KITE_DEVELOPMENT_VERSION before running this script."
exit 1
fi
if [ -n "${WORKSPACE}" ]; then
MVN_FLAGS="${MVN_FLAGS} -f ${WORKSPACE}/pom.xml"
MVN_FLAGS="${MVN_FLAGS} -Dmaven.repo.local=${WORKSPACE}/.repository"
fi
error() {
local msg="$1"
local retcode="$2"
echo "Error: $msg"
[ -n "$retcode" ] && exit "$retcode"
}
# Set the version to the next release
${MVN} ${MVN_FLAGS} \
versions:set \
-DnewVersion=${KITE_RELEASE_VERSION} \
-DgenerateBackupPoms=false ||
error "Unable to update the release version to ${KITE_RELEASE_VERSION}" 1
# Commit and push the version number update
${MVN} ${MVN_FLAGS} \
scm:add \
-Dincludes=**/pom.xml \
-Dexcludes=**/target/**/pom.xml \
scm:checkin \
-Dmessage="ROCANA-BUILD: Preparing for release ${KITE_RELEASE_VERSION}" ||
error "Unable to checkin the update of the release version to ${KITE_RELEASE_VERSION}" 1
# Deploy the release to the maven repo
${MVN} ${MVN_FLAGS} \
clean \
deploy ||
error "Unable to deploy CDH artifacts to nexus" 1
# Deploy the hdp release to the maven repo
${MVN} ${MVN_FLAGS} \
-Phdp,hdp-release \
clean \
deploy ||
error "Unable to deploy HDP artifacts to nexus" 1
# Tag the release in git
${MVN} ${MVN_FLAGS} \
scm:tag \
-Dtag=release-${KITE_RELEASE_VERSION} ||
error "Unable to create release tag" 1
# Set the version to the next development version
${MVN} ${MVN_FLAGS} \
versions:set \
-DnewVersion=${KITE_DEVELOPMENT_VERSION} \
-DgenerateBackupPoms=false ||
error "Unable to update the development version to ${KITE_DEVELOPMENT_VERSION}" 1
# Commit and push the version number update
${MVN} ${MVN_FLAGS} \
scm:add \
-Dincludes=**/pom.xml \
-Dexcludes=**/target/**/pom.xml \
scm:checkin \
-Dmessage="ROCANA-BUILD: Preparing for ${KITE_DEVELOPMENT_VERSION} development" ||
error "Unable to checkin the update of the development version to ${KITE_DEVELOPMENT_VERSION}" 1