Skip to content

Instantly share code, notes, and snippets.

@cramja
Created February 20, 2017 22:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cramja/3f0ace3b60f06dfe82b572f50faa8bf3 to your computer and use it in GitHub Desktop.
Save cramja/3f0ace3b60f06dfe82b572f50faa8bf3 to your computer and use it in GitHub Desktop.
Quickstep release alpha script
# Scripts for Releasing Quickstep
#
# Note: This script is a scratch pad with most of the relevent commands.
# Modify it to see fit. We'll finalize it when we understand the
# process better.
# PREREQS:
# - you must have previously created a gpg key using your apache username
# and uploaded it to a keyserver [http://quickstep.apache.org/release-signing/]
# - make sure someone in the group has validated your key
#
##### SET THESE ENV VARIABLES
export APACHE_USERNAME=spehl
export VERSION=0.1.0
export CANDIDATE=3
export PROJECT_NAME=apache-quickstep-incubating
# folders corresponding to SVN repos where we'll keep our release artifacts
export SVN_DEV=quickstep-svn-dev
export SVN_REL=quickstep-svn-rel
# path to apache repo with quickstep releases
export SVN_DEV_URL=https://dist.apache.org/repos/dist/dev/incubator/quickstep
#### Function Definitions
prep_quickstep() {
# Pulls a fresh copy of quickstep, updates submodules, archives everythin,
# signs it using your key (requires user input), makes checksums.
#
# stop the function if an individual step fails
# set -e
TMP_REL_DIR=qs-rel-tmp
# clone a fresh quickstep. You probably want a specific commit.
git clone https://github.com/apache/incubator-quickstep.git $TMP_REL_DIR
pushd .
cd $TMP_REL_DIR
export ROOT_ARCHIVE_DIR=`pwd`
# need the submodules to be included for the compile to work
git submodule init
git submodule update
# you'll need to push this if you want the tag to be visible to committers
git tag -a rc-$VERSION -m 'release candidate $VERSION'
git archive --format "tar" --prefix=$PROJECT_NAME-$VERSION/ -o $PROJECT_NAME-$VERSION.tar rc-$VERSION
git submodule foreach --recursive 'git archive --verbose --prefix=$PROJECT_NAME-$VERSION/$path/ --format tar master --output $ROOT_ARCHIVE_DIR/submodule-$sha1.tar'
if [[ $(ls submodule-*.tar | wc -l) != 0 ]]; then
# combine all archives into one tar
echo "> combining all tars"
tar --concatenate --file $PROJECT_NAME-$VERSION.tar submodule-*.tar
# remove sub tars
echo "> removing all sub tars"
rm -rf submodule-*.tar
fi
echo "> gzipping final tar"
gzip --force --verbose $PROJECT_NAME-$VERSION.tar
# Make the signature:
gpg -u $APACHE_USERNAME@apache.org --armor --output $PROJECT_NAME-$VERSION.tar.gz.asc --detach-sign $PROJECT_NAME-$VERSION.tar.gz
# Make sure it worked:
gpg --verify $PROJECT_NAME-$VERSION.tar.gz.asc
# Make checksums:
md5sum $PROJECT_NAME-$VERSION.tar.gz > $PROJECT_NAME-$VERSION.tar.gz.md5
sha1sum $PROJECT_NAME-$VERSION.tar.gz > $PROJECT_NAME-$VERSION.tar.gz.sha
# Make sure they worked:
md5sum --check $PROJECT_NAME-$VERSION.tar.gz.md5
sha1sum --check $PROJECT_NAME-$VERSION.tar.gz.sha
mv $PROJECT_NAME-$VERSION.tar.gz* ..
popd
}
publish_rc() {
# push a RC to subversion
#
svn checkout $SVN_DEV_URL $SVN_DEV
BASE_DIR=`pwd`
pushd .
cd $SVN_DEV
# The directory layout is x.y.z/RCw, where w is the release candidate number
# - RC1 is the first candidate, RC2 the second, and so on.
RCFOLDER=$VERSION/RC$CANDIDATE
mkdir -p $RCFOLDER
pushd .
cd $RCFOLDER
cp $BASE_DIR/$PROJECT_NAME-$VERSION.tar.gz* ./
popd
svn add $RCFOLDER
svn commit --username=$APACHE_USERNAME -m "Quickstep-$VERSION RC$CANDIDATE"
popd
}
test_rc() {
# try checking out a release candidate and building
#
svn co $SVN_DEV_URL $SVN_DEV
cd $SVN_DEV/$VERSION/RC$CANDIDATE
tar -xzf $PROJECT_NAME-$VERSION.tar.gz
cd $PROJECT_NAME-$VERSION
# add the KEYS file from quickstep to your gpg key ring
gpg --import KEYS
gpg --verify $PROJECT_NAME-$VERSION.tar.gz.asc
d5sum --check $PROJECT_NAME-$VERSION.tar.gz.md5
sha1sum --check $PROJECT_NAME-$VERSION.tar.gz.sha
# then try building quickstep
# first download third_party, then do your normal build
cd third_party/
./download_and_patch_prerequisites.sh
cd ..
cd build
cmake -DUSE_TCMALLOC=0 ..
make
}
@cramja
Copy link
Author

cramja commented Feb 20, 2017

cd /tmp
mkdir qs
cd qs
curl https://gist.githubusercontent.com/cramja/3f0ace3b60f06dfe82b572f50faa8bf3/raw/c37a1becc56cde20fddf5628ea7680b3e0137a26/make-release.sh > make-release.sh
source make-release.sh
test_rc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment