2012-11-07 20:41:26 +00:00
|
|
|
#!/usr/bin/env bash
|
2013-04-02 21:55:15 +00:00
|
|
|
|
|
|
|
# bail out if things go south
|
|
|
|
set -e
|
|
|
|
|
2013-01-23 17:05:49 +00:00
|
|
|
: ${RT_DEST_DIR:="$HOME/rt/riak"}
|
2014-09-16 20:12:55 +00:00
|
|
|
# If RT_CURRENT_TAG is specified, it will use that version number
|
|
|
|
# otherwise the last annotated tag will be used
|
|
|
|
: ${RT_CURRENT_TAG:=""}
|
2012-09-18 18:34:31 +00:00
|
|
|
|
2012-09-17 21:14:55 +00:00
|
|
|
echo "Making $(pwd) the current release:"
|
2012-04-28 00:11:39 +00:00
|
|
|
cwd=$(pwd)
|
2012-09-18 18:34:31 +00:00
|
|
|
echo -n " - Determining version: "
|
2014-09-16 20:12:55 +00:00
|
|
|
if [ -n "$RT_CURRENT_TAG" ]; then
|
|
|
|
VERSION=$RT_CURRENT_TAG
|
|
|
|
elif [ -f $cwd/dependency_manifest.git ]; then
|
2012-09-18 18:34:31 +00:00
|
|
|
VERSION=`cat $cwd/dependency_manifest.git | awk '/^-/ { print $NF }'`
|
|
|
|
else
|
2012-09-18 20:13:12 +00:00
|
|
|
VERSION="$(git describe --tags)-$(git branch | awk '/\*/ {print $2}')"
|
2012-09-18 18:34:31 +00:00
|
|
|
fi
|
|
|
|
echo $VERSION
|
2012-11-03 16:32:10 +00:00
|
|
|
cd $RT_DEST_DIR
|
|
|
|
echo " - Resetting existing $RT_DEST_DIR"
|
2015-04-01 14:34:13 +00:00
|
|
|
export GIT_WORK_TREE="$RT_DEST_DIR"
|
2014-10-10 19:15:53 +00:00
|
|
|
git reset HEAD --hard > /dev/null
|
|
|
|
git clean -fd > /dev/null
|
2012-11-03 16:32:10 +00:00
|
|
|
echo " - Removing and recreating $RT_DEST_DIR/current"
|
|
|
|
rm -rf $RT_DEST_DIR/current
|
|
|
|
mkdir $RT_DEST_DIR/current
|
2012-04-28 00:11:39 +00:00
|
|
|
cd $cwd
|
2012-11-03 16:32:10 +00:00
|
|
|
echo " - Copying devrel to $RT_DEST_DIR/current"
|
2012-11-16 17:42:41 +00:00
|
|
|
cp -p -P -R dev $RT_DEST_DIR/current
|
2012-11-03 16:32:10 +00:00
|
|
|
echo " - Writing $RT_DEST_DIR/current/VERSION"
|
|
|
|
echo -n $VERSION > $RT_DEST_DIR/current/VERSION
|
|
|
|
cd $RT_DEST_DIR
|
2012-09-17 21:14:55 +00:00
|
|
|
echo " - Reinitializing git state"
|
2012-04-28 00:11:39 +00:00
|
|
|
git add .
|
2014-10-10 19:15:53 +00:00
|
|
|
git commit -a -m "riak_test init" --amend > /dev/null
|