-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ef71e54
commit d0a5347
Showing
8 changed files
with
946 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Apache XTable is an effort undergoing incubation at The Apache Software Foundation (ASF). | ||
Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. | ||
While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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} | ||
[email protected]: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 ~ | ||
if [[ -d ${LOCAL_CLONE_DIR} ]]; then | ||
rm -rf ${LOCAL_CLONE_DIR} | ||
fi | ||
|
||
mkdir ${LOCAL_CLONE_DIR} | ||
cd ${LOCAL_CLONE_DIR} | ||
git clone ${GITHUB_REPO_URL} | ||
cd ${XTABLE_REPO_DIR} | ||
|
||
# Now, create local release branch | ||
git branch ${RELEASE_BRANCH} | ||
|
||
git checkout ${MASTER_BRANCH} | ||
git checkout -b ${NEXT_VERSION_BRANCH} | ||
|
||
echo "====================Current working branch=====================" | ||
echo ${NEXT_VERSION_BRANCH} | ||
echo "===============================================================" | ||
|
||
# Update master branch | ||
mvn versions:set -DnewVersion=${NEXT_VERSION_IN_BASE_BRANCH}-SNAPSHOT | ||
|
||
echo "===========Update next-version branch as following=============" | ||
git diff | ||
echo "===============================================================" | ||
|
||
echo "Please make sure all changes above are expected. Do you confirm to commit?: [y|N]" | ||
read confirmation | ||
if [[ $confirmation != "y" ]]; then | ||
echo "Exit without committing any changes on master branch." | ||
clean_up | ||
exit | ||
fi | ||
|
||
git commit -am "[MINOR] Moving to ${NEXT_VERSION_IN_BASE_BRANCH}-SNAPSHOT on master branch." | ||
|
||
echo "===============================================================" | ||
echo "!!Please open a PR based on ${NEXT_VERSION_BRANCH} branch for approval!! [Press ENTER to continue]" | ||
read confirmation | ||
|
||
# Checkout and update release branch | ||
git checkout ${RELEASE_BRANCH} | ||
mvn versions:set -DnewVersion=${RELEASE}-rc${RC_NUM} | ||
|
||
echo "==================Current working branch=======================" | ||
echo ${RELEASE_BRANCH} | ||
echo "===============================================================" | ||
|
||
echo "===============Update release branch as following==============" | ||
git diff | ||
echo "===============================================================" | ||
|
||
echo "Please make sure all changes above are expected. Do you confirm to commit?: [y|N]" | ||
read confirmation | ||
if [[ $confirmation != "y" ]]; then | ||
echo "Exit without committing any changes on release branch." | ||
clean_up | ||
exit | ||
fi | ||
|
||
git commit -am "Create release branch for version ${RELEASE}." | ||
git push --set-upstream origin ${RELEASE_BRANCH} | ||
|
||
clean_up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/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. | ||
# | ||
|
||
## | ||
## Variables with defaults (if not overwritten by environment) | ||
## | ||
MVN=${MVN:-mvn} | ||
# fail immediately | ||
set -o errexit | ||
set -o nounset | ||
|
||
CURR_DIR=$(pwd) | ||
if [ ! -d "$CURR_DIR/packaging" ] ; then | ||
echo "You have to call the script from the repository root dir that contains 'packaging/'" | ||
exit 1 | ||
fi | ||
|
||
if [ "$#" -gt "1" ]; then | ||
echo "Only accept 0 or 1 argument. Use -h to see examples." | ||
exit 1 | ||
fi | ||
|
||
|
||
if [ "${1:-}" == "-h" ]; then | ||
echo " | ||
Usage: $(basename "$0") [OPTIONS] | ||
Options: | ||
<version option> One of the version options below | ||
${joined} | ||
-h, --help | ||
" | ||
exit 0 | ||
fi | ||
|
||
|
||
COMMON_OPTIONS="-DdeployArtifacts=true -DskipTests -DretryFailedDeploymentCount=10" | ||
echo "Cleaning everything before any deployment" | ||
$MVN clean $COMMON_OPTIONS | ||
echo "Building with options | ||
$MVN install $COMMON_OPTIONS | ||
echo "Deploying to repository.apache.org with version options" | ||
$MVN deploy $COMMON_OPTIONS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
#!/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 install and configure GPG key. | ||
|
||
set -e | ||
|
||
LOCAL_SVN_DIR=local_svn_dir | ||
ROOT_SVN_URL=https://dist.apache.org/repos/dist/ | ||
DEV_REPO=dev/incubator | ||
RELEASE_REPO=release/incubator | ||
XTABLE_REPO=xtable | ||
|
||
cd ~ | ||
|
||
echo "=================Checking GPG Key====================" | ||
echo "You need a GPG key which reflects your Apache account." | ||
echo "Do you want to generate a new GPG key associated with your Apache account? [y|N]" | ||
read confirmation | ||
if [[ $confirmation = "y" ]]; then | ||
echo "===============Generating new GPG key================" | ||
sudo apt-get install rng-tools | ||
sudo rngd -r /dev/urandom | ||
gpg --full-generate-key | ||
fi | ||
|
||
echo "================Listing all GPG keys=================" | ||
gpg --list-keys | ||
echo "Please copy the public key which is associated with your Apache account:" | ||
read pub_key | ||
|
||
echo "===========Configuring git signing key===============" | ||
git config --global user.signingkey $pub_key | ||
git config --list | ||
|
||
echo "===========Adding your key into KEYS file============" | ||
echo "It's required to append your key into KEYS file in dist.apache.org" | ||
echo "Have you put your key in KEYS? [y|N]" | ||
read confirmation | ||
if [[ $confirmation != "y" ]]; then | ||
echo "Only PMC member can write into dist.apache.org. Are you a PMC member? [y|N]" | ||
read pmc_permission | ||
if [[ $pmc_permission != "y" ]]; then | ||
echo "Please ask a PMC member to help you add your key in dev@ list." | ||
echo "Skip adding key into dist.apache.org/KEYS file." | ||
else | ||
echo "Please input your name: " | ||
read name | ||
echo "Please input you Apache account creds for checking out ${ROOT_SVN_URL} and adding your key to KEYS file" | ||
echo "username: " | ||
read apache_username | ||
echo "password: " | ||
read passowrd | ||
echo "======Starting updating KEYS file in dev repo====" | ||
if [[ -d ${LOCAL_SVN_DIR} ]]; then | ||
rm -rf ${LOCAL_SVN_DIR} | ||
fi | ||
mkdir ${LOCAL_SVN_DIR} | ||
cd ${LOCAL_SVN_DIR} | ||
svn --username=${apache_username} --password=${passowrd} co ${ROOT_SVN_URL}/${DEV_REPO}/${XTABLE_REPO} | ||
cd ${XTABLE_REPO} | ||
(gpg --list-sigs ${name} && gpg --armor --export ${name}) >> KEYS | ||
svn status | ||
echo "Please review all changes. Do you confirm to commit? [y|N]" | ||
read commit_confirmation | ||
if [[ $commit_confirmation = "y" ]]; then | ||
svn --username=${apache_username} --password=${passowrd} commit --no-auth-cache KEYS | ||
else | ||
echo "Not commit new changes into ${ROOT_SVN_URL}/${DEV_REPO}/${XTABLE_REPO}${DEV_REPO}/KEYS" | ||
fi | ||
cd ~ | ||
if [[ -d ${LOCAL_SVN_DIR} ]]; then | ||
rm -rf ${LOCAL_SVN_DIR} | ||
fi | ||
mkdir ${LOCAL_SVN_DIR} | ||
cd ${LOCAL_SVN_DIR} | ||
echo "===Starting updating KEYS file in release repo===" | ||
svn --username=${apache_username} --password=${passowrd} co ${ROOT_SVN_URL}/${RELEASE_REPO}/${XTABLE_REPO} | ||
cd ${XTABLE_REPO} | ||
(gpg --list-sigs ${name} && gpg --armor --export ${name}) >> KEYS | ||
svn status | ||
echo "Please review all changes. Do you confirm to commit? [y|N]" | ||
read commit_confirmation | ||
if [[ $commit_confirmation = "y" ]]; then | ||
svn --username=${apache_username} --password=${passowrd} commit --no-auth-cache KEYS | ||
else | ||
echo "Not commit new changes into ${ROOT_SVN_URL}/${DEV_REPO}/${XTABLE_REPO}${RELEASE_REPO}/KEYS" | ||
fi | ||
|
||
cd ~ | ||
rm -rf ${LOCAL_SVN_DIR} | ||
fi | ||
fi | ||
|
||
echo "================Setting up gpg agent=================" | ||
eval $(gpg-agent --daemon --no-grab --write-env-file $HOME/.gpg-agent-info) | ||
export GPG_TTY=$(tty) | ||
export GPG_AGENT_INFO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# | ||
# 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. | ||
# | ||
|
||
# fail immediately | ||
set -o errexit | ||
set -o nounset | ||
|
||
REPO=$1 | ||
VERSION=$2 | ||
|
||
STAGING_REPO="https://repository.apache.org/content/repositories/${REPO}/org/apache/incubator-xtable" | ||
|
||
declare -a extensions=("-javadoc.jar" "-javadoc.jar.asc" "-javadoc.jar.md5" "-javadoc.jar.sha1" "-sources.jar" | ||
"-sources.jar.asc" "-sources.jar.md5" "-sources.jar.sha1" ".jar" ".jar.asc" ".jar.md5" ".jar.sha1" ".pom" ".pom.asc" | ||
".pom.md5" ".pom.sha1") | ||
|
||
declare -a bundles=("incubator-xtable") | ||
|
||
NOW=$(date +%s) | ||
TMP_DIR_FOR_BUNDLES=/tmp/${NOW} | ||
mkdir "$TMP_DIR_FOR_BUNDLES" | ||
|
||
for bundle in "${bundles[@]}" | ||
do | ||
for extension in "${extensions[@]}" | ||
do | ||
url=${STAGING_REPO}/$bundle/${VERSION}/$bundle-${VERSION}$extension | ||
if curl --output "$TMP_DIR_FOR_BUNDLES/$bundle-${VERSION}$extension" --head --fail "$url"; then | ||
echo "Artifact exists: $url" | ||
else | ||
echo "Artifact missing: $url" | ||
exit 1 | ||
fi | ||
done | ||
done | ||
|
||
echo "All artifacts exist. Validation succeeds." |