|
27 | 27 | # http://www.apache.org/dev/publishing-maven-artifacts.html |
28 | 28 |
|
29 | 29 | if [[ -z "${TAR}" ]]; then |
30 | | - TAR=/usr/bin/tar |
| 30 | + TAR=/usr/bin/tar |
31 | 31 | fi |
32 | 32 |
|
33 | 33 | if [[ -z "${SHASUM}" ]]; then |
34 | | - SHASUM="/usr/bin/shasum -a 512" |
| 34 | + SHASUM="/usr/bin/shasum -a 512" |
35 | 35 | fi |
36 | 36 |
|
37 | 37 |
|
38 | 38 | if [[ -z "${WORKING_DIR}" ]]; then |
39 | | - WORKING_DIR=/tmp/zeppelin-release |
| 39 | + WORKING_DIR=/tmp/zeppelin-release |
40 | 40 | fi |
41 | 41 |
|
42 | 42 | if [[ -z "${GPG_PASSPHRASE}" ]]; then |
43 | | - echo "You need GPG_PASSPHRASE variable set" |
44 | | - exit 1 |
| 43 | + echo "You need GPG_PASSPHRASE variable set" |
| 44 | + exit 1 |
45 | 45 | fi |
46 | 46 |
|
47 | 47 |
|
48 | 48 | if [[ $# -ne 2 ]]; then |
49 | | - echo "usage) $0 [Release name] [Branch or Tag]" |
50 | | - echo " ex. $0 0.6.0 branch-0.6" |
51 | | - exit 1 |
| 49 | + echo "usage) $0 [Release version] [Tag]" |
| 50 | + echo " ex. $0 0.6.0 v0.6.0-rc1" |
| 51 | + exit 1 |
52 | 52 | fi |
53 | 53 |
|
54 | | -RELEASE_NAME="${1}" |
55 | | -BRANCH="${2}" |
56 | | - |
| 54 | +RELEASE_VERSION="${1}" |
| 55 | +GIT_TAG="${2}" |
57 | 56 |
|
58 | 57 | if [[ -d "${WORKING_DIR}" ]]; then |
59 | | - echo "Dir ${WORKING_DIR} already exists" |
60 | | - exit 1 |
| 58 | + echo "Dir ${WORKING_DIR} already exists" |
| 59 | + exit 1 |
61 | 60 | fi |
62 | 61 |
|
63 | 62 | mkdir ${WORKING_DIR} |
64 | 63 |
|
65 | 64 | echo "Cloning the source and packaging" |
66 | 65 | # clone source |
67 | | -git clone -b ${BRANCH} [email protected]:apache/zeppelin.git ${WORKING_DIR}/zeppelin |
| 66 | +git clone https://git-wip-us.apache.org/repos/asf/zeppelin.git ${WORKING_DIR}/zeppelin |
| 67 | + |
68 | 68 | if [[ $? -ne 0 ]]; then |
69 | | - echo "Can not clone source repository" |
70 | | - exit 1 |
| 69 | + echo "Can not clone source repository" |
| 70 | + exit 1 |
71 | 71 | fi |
72 | 72 |
|
| 73 | +cd ${WORKING_DIR}/zeppelin |
| 74 | +git checkout ${GIT_TAG} |
| 75 | +echo "Checked out ${GIT_TAG}" |
| 76 | + |
73 | 77 | # remove unnecessary files |
74 | 78 | rm ${WORKING_DIR}/zeppelin/.gitignore |
75 | 79 | rm -rf ${WORKING_DIR}/zeppelin/.git |
76 | 80 |
|
77 | 81 |
|
78 | | - |
79 | 82 | # create source package |
80 | 83 | cd ${WORKING_DIR} |
81 | | -cp -r zeppelin zeppelin-${RELEASE_NAME} |
82 | | -${TAR} cvzf zeppelin-${RELEASE_NAME}.tgz zeppelin-${RELEASE_NAME} |
| 84 | +cp -r zeppelin zeppelin-${RELEASE_VERSION} |
| 85 | +${TAR} cvzf zeppelin-${RELEASE_VERSION}.tgz zeppelin-${RELEASE_VERSION} |
83 | 86 |
|
84 | 87 | echo "Signing the source package" |
85 | 88 | cd ${WORKING_DIR} |
86 | | -echo $GPG_PASSPHRASE | gpg --passphrase-fd 0 --armor --output zeppelin-${RELEASE_NAME}.tgz.asc --detach-sig ${WORKING_DIR}/zeppelin-${RELEASE_NAME}.tgz |
87 | | -echo $GPG_PASSPHRASE | gpg --passphrase-fd 0 --print-md MD5 zeppelin-${RELEASE_NAME}.tgz > ${WORKING_DIR}/zeppelin-${RELEASE_NAME}.tgz.md5 |
88 | | -${SHASUM} zeppelin-${RELEASE_NAME}.tgz > ${WORKING_DIR}/zeppelin-${RELEASE_NAME}.tgz.sha512 |
| 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 |
89 | 92 |
|
90 | 93 |
|
91 | 94 | function make_binary_release() { |
92 | | - BIN_RELEASE_NAME="${1}" |
93 | | - BUILD_FLAGS="${2}" |
94 | | - |
95 | | - cp -r ${WORKING_DIR}/zeppelin ${WORKING_DIR}/zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME} |
96 | | - cd ${WORKING_DIR}/zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME} |
97 | | - echo "mvn clean package -Pbuild-distr -DskipTests ${BUILD_FLAGS}" |
98 | | - mvn clean package -Pbuild-distr -DskipTests ${BUILD_FLAGS} |
99 | | - if [[ $? -ne 0 ]]; then |
100 | | - echo "Build failed. ${BUILD_FLAGS}" |
101 | | - exit 1 |
102 | | - fi |
103 | | - |
104 | | - # re-create package with proper dir name with binary license |
105 | | - cd zeppelin-distribution/target/zeppelin-* |
106 | | - mv zeppelin-* zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME} |
107 | | - cat ../../src/bin_license/LICENSE >> zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}/LICENSE |
108 | | - cat ../../src/bin_license/NOTICE >> zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}/NOTICE |
109 | | - cp ../../src/bin_license/licenses/* zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}/licenses/ |
110 | | - ${TAR} cvzf zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}.tgz zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME} |
111 | | - |
112 | | - # sign bin package |
113 | | - echo $GPG_PASSPHRASE | gpg --passphrase-fd 0 --armor --output zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}.tgz.asc --detach-sig zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}.tgz |
114 | | - echo $GPG_PASSPHRASE | gpg --passphrase-fd 0 --print-md MD5 zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}.tgz > zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}.tgz.md5 |
115 | | - ${SHASUM} zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}.tgz > zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}.tgz.sha512 |
116 | | - |
117 | | - mv zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}.tgz ${WORKING_DIR}/ |
118 | | - mv zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}.tgz.asc ${WORKING_DIR}/ |
119 | | - mv zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}.tgz.md5 ${WORKING_DIR}/ |
120 | | - mv zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}.tgz.sha512 ${WORKING_DIR}/ |
121 | | - |
122 | | - # clean up build dir |
123 | | - rm -rf ${WORKING_DIR}/zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME} |
| 95 | + BIN_RELEASE_NAME="${1}" |
| 96 | + BUILD_FLAGS="${2}" |
| 97 | + |
| 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} |
| 100 | + echo "mvn clean package -Pbuild-distr -DskipTests ${BUILD_FLAGS}" |
| 101 | + mvn clean package -Pbuild-distr -DskipTests ${BUILD_FLAGS} |
| 102 | + if [[ $? -ne 0 ]]; then |
| 103 | + echo "Build failed. ${BUILD_FLAGS}" |
| 104 | + exit 1 |
| 105 | + fi |
| 106 | + |
| 107 | + # re-create package with proper dir name with binary license |
| 108 | + 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} |
| 114 | + |
| 115 | + # 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}/ |
| 124 | + |
| 125 | + # clean up build dir |
| 126 | + rm -rf ${WORKING_DIR}/zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME} |
124 | 127 | } |
125 | 128 |
|
126 | 129 | make_binary_release all "-Pspark-1.6 -Phadoop-2.4 -Pyarn -Ppyspark" |
127 | 130 |
|
128 | 131 | # remove non release files and dirs |
129 | 132 | rm -rf ${WORKING_DIR}/zeppelin |
130 | | -rm -rf ${WORKING_DIR}/zeppelin-${RELEASE_NAME} |
| 133 | +rm -rf ${WORKING_DIR}/zeppelin-${RELEASE_VERSION} |
131 | 134 | echo "Release files are created under ${WORKING_DIR}" |
0 commit comments