1818#
1919
2020# The script helps making a release.
21- # You need specify a release name and branch|tag name.
21+ # You need to specify release version and branch|tag name.
2222#
23- # Here's some helpful documents for the release
23+ # Here are some helpful documents for the release.
2424# http://www.apache.org/dev/release.html
2525# http://www.apache.org/dev/release-publishing
2626# http://www.apache.org/dev/release-signing.html
27- # http://www.apache.org/dev/publishing-maven-artifacts.html
28-
29- if [[ -z " ${TAR} " ]]; then
30- TAR=/usr/bin/tar
31- fi
32-
33- if [[ -z " ${SHASUM} " ]]; then
34- SHASUM=" /usr/bin/shasum -a 512"
35- fi
3627
28+ BASEDIR=" $( dirname " $0 " ) "
29+ . " ${BASEDIR} /common_release.sh"
30+ echo " ${BASEDIR} /common_release.sh"
3731
38- if [[ -z " ${WORKING_DIR} " ]]; then
39- WORKING_DIR=/tmp/zeppelin-release
32+ if [[ $# -ne 2 ]]; then
33+ usage
4034fi
4135
4236if [[ -z " ${GPG_PASSPHRASE} " ]]; then
4337 echo " You need GPG_PASSPHRASE variable set"
4438 exit 1
4539fi
4640
47-
48- if [[ $# -ne 2 ]]; then
49- echo " usage) $0 [Release version] [Tag]"
50- echo " ex. $0 0.6.0 v0.6.0-rc1"
51- exit 1
52- fi
53-
54- RELEASE_VERSION=" ${1} "
55- GIT_TAG=" ${2} "
56-
57- if [[ -d " ${WORKING_DIR} " ]]; then
58- echo " Dir ${WORKING_DIR} already exists"
59- exit 1
60- fi
61-
62- mkdir ${WORKING_DIR}
63-
64- echo " Cloning the source and packaging"
65- # clone source
66- git clone https://git-wip-us.apache.org/repos/asf/zeppelin.git ${WORKING_DIR} /zeppelin
67-
68- if [[ $? -ne 0 ]]; then
69- echo " Can not clone source repository"
70- exit 1
71- fi
72-
73- cd ${WORKING_DIR} /zeppelin
74- git checkout ${GIT_TAG}
75- echo " Checked out ${GIT_TAG} "
76-
77- # remove unnecessary files
78- rm ${WORKING_DIR} /zeppelin/.gitignore
79- rm -rf ${WORKING_DIR} /zeppelin/.git
80-
81-
82- # create source package
83- cd ${WORKING_DIR}
84- cp -r zeppelin zeppelin-${RELEASE_VERSION}
85- ${TAR} cvzf zeppelin-${RELEASE_VERSION} .tgz zeppelin-${RELEASE_VERSION}
86-
87- echo " Signing the source package"
88- cd ${WORKING_DIR}
89- echo $GPG_PASSPHRASE | gpg --passphrase-fd 0 --armor --output zeppelin-${RELEASE_VERSION} .tgz.asc --detach-sig ${WORKING_DIR} /zeppelin-${RELEASE_VERSION} .tgz
90- echo $GPG_PASSPHRASE | gpg --passphrase-fd 0 --print-md MD5 zeppelin-${RELEASE_VERSION} .tgz > ${WORKING_DIR} /zeppelin-${RELEASE_VERSION} .tgz.md5
91- ${SHASUM} zeppelin-${RELEASE_VERSION} .tgz > ${WORKING_DIR} /zeppelin-${RELEASE_VERSION} .tgz.sha512
92-
41+ RELEASE_VERSION=" $1 "
42+ GIT_TAG=" $2 "
43+
44+ function make_source_package() {
45+ # create source package
46+ cd ${WORKING_DIR}
47+ cp -r " zeppelin" " zeppelin-${RELEASE_VERSION} "
48+ ${TAR} cvzf " zeppelin-${RELEASE_VERSION} .tgz" " zeppelin-${RELEASE_VERSION} "
49+
50+ echo " Signing the source package"
51+ cd " ${WORKING_DIR} "
52+ echo " ${GPG_PASSPHRASE} " | gpg --passphrase-fd 0 --armor \
53+ --output " zeppelin-${RELEASE_VERSION} .tgz.asc" \
54+ --detach-sig " ${WORKING_DIR} /zeppelin-${RELEASE_VERSION} .tgz"
55+ echo " ${GPG_PASSPHRASE} " | gpg --passphrase-fd 0 \
56+ --print-md MD5 " zeppelin-${RELEASE_VERSION} .tgz" > \
57+ " ${WORKING_DIR} /zeppelin-${RELEASE_VERSION} .tgz.md5"
58+ echo " ${GPG_PASSPHRASE} " | gpg --passphrase-fd 0 \
59+ --print-md SHA512 " zeppelin-${RELEASE_VERSION} .tgz" > \
60+ " ${WORKING_DIR} /zeppelin-${RELEASE_VERSION} .tgz.sha512"
61+ }
9362
9463function make_binary_release() {
95- BIN_RELEASE_NAME=" ${1} "
96- BUILD_FLAGS=" ${2} "
64+ BIN_RELEASE_NAME=" $1 "
65+ BUILD_FLAGS=" $2 "
9766
98- cp -r ${WORKING_DIR} /zeppelin ${WORKING_DIR} /zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME}
99- cd ${WORKING_DIR} /zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME}
67+ cp -r " ${WORKING_DIR} /zeppelin" " ${WORKING_DIR} /zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME} "
68+ cd " ${WORKING_DIR} /zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME} "
10069 echo " mvn clean package -Pbuild-distr -DskipTests ${BUILD_FLAGS} "
10170 mvn clean package -Pbuild-distr -DskipTests ${BUILD_FLAGS}
10271 if [[ $? -ne 0 ]]; then
@@ -106,29 +75,36 @@ function make_binary_release() {
10675
10776 # re-create package with proper dir name with binary license
10877 cd zeppelin-distribution/target/zeppelin-*
109- mv zeppelin-* zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME}
110- cat ../../src/bin_license/LICENSE >> zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME} /LICENSE
111- cat ../../src/bin_license/NOTICE >> zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME} /NOTICE
112- cp ../../src/bin_license/licenses/* zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME} /licenses/
113- ${TAR} cvzf zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME} .tgz zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME}
78+ mv zeppelin-* " zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME} "
79+ cat ../../src/bin_license/LICENSE >> " zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME} /LICENSE"
80+ cat ../../src/bin_license/NOTICE >> " zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME} /NOTICE"
81+ cp ../../src/bin_license/licenses/* " zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME} /licenses/"
82+ ${TAR} cvzf " zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME} .tgz" " zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME} "
11483
11584 # sign bin package
116- echo $GPG_PASSPHRASE | gpg --passphrase-fd 0 --armor --output zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME} .tgz.asc --detach-sig zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME} .tgz
117- echo $GPG_PASSPHRASE | gpg --passphrase-fd 0 --print-md MD5 zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME} .tgz > zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME} .tgz.md5
118- ${SHASUM} zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME} .tgz > zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME} .tgz.sha512
119-
120- mv zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME} .tgz ${WORKING_DIR} /
121- mv zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME} .tgz.asc ${WORKING_DIR} /
122- mv zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME} .tgz.md5 ${WORKING_DIR} /
123- mv zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME} .tgz.sha512 ${WORKING_DIR} /
85+ echo " ${GPG_PASSPHRASE} " | gpg --passphrase-fd 0 --armor \
86+ --output " zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME} .tgz.asc" \
87+ --detach-sig " zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME} .tgz"
88+ echo " ${GPG_PASSPHRASE} " | gpg --passphrase-fd 0 --print-md MD5 \
89+ " zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME} .tgz" > \
90+ " zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME} .tgz.md5"
91+ ${SHASUM} -a 512 " zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME} .tgz" > \
92+ " zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME} .tgz.sha512"
93+
94+ mv " zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME} .tgz" " ${WORKING_DIR} /"
95+ mv " zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME} .tgz.asc" " ${WORKING_DIR} /"
96+ mv " zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME} .tgz.md5" " ${WORKING_DIR} /"
97+ mv " zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME} .tgz.sha512" " ${WORKING_DIR} /"
12498
12599 # clean up build dir
126- rm -rf ${WORKING_DIR} /zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME}
100+ rm -rf " ${WORKING_DIR} /zeppelin-${RELEASE_VERSION} -bin-${BIN_RELEASE_NAME} "
127101}
128102
103+ git_clone
104+ make_source_package
129105make_binary_release all " -Pspark-1.6 -Phadoop-2.4 -Pyarn -Ppyspark"
130106
131107# remove non release files and dirs
132- rm -rf ${WORKING_DIR} /zeppelin
133- rm -rf ${WORKING_DIR} /zeppelin-${RELEASE_VERSION}
108+ rm -rf " ${WORKING_DIR} /zeppelin"
109+ rm -rf " ${WORKING_DIR} /zeppelin-${RELEASE_VERSION} "
134110echo " Release files are created under ${WORKING_DIR} "
0 commit comments