vinishjail97 commented on code in PR #434: URL: https://github.com/apache/incubator-xtable/pull/434#discussion_r1673643966
########## release/scripts/cut_release_branch.sh: ########## @@ -0,0 +1,145 @@ +#!/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. +# + +# This script will update apache incubator-xtable master branch with next release version +# and cut release branch for current development version. + +# Parse parameters passing into the script + +set -e + +function clean_up(){ + echo "Do you want to clean local clone repo? [y|N]" + read confirmation + if [[ $confirmation = "y" ]]; then + cd ~ + rm -rf ${LOCAL_CLONE_DIR} + echo "Clean up local repo." + fi +} + +if [[ $# -eq 1 && $1 = "-h" ]]; then + echo "This script will update apache incubator-xtable master branch with next release version and cut release branch for current development version." + echo "There are 3 params required:" + echo "--release=\${CURRENT_RELEASE_VERSION}" + echo "--next_release=\${NEXT_RELEASE_VERSION}" + echo "--rc_num=\${RC_NUM}" + exit +else + for param in "$@" + do + if [[ $param =~ --release\=([0-9]\.[0-9]*\.[0-9]) ]]; then + RELEASE=${BASH_REMATCH[1]} + fi + if [[ $param =~ --next_release\=([0-9]\.[0-9]*\.[0-9]) ]]; then + NEXT_VERSION_IN_BASE_BRANCH=${BASH_REMATCH[1]} + fi + if [[ $param =~ --rc_num\=([0-9]*) ]]; then + RC_NUM=${BASH_REMATCH[1]} + fi + done +fi + +if [[ -z "$RELEASE" || -z "$NEXT_VERSION_IN_BASE_BRANCH" || -z "$RC_NUM" ]]; then + echo "This script needs to be ran with params, please run with -h to get more instructions." + exit +fi + + +MASTER_BRANCH=master +NEXT_VERSION_BRANCH=MINOR-move-to-${NEXT_VERSION_IN_BASE_BRANCH} +RELEASE_BRANCH=release-${RELEASE} +GITHUB_REPO_URL=g...@github.com:apache/incubator-xtable.git +XTABLE_REPO_DIR=incubator-xtable +LOCAL_CLONE_DIR=incubator-xtable_release_${RELEASE} + +echo "=====================Environment Variables=====================" +echo "version: ${RELEASE}" +echo "next_release: ${NEXT_VERSION_IN_BASE_BRANCH}" +echo "working master branch: ${MASTER_BRANCH}" +echo "working next-version branch: ${NEXT_VERSION_BRANCH}" +echo "working release branch: ${RELEASE_BRANCH}" +echo "local repo dir: ~/${LOCAL_CLONE_DIR}/${XTABLE_REPO_DIR}" +echo "RC_NUM: $RC_NUM" +echo "===============================================================" + +cd ~ Review Comment: This is not required IMO. ########## release/scripts/cut_release_branch.sh: ########## @@ -0,0 +1,145 @@ +#!/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. +# + +# This script will update apache incubator-xtable master branch with next release version +# and cut release branch for current development version. + +# Parse parameters passing into the script + +set -e + +function clean_up(){ + echo "Do you want to clean local clone repo? [y|N]" + read confirmation + if [[ $confirmation = "y" ]]; then + cd ~ + rm -rf ${LOCAL_CLONE_DIR} + echo "Clean up local repo." + fi +} + +if [[ $# -eq 1 && $1 = "-h" ]]; then + echo "This script will update apache incubator-xtable master branch with next release version and cut release branch for current development version." + echo "There are 3 params required:" + echo "--release=\${CURRENT_RELEASE_VERSION}" + echo "--next_release=\${NEXT_RELEASE_VERSION}" + echo "--rc_num=\${RC_NUM}" + exit +else + for param in "$@" + do + if [[ $param =~ --release\=([0-9]\.[0-9]*\.[0-9]) ]]; then + RELEASE=${BASH_REMATCH[1]} + fi + if [[ $param =~ --next_release\=([0-9]\.[0-9]*\.[0-9]) ]]; then + NEXT_VERSION_IN_BASE_BRANCH=${BASH_REMATCH[1]} + fi + if [[ $param =~ --rc_num\=([0-9]*) ]]; then + RC_NUM=${BASH_REMATCH[1]} + fi + done +fi + +if [[ -z "$RELEASE" || -z "$NEXT_VERSION_IN_BASE_BRANCH" || -z "$RC_NUM" ]]; then + echo "This script needs to be ran with params, please run with -h to get more instructions." + exit +fi + + +MASTER_BRANCH=master +NEXT_VERSION_BRANCH=MINOR-move-to-${NEXT_VERSION_IN_BASE_BRANCH} +RELEASE_BRANCH=release-${RELEASE} +GITHUB_REPO_URL=g...@github.com:apache/incubator-xtable.git +XTABLE_REPO_DIR=incubator-xtable +LOCAL_CLONE_DIR=incubator-xtable_release_${RELEASE} + +echo "=====================Environment Variables=====================" +echo "version: ${RELEASE}" +echo "next_release: ${NEXT_VERSION_IN_BASE_BRANCH}" +echo "working master branch: ${MASTER_BRANCH}" +echo "working next-version branch: ${NEXT_VERSION_BRANCH}" +echo "working release branch: ${RELEASE_BRANCH}" +echo "local repo dir: ~/${LOCAL_CLONE_DIR}/${XTABLE_REPO_DIR}" +echo "RC_NUM: $RC_NUM" +echo "===============================================================" + +cd ~ Review Comment: This is not required IMO -> `cd ~` -- 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. To unsubscribe, e-mail: commits-unsubscr...@xtable.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org