You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@submarine.apache.org by GitBox <gi...@apache.org> on 2020/02/06 11:32:46 UTC

[GitHub] [submarine] tangzhankun opened a new pull request #175: SUBMRINE-323. Add how to release guide and scripts.

tangzhankun opened a new pull request #175: SUBMRINE-323. Add how to release guide and scripts.
URL: https://github.com/apache/submarine/pull/175
 
 
   ### What is this PR for?
   Submarine release scripts and guide
   
   ### What type of PR is it?
   Feature
   
   ### Todos
   * [1] - Automate steps in cicd images
   
   ### What is the Jira issue?
   https://issues.apache.org/jira/browse/SUBMARINE-323
   
   ### How should this be tested?
   When a committer is preparing a new release, this can be verified.
   Zhankun has gone through the guide with the scripts. No big issue found yet.
   
   ### Questions:
   * Does the licenses files need update? No
   * Is there breaking changes for older versions? No
   * Does this needs documentation? Yes

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@submarine.apache.org
For additional commands, e-mail: dev-help@submarine.apache.org


[GitHub] [submarine] liuxunorg commented on a change in pull request #175: SUBMRINE-323. Add how to release guide and scripts.

Posted by GitBox <gi...@apache.org>.
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_r375798881
 
 

 ##########
 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
 
 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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@submarine.apache.org
For additional commands, e-mail: dev-help@submarine.apache.org


[GitHub] [submarine] tangzhankun commented on a change in pull request #175: SUBMRINE-323. Add how to release guide and scripts.

Posted by GitBox <gi...@apache.org>.
tangzhankun 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_r376195917
 
 

 ##########
 File path: dev-support/cicd/create_release.sh
 ##########
 @@ -0,0 +1,110 @@
+#!/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 making a release.
+# You need to specify release version and branch|tag name.
+#
+# Here are some helpful documents for the release.
+# http://www.apache.org/dev/release.html
+# http://www.apache.org/dev/release-publishing
+# http://www.apache.org/dev/release-signing.html
+
+set -e
+
+BASEDIR="$(dirname "$0")"
+. "${BASEDIR}/common_release.sh"
+echo "${BASEDIR}/common_release.sh"
+
+if [[ $# -ne 2 ]]; then
+  usage
+fi
+
+for var in GPG_PASSPHRASE; do
+  if [[ -z "${!var}" ]]; then
+    echo "You need ${var} variable set"
+    exit 1
+  fi
+done
+
+RELEASE_VERSION="$1"
+GIT_TAG="$2"
+
+function compile_src_and_bin() {
+  cd ${WORKING_DIR}/submarine
+  echo "git submodule update --init --recursive"
+  git submodule update --init --recursive
+  echo "git submodule update --recursive"
+  git submodule update --recursive
 
 Review comment:
   Thanks for reminding this. Fixed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@submarine.apache.org
For additional commands, e-mail: dev-help@submarine.apache.org


[GitHub] [submarine] liuxunorg commented on a change in pull request #175: SUBMRINE-323. Add how to release guide and scripts.

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@submarine.apache.org
For additional commands, e-mail: dev-help@submarine.apache.org


[GitHub] [submarine] asfgit closed pull request #175: SUBMARINE-323. Add how to release guide and scripts.

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #175: SUBMARINE-323. Add how to release guide and scripts.
URL: https://github.com/apache/submarine/pull/175
 
 
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@submarine.apache.org
For additional commands, e-mail: dev-help@submarine.apache.org


[GitHub] [submarine] tangzhankun commented on issue #175: SUBMRINE-323. Add how to release guide and scripts.

Posted by GitBox <gi...@apache.org>.
tangzhankun commented on issue #175: SUBMRINE-323. Add how to release guide and scripts.
URL: https://github.com/apache/submarine/pull/175#issuecomment-583305785
 
 
   @liuxunorg, @yuanzac , @jiwq the Travis error seems unrelated. Could you please help to review it?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@submarine.apache.org
For additional commands, e-mail: dev-help@submarine.apache.org


[GitHub] [submarine] liuxunorg commented on issue #175: SUBMRINE-323. Add how to release guide and scripts.

Posted by GitBox <gi...@apache.org>.
liuxunorg commented on issue #175: SUBMRINE-323. Add how to release guide and scripts.
URL: https://github.com/apache/submarine/pull/175#issuecomment-584750526
 
 
   Will merge if no more comments.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@submarine.apache.org
For additional commands, e-mail: dev-help@submarine.apache.org


[GitHub] [submarine] liuxunorg commented on a change in pull request #175: SUBMRINE-323. Add how to release guide and scripts.

Posted by GitBox <gi...@apache.org>.
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_r375798199
 
 

 ##########
 File path: dev-support/cicd/create_release.sh
 ##########
 @@ -0,0 +1,110 @@
+#!/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 making a release.
+# You need to specify release version and branch|tag name.
+#
+# Here are some helpful documents for the release.
+# http://www.apache.org/dev/release.html
+# http://www.apache.org/dev/release-publishing
+# http://www.apache.org/dev/release-signing.html
+
+set -e
+
+BASEDIR="$(dirname "$0")"
+. "${BASEDIR}/common_release.sh"
+echo "${BASEDIR}/common_release.sh"
+
+if [[ $# -ne 2 ]]; then
+  usage
+fi
+
+for var in GPG_PASSPHRASE; do
+  if [[ -z "${!var}" ]]; then
+    echo "You need ${var} variable set"
+    exit 1
+  fi
+done
+
+RELEASE_VERSION="$1"
+GIT_TAG="$2"
+
+function compile_src_and_bin() {
+  cd ${WORKING_DIR}/submarine
+  echo "git submodule update --init --recursive"
+  git submodule update --init --recursive
+  echo "git submodule update --recursive"
+  git submodule update --recursive
 
 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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@submarine.apache.org
For additional commands, e-mail: dev-help@submarine.apache.org