You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by mi...@apache.org on 2017/03/21 03:04:08 UTC

zeppelin git commit: [ZEPPELIN-2001] Publish Apache Zeppelin artifacts to snapshot repository

Repository: zeppelin
Updated Branches:
  refs/heads/master 641863d56 -> fd7aa10e0


[ZEPPELIN-2001] Publish Apache Zeppelin artifacts to snapshot repository

### What is this PR for?
Simple script that deploy Apache Zeppelin artifact to snapshot repository

### What type of PR is it?
[Improvement ]

### What is the Jira issue?
 * [ZEPPELIN-2001](https://issues.apache.org/jira/browse/ZEPPELIN-2001)

### How should this be tested?
Simply run `./dev/publish_release.sh 0.7.0-SNAPSHOT branch-0.7`

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? YES

Author: Anthony Corbacho <co...@gmail.com>

Closes #1934 from anthonycorbacho/ZEPPELIN-2001 and squashes the following commits:

8ada9817 [Anthony Corbacho] Added beam and maven.repo.local to snapshot
7367653c [Anthony Corbacho] Fix typo
f5fad908 [Anthony Corbacho] Publish SNAPSHOT artifact
1be49dad [Anthony Corbacho] Add flag for snapshot publishing


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/fd7aa10e
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/fd7aa10e
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/fd7aa10e

Branch: refs/heads/master
Commit: fd7aa10e0c37b64dc70ce89b44d154a7463e1d05
Parents: 641863d
Author: Anthony Corbacho <co...@gmail.com>
Authored: Thu Mar 9 15:14:49 2017 +0900
Committer: Mina Lee <mi...@apache.org>
Committed: Tue Mar 21 12:04:05 2017 +0900

----------------------------------------------------------------------
 dev/common_release.sh  |  3 +++
 dev/publish_release.sh | 44 ++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 45 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/fd7aa10e/dev/common_release.sh
----------------------------------------------------------------------
diff --git a/dev/common_release.sh b/dev/common_release.sh
index df9c33d..6b7e901 100644
--- a/dev/common_release.sh
+++ b/dev/common_release.sh
@@ -33,6 +33,9 @@ fi
 
 mkdir "${WORKING_DIR}"
 
+# If set to 'yes', release script will deploy artifacts to SNAPSHOT repository.
+DO_SNAPSHOT='no'
+
 usage() {
   echo "usage) $0 [Release version] [Branch or Tag]"
   echo "   ex. $0 0.6.0 v0.6.0"

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/fd7aa10e/dev/publish_release.sh
----------------------------------------------------------------------
diff --git a/dev/publish_release.sh b/dev/publish_release.sh
index cf3de10..5322f77 100755
--- a/dev/publish_release.sh
+++ b/dev/publish_release.sh
@@ -1,5 +1,4 @@
 #!/bin/bash
-
 #
 # Licensed to the Apache Software Foundation (ASF) under one or more
 # contributor license agreements.  See the NOTICE file distributed with
@@ -43,6 +42,9 @@ NC='\033[0m' # No Color
 
 RELEASE_VERSION="$1"
 GIT_TAG="$2"
+if [[ $RELEASE_VERSION == *"SNAPSHOT"* ]]; then
+  DO_SNAPSHOT="yes"
+fi
 
 PUBLISH_PROFILES="-Ppublish-distr -Pspark-2.1 -Phadoop-2.6 -Pyarn -Ppyspark -Psparkr -Pr"
 PROJECT_OPTIONS="-pl !zeppelin-distribution"
@@ -67,6 +69,40 @@ function curl_error() {
   fi
 }
 
+
+#
+# Publishing Apache Zeppelin artifact to Apache snapshot repository.
+#
+function publish_snapshot_to_maven() {
+  cd "${WORKING_DIR}/zeppelin"
+  echo "Deploying Apache Zeppelin $RELEASE_VERSION version to snapshot repository."
+
+  if [[ ! $RELEASE_VERSION == *"SNAPSHOT"* ]]; then
+    echo "ERROR: Snapshots must have a version containing 'SNAPSHOT'"
+    echo "ERROR: You gave version '$RELEASE_VERSION'"
+    exit 1
+  fi
+
+  tmp_repo="$(mktemp -d /tmp/zeppelin-repo-XXXXX)"
+
+  mvn versions:set -DnewVersion=$RELEASE_VERSION
+  tmp_settings="tmp-settings.xml"
+  echo "<settings><servers><server>" > $tmp_settings
+  echo "<id>apache.snapshots.https</id><username>$ASF_USERID</username>" >> $tmp_settings
+  echo "<password>$ASF_PASSWORD</password>" >> $tmp_settings
+  echo "</server></servers></settings>" >> $tmp_settings
+
+  mvn --settings $tmp_settings -Dmaven.repo.local="${tmp_repo}" -Pbeam -DskipTests \
+    $PUBLISH_PROFILES -Drat.skip=true deploy
+
+  "${BASEDIR}/change_scala_version.sh" 2.11
+  mvn -Pscala-2.11 --settings $tmp_settings -Dmaven.repo.local="${tmp_repo}" -Pbeam -DskipTests \
+    $PUBLISH_PROFILES -Drat.skip=true clean deploy
+
+  rm $tmp_settings
+  rm -rf $tmp_repo
+}
+
 function publish_to_maven() {
   cd "${WORKING_DIR}/zeppelin"
 
@@ -153,5 +189,9 @@ function publish_to_maven() {
 }
 
 git_clone
-publish_to_maven
+if [[ "${DO_SNAPSHOT}" == 'yes' ]]; then
+  publish_snapshot_to_maven
+else
+  publish_to_maven
+fi
 cleanup