From a74c4bbbd3c94797edc09f3e537e2836e376e5c9 Mon Sep 17 00:00:00 2001 From: Janardhan Pulivarthi Date: Sat, 30 Oct 2021 17:28:11 +0530 Subject: [PATCH 1/6] not tested yet. --- dev/release/release-to-svn.sh | 46 +++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 dev/release/release-to-svn.sh diff --git a/dev/release/release-to-svn.sh b/dev/release/release-to-svn.sh new file mode 100644 index 00000000000..5347446b306 --- /dev/null +++ b/dev/release/release-to-svn.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env 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. +# +#------------------------------------------------------------- + +################################################################################ +## File: release-to-svn.sh +## Desc: Promote release candidate from dev/systemds to release/systemds +################################################################################ + +SELF=$(cd $(dirname $0) && pwd) + + +RELEASE_STAGING_LOCATION="https://dist.apache.org/repos/dist/dev/systemds" +RELEASE_LOCATION="https://dist.apache.org/repos/dist/dev/systemds" + +RELEASE_VERSION=2.2.0 +APPROVED_RELEASE_TAG=2.2.0-rc1 + +svn co $RELEASE_STAGING_LOCATION svn-dev-systemds +svn co --depth=empty $RELEASE_LOCATION svn-release-systemds +mkdir -p svn-release-systemds/$RELEASE_VERSION + +cp svn-dev-systemds/${APPROVED_RELEASE_TAG}/systemds-* svn-release-systemds/$RELEASE_VERSION + +svn add svn-release-systemds/$RELEASE_VERSION + +cd svn-release-systemds +svn ci --username "$ASF_USERNAME" --password "$ASF_PASSWORD" -m"Apache SystemDS $RELEASE_VERSION Released" --no-auth-cache From a2052ed81e4ac5703b0babc20f76bdee54c2b8e6 Mon Sep 17 00:00:00 2001 From: Janardhan Pulivarthi Date: Sat, 30 Oct 2021 15:52:51 +0000 Subject: [PATCH 2/6] test each operation and minimize the amount of download --- dev/release/release-to-svn.sh | 51 ++++++++++++++++++++++++++++++----- 1 file changed, 44 insertions(+), 7 deletions(-) mode change 100644 => 100755 dev/release/release-to-svn.sh diff --git a/dev/release/release-to-svn.sh b/dev/release/release-to-svn.sh old mode 100644 new mode 100755 index 5347446b306..3b656ff8c83 --- a/dev/release/release-to-svn.sh +++ b/dev/release/release-to-svn.sh @@ -22,25 +22,62 @@ ################################################################################ ## File: release-to-svn.sh -## Desc: Promote release candidate from dev/systemds to release/systemds +## Desc: Promote release candidate from svn dev/systemds to release/systemds ################################################################################ SELF=$(cd $(dirname $0) && pwd) +dry_run_flag=0 +while getopts ":n" opt; do + case $opt in + n) dry_run_flag=1 ;; + \?) error "Invalid option: $OPTARG" ;; + esac +done + RELEASE_STAGING_LOCATION="https://dist.apache.org/repos/dist/dev/systemds" -RELEASE_LOCATION="https://dist.apache.org/repos/dist/dev/systemds" +RELEASE_LOCATION="https://dist.apache.org/repos/dist/release/systemds" + +RELEASE_VERSION= +APPROVED_RELEASE_TAG= + +read -p "RELEASE_VERSION : " RELEASE_VERSION +read -p "APPROVED_RELEASE_TAG : " APPROVED_RELEASE_TAG + +tmp_repo=$(mktemp -d systemds-repo-tmp-XXXXX) + +pushd "${tmp_repo}" -RELEASE_VERSION=2.2.0 -APPROVED_RELEASE_TAG=2.2.0-rc1 +# 1. Checkout only the directory associated with approved release tag +svn co --depth=empty $RELEASE_STAGING_LOCATION svn-dev-systemds +cd svn-dev-systemds +svn update --set-depth files ${APPROVED_RELEASE_TAG} +cd .. -svn co $RELEASE_STAGING_LOCATION svn-dev-systemds +# 2.1. Checkout the empty repo, and copy the contents from svn dev svn co --depth=empty $RELEASE_LOCATION svn-release-systemds mkdir -p svn-release-systemds/$RELEASE_VERSION cp svn-dev-systemds/${APPROVED_RELEASE_TAG}/systemds-* svn-release-systemds/$RELEASE_VERSION +# 2.2. Add the files to svn svn add svn-release-systemds/$RELEASE_VERSION - cd svn-release-systemds -svn ci --username "$ASF_USERNAME" --password "$ASF_PASSWORD" -m"Apache SystemDS $RELEASE_VERSION Released" --no-auth-cache + +# 2.3. Commit and upload the files to the svn repository + +if [[ $dry_run_flag != 1 ]]; then + # This step prompts for the Apache Credentials + svn info +# svn ci --username "$ASF_USERNAME" --password "$ASF_PASSWORD" -m"Apache SystemDS $RELEASE_VERSION Released" --no-auth-cache + echo $? +else + printf "\n==========\n" + printf "This step would commit to the SVN release repo\n" + printf "At $RELEASE_LOCATION \n" + printf "\n==========\n" +fi + +popd + From cfa1effd02c4bb10db49b5922951a6508f94b191 Mon Sep 17 00:00:00 2001 From: Janardhan Pulivarthi Date: Sat, 30 Oct 2021 15:58:45 +0000 Subject: [PATCH 3/6] add svn ci step --- dev/release/release-to-svn.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dev/release/release-to-svn.sh b/dev/release/release-to-svn.sh index 3b656ff8c83..fdd848c0760 100755 --- a/dev/release/release-to-svn.sh +++ b/dev/release/release-to-svn.sh @@ -69,8 +69,7 @@ cd svn-release-systemds if [[ $dry_run_flag != 1 ]]; then # This step prompts for the Apache Credentials - svn info -# svn ci --username "$ASF_USERNAME" --password "$ASF_PASSWORD" -m"Apache SystemDS $RELEASE_VERSION Released" --no-auth-cache + svn ci --username "$ASF_USERNAME" --password "$ASF_PASSWORD" -m"Apache SystemDS $RELEASE_VERSION Released" --no-auth-cache echo $? else printf "\n==========\n" From 935d4768be33e785e4c99fdcc15d91d51130b495 Mon Sep 17 00:00:00 2001 From: Janardhan Pulivarthi Date: Sat, 30 Oct 2021 16:27:41 +0000 Subject: [PATCH 4/6] add success message after svn ci --- dev/release/release-to-svn.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/release/release-to-svn.sh b/dev/release/release-to-svn.sh index fdd848c0760..28e86fc2c31 100755 --- a/dev/release/release-to-svn.sh +++ b/dev/release/release-to-svn.sh @@ -70,7 +70,7 @@ cd svn-release-systemds if [[ $dry_run_flag != 1 ]]; then # This step prompts for the Apache Credentials svn ci --username "$ASF_USERNAME" --password "$ASF_PASSWORD" -m"Apache SystemDS $RELEASE_VERSION Released" --no-auth-cache - echo $? + [[ $? == 0 ]] && printf "\n Publishing to $RELEASE_LOCATION is complete!\n" else printf "\n==========\n" printf "This step would commit to the SVN release repo\n" From 478ecac5141e9310db1b8e119ff30ad0a532d27c Mon Sep 17 00:00:00 2001 From: Janardhan Pulivarthi Date: Sat, 30 Oct 2021 16:42:33 +0000 Subject: [PATCH 5/6] address review comments --- .../{release-to-svn.sh => svn-staging-to-release.sh} | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) rename dev/release/{release-to-svn.sh => svn-staging-to-release.sh} (86%) diff --git a/dev/release/release-to-svn.sh b/dev/release/svn-staging-to-release.sh similarity index 86% rename from dev/release/release-to-svn.sh rename to dev/release/svn-staging-to-release.sh index 28e86fc2c31..3118a70dcec 100755 --- a/dev/release/release-to-svn.sh +++ b/dev/release/svn-staging-to-release.sh @@ -23,6 +23,7 @@ ################################################################################ ## File: release-to-svn.sh ## Desc: Promote release candidate from svn dev/systemds to release/systemds +## Note: This file to be run only after the succesful voting ################################################################################ SELF=$(cd $(dirname $0) && pwd) @@ -69,8 +70,11 @@ cd svn-release-systemds if [[ $dry_run_flag != 1 ]]; then # This step prompts for the Apache Credentials - svn ci --username "$ASF_USERNAME" --password "$ASF_PASSWORD" -m"Apache SystemDS $RELEASE_VERSION Released" --no-auth-cache - [[ $? == 0 ]] && printf "\n Publishing to $RELEASE_LOCATION is complete!\n" + printf "\n==========\n" + printf "You might want to manually check the files and run the following:\n" + printf "svn ci --username $ASF_USERNAME --password $ASF_PASSWORD -m'Apache SystemDS $RELEASE_VERSION Released' --no-auth-cache" + printf "[[ $? == 0 ]] && printf '\n Publishing to $RELEASE_LOCATION is complete!\n'" + printf "\n==========\n" else printf "\n==========\n" printf "This step would commit to the SVN release repo\n" From 2981f8fcb12f6fc49113d397436cebcb0b505149 Mon Sep 17 00:00:00 2001 From: Janardhan Pulivarthi Date: Sat, 30 Oct 2021 17:04:00 +0000 Subject: [PATCH 6/6] update script --- dev/release/svn-staging-to-release.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/dev/release/svn-staging-to-release.sh b/dev/release/svn-staging-to-release.sh index 3118a70dcec..e4e29ebaec1 100755 --- a/dev/release/svn-staging-to-release.sh +++ b/dev/release/svn-staging-to-release.sh @@ -43,9 +43,13 @@ RELEASE_LOCATION="https://dist.apache.org/repos/dist/release/systemds" RELEASE_VERSION= APPROVED_RELEASE_TAG= +ASF_USERNAME= + read -p "RELEASE_VERSION : " RELEASE_VERSION read -p "APPROVED_RELEASE_TAG : " APPROVED_RELEASE_TAG +read -p "ASF_USERNAME : " ASF_USERNAME + tmp_repo=$(mktemp -d systemds-repo-tmp-XXXXX) pushd "${tmp_repo}" @@ -70,17 +74,16 @@ cd svn-release-systemds if [[ $dry_run_flag != 1 ]]; then # This step prompts for the Apache Credentials - printf "\n==========\n" - printf "You might want to manually check the files and run the following:\n" - printf "svn ci --username $ASF_USERNAME --password $ASF_PASSWORD -m'Apache SystemDS $RELEASE_VERSION Released' --no-auth-cache" - printf "[[ $? == 0 ]] && printf '\n Publishing to $RELEASE_LOCATION is complete!\n'" - printf "\n==========\n" + svn ci --username $ASF_USERNAME -m'Apache SystemDS $RELEASE_VERSION Released' --no-auth-cache \n + [[ $? == 0 ]] && printf '\n Publishing to $RELEASE_LOCATION is complete!\n' else printf "\n==========\n" printf "This step would commit to the SVN release repo\n" printf "At $RELEASE_LOCATION \n" printf "\n==========\n" + printf "You might want to manually check the files and run the following:\n" + printf "svn ci --username $ASF_USERNAME -m'Apache SystemDS $RELEASE_VERSION Released' --no-auth-cache \n" + printf "\n==========\n" fi -popd