Skip to content

Commit 85d7057

Browse files
committed
[ZEPPELIN-986] Create publish release script
### What is this PR for? This PR is to automate release publish to maven repository. We used to use maven-deploy-plugin and maven-release-plugin for release but somehow it didn't work well with Zeppelin so 0.5.5 and 0.5.6 haven't been published to maven repository. Publishing release to maven repository will eventually help zeppelin to reduce binary package size by leading users to use Dynamic interpreter loading(#908). Originally below modules were skipped for maven release - all interpreters(except spark) - zeppelin-display - zeppelin-server - zeppelin-distribution on the other hand this pr will skip only: - zeppelin-distribution ### What type of PR is it? Infra ### Todos - [x] Include SparkR/R interpreter in release - [x] Create common_release.sh to remove build configuration duplication - [x] Check curl networking failure ### What is the Jira issue? [ZEPPELIN-986](https://issues.apache.org/jira/browse/ZEPPELIN-986) ### Questions: * Does the licenses files need update? No * Is there breaking changes for older versions? No * Does this needs documentation? Yes, https://cwiki.apache.org/confluence/display/ZEPPELIN/Preparing+Zeppelin+Release will be updated accordingly once this pr is merged. Author: Mina Lee <[email protected]> Closes #994 from minahlee/ZEPPELIN-986 and squashes the following commits: b0e8e67 [Mina Lee] Revert "Add geode, scalding profile in maven artifact build" cd4cbcd [Mina Lee] curl failure check c0ea07c [Mina Lee] Fix wrong indentation a88bc1d [Mina Lee] Add geode, scalding profile in maven artifact build 2cced61 [Mina Lee] Add r to binary package and maven build 903bc12 [Mina Lee] Move duplicate code to common_release.sh a3eb676 [Mina Lee] Include zeppelin-server module in publish artifiact 48d338f [Mina Lee] Rollback mistakenly removed plugin aafaf42 [Mina Lee] Follow google shell style guide 30dcc65 [Mina Lee] remove deploy plugin from pom since custom script will be used instead for deploy cd1f08c [Mina Lee] Refactor create release script e764f5f [Mina Lee] Add maven publish release script
1 parent ab5ce62 commit 85d7057

File tree

27 files changed

+300
-320
lines changed

27 files changed

+300
-320
lines changed

alluxio/pom.xml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,6 @@
132132

133133
<build>
134134
<plugins>
135-
<plugin>
136-
<groupId>org.apache.maven.plugins</groupId>
137-
<artifactId>maven-deploy-plugin</artifactId>
138-
<version>2.7</version>
139-
<configuration>
140-
<skip>true</skip>
141-
</configuration>
142-
</plugin>
143-
144135
<plugin>
145136
<artifactId>maven-enforcer-plugin</artifactId>
146137
<version>1.3.1</version>

angular/pom.xml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,6 @@
6060

6161
<build>
6262
<plugins>
63-
<plugin>
64-
<groupId>org.apache.maven.plugins</groupId>
65-
<artifactId>maven-deploy-plugin</artifactId>
66-
<version>2.7</version>
67-
<configuration>
68-
<skip>true</skip>
69-
</configuration>
70-
</plugin>
71-
7263
<plugin>
7364
<artifactId>maven-enforcer-plugin</artifactId>
7465
<version>1.3.1</version>

cassandra/pom.xml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -230,15 +230,6 @@
230230
</executions>
231231
</plugin>
232232

233-
<plugin>
234-
<groupId>org.apache.maven.plugins</groupId>
235-
<artifactId>maven-deploy-plugin</artifactId>
236-
<version>2.7</version>
237-
<configuration>
238-
<skip>true</skip>
239-
</configuration>
240-
</plugin>
241-
242233
<plugin>
243234
<artifactId>maven-enforcer-plugin</artifactId>
244235
<version>1.3.1</version>

dev/common_release.sh

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/bin/bash
2+
3+
#
4+
# Licensed to the Apache Software Foundation (ASF) under one or more
5+
# contributor license agreements. See the NOTICE file distributed with
6+
# this work for additional information regarding copyright ownership.
7+
# The ASF licenses this file to You under the Apache License, Version 2.0
8+
# (the "License"); you may not use this file except in compliance with
9+
# the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
#
19+
20+
# common fucntions
21+
22+
if [[ -z "${TAR}" ]]; then
23+
TAR="/usr/bin/tar"
24+
fi
25+
26+
if [[ -z "${SHASUM}" ]]; then
27+
SHASUM="/usr/bin/shasum"
28+
fi
29+
30+
if [[ -z "${WORKING_DIR}" ]]; then
31+
WORKING_DIR="/tmp/zeppelin-release"
32+
fi
33+
34+
mkdir "${WORKING_DIR}"
35+
36+
usage() {
37+
echo "usage) $0 [Release version] [Branch or Tag]"
38+
echo " ex. $0 0.6.0 v0.6.0"
39+
exit 1
40+
}
41+
42+
function git_clone() {
43+
echo "Clone the source"
44+
# clone source
45+
git clone https://git-wip-us.apache.org/repos/asf/zeppelin.git "${WORKING_DIR}/zeppelin"
46+
47+
if [[ $? -ne 0 ]]; then
48+
echo "Can not clone source repository"
49+
exit 1
50+
fi
51+
52+
cd "${WORKING_DIR}/zeppelin"
53+
git checkout "${GIT_TAG}"
54+
echo "Checked out ${GIT_TAG}"
55+
56+
# remove unnecessary files
57+
rm "${WORKING_DIR}/zeppelin/.gitignore"
58+
rm -rf "${WORKING_DIR}/zeppelin/.git"
59+
rm -rf "${WORKING_DIR}/zeppelin/.github"
60+
rm -rf "${WORKING_DIR}/zeppelin/docs"
61+
}

dev/create_release.sh

Lines changed: 72 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -18,114 +18,93 @@
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
36-
37-
38-
if [[ -z "${WORKING_DIR}" ]]; then
39-
WORKING_DIR=/tmp/zeppelin-release
40-
fi
41-
42-
if [[ -z "${GPG_PASSPHRASE}" ]]; then
43-
echo "You need GPG_PASSPHRASE variable set"
44-
exit 1
45-
fi
4627

28+
BASEDIR="$(dirname "$0")"
29+
. "${BASEDIR}/common_release.sh"
30+
echo "${BASEDIR}/common_release.sh"
4731

4832
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
33+
usage
5234
fi
5335

54-
RELEASE_NAME="${1}"
55-
BRANCH="${2}"
56-
57-
58-
if [[ -d "${WORKING_DIR}" ]]; then
59-
echo "Dir ${WORKING_DIR} already exists"
60-
exit 1
61-
fi
62-
63-
mkdir ${WORKING_DIR}
64-
65-
echo "Cloning the source and packaging"
66-
# clone source
67-
git clone -b ${BRANCH} [email protected]:apache/zeppelin.git ${WORKING_DIR}/zeppelin
68-
if [[ $? -ne 0 ]]; then
69-
echo "Can not clone source repository"
70-
exit 1
36+
if [[ -z "${GPG_PASSPHRASE}" ]]; then
37+
echo "You need GPG_PASSPHRASE variable set"
38+
exit 1
7139
fi
7240

73-
# remove unnecessary files
74-
rm ${WORKING_DIR}/zeppelin/.gitignore
75-
rm -rf ${WORKING_DIR}/zeppelin/.git
76-
77-
78-
79-
# create source package
80-
cd ${WORKING_DIR}
81-
cp -r zeppelin zeppelin-${RELEASE_NAME}
82-
${TAR} cvzf zeppelin-${RELEASE_NAME}.tgz zeppelin-${RELEASE_NAME}
83-
84-
echo "Signing the source package"
85-
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-
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+
}
9062

9163
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}
64+
BIN_RELEASE_NAME="$1"
65+
BUILD_FLAGS="$2"
66+
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}"
69+
echo "mvn clean package -Pbuild-distr -DskipTests ${BUILD_FLAGS}"
70+
mvn clean package -Pbuild-distr -DskipTests ${BUILD_FLAGS}
71+
if [[ $? -ne 0 ]]; then
72+
echo "Build failed. ${BUILD_FLAGS}"
73+
exit 1
74+
fi
75+
76+
# re-create package with proper dir name with binary license
77+
cd zeppelin-distribution/target/zeppelin-*
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}"
83+
84+
# sign bin package
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}/"
98+
99+
# clean up build dir
100+
rm -rf "${WORKING_DIR}/zeppelin-${RELEASE_VERSION}-bin-${BIN_RELEASE_NAME}"
124101
}
125102

126-
make_binary_release all "-Pspark-1.6 -Phadoop-2.4 -Pyarn -Ppyspark"
103+
git_clone
104+
make_source_package
105+
make_binary_release all "-Pspark-1.6 -Phadoop-2.4 -Pyarn -Ppyspark -Psparkr -Pr"
127106

128107
# remove non release files and dirs
129-
rm -rf ${WORKING_DIR}/zeppelin
130-
rm -rf ${WORKING_DIR}/zeppelin-${RELEASE_NAME}
108+
rm -rf "${WORKING_DIR}/zeppelin"
109+
rm -rf "${WORKING_DIR}/zeppelin-${RELEASE_VERSION}"
131110
echo "Release files are created under ${WORKING_DIR}"

0 commit comments

Comments
 (0)