2012-11-07 20:41:26 +00:00
|
|
|
#!/usr/bin/env bash
|
2013-01-23 17:05:49 +00:00
|
|
|
: ${RT_DEST_DIR:="$HOME/rt/riak"}
|
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: "
|
|
|
|
if [ -f $cwd/dependency_manifest.git ]; then
|
|
|
|
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"
|
2012-09-17 21:14:55 +00:00
|
|
|
git reset HEAD --hard > /dev/null 2>&1
|
|
|
|
git clean -fd > /dev/null 2>&1
|
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 .
|
2012-09-17 21:14:55 +00:00
|
|
|
git commit -a -m "riak_test init" --amend > /dev/null 2>&1
|