liuxunorg commented on a change in pull request #175: SUBMRINE-323. Add how to 
release guide and scripts.
URL: https://github.com/apache/submarine/pull/175#discussion_r375799064
 
 

 ##########
 File path: dev-support/cicd/publish_release.sh
 ##########
 @@ -0,0 +1,182 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# The script helps publishing release to maven.
+# You need to specify release version and branch|tag name.
+#
+# Here's some helpful documents for the release.
+# http://www.apache.org/dev/publishing-maven-artifacts.html
+set -e
+BASEDIR="$(dirname "$0")"
+. "${BASEDIR}/common_release.sh"
+
+if [[ $# -ne 2 ]]; then
+  usage
+fi
+
+for var in GPG_PASSPHRASE ASF_USERID ASF_PASSWORD; do
+  if [[ -z "${!var}" ]]; then
+    echo "You need ${var} variable set"
+    exit 1
+  fi
+done
+
+export MAVEN_OPTS="-Xmx2g -XX:MaxPermSize=512m"
+RED='\033[0;31m'
+NC='\033[0m' # No Color
+
+RELEASE_VERSION="$1"
+GIT_TAG="$2"
+if [[ $RELEASE_VERSION == *"SNAPSHOT"* ]]; then
+  DO_SNAPSHOT="yes"
+fi
+
+NEXUS_STAGING="https://repository.apache.org/service/local/staging";
+# Get this from apache infra admin
+NEXUS_PROFILE="2525cde13fad2a"
+
+function cleanup() {
+  echo "Remove working directory and maven local repository"
+  rm -rf ${WORKING_DIR}
+}
+
+function curl_error() {
+  ret=${1}
+  if [[ $ret -ne 0 ]]; then
+    echo "curl response code is: ($ret)"
+    echo "See https://curl.haxx.se/libcurl/c/libcurl-errors.html to know the 
detailed cause of error."
+    echo -e "${RED}Failed to publish maven artifact to staging repository."
+    echo -e "IMPORTANT: You will have to re-run publish_release.sh to complete 
maven artifact publish.${NC}"
+    cleanup
+    exit 1
+  fi
+}
+
+
+#
+# Publishing Apache Submarine artifact to Apache snapshot repository.
+#
+function publish_snapshot_to_maven() {
+  cd "${WORKING_DIR}/submarine"
+  echo "Deploying Apache Submarine $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/submarine-repo-XXXXX)"
+  echo "git submodule update --init --recursive"
+  git submodule update --init --recursive
+  echo "git submodule update --recursive"
+  git submodule update --recursive
+  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
+
+  #Disable TonY mvn deploy
+  #tony_pom="./submodules/tony/pom.xml"
+  mvn --settings $tmp_settings -Dmaven.repo.local="${tmp_repo}" -DskipTests 
deploy
 
 Review comment:
   submodule tony will be delete. https://github.com/apache/submarine/pull/173

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to