2013-12-31 00:40:08 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# Copyright (c) 2013, Facebook, Inc. All rights reserved.
|
|
|
|
# This source code is licensed under the BSD-style license found in the
|
|
|
|
# LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
# of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
|
|
|
|
set -e
|
2014-01-29 18:04:31 +00:00
|
|
|
if [ -z "$GIT" ]
|
|
|
|
then
|
|
|
|
GIT="git"
|
|
|
|
fi
|
|
|
|
|
2013-12-31 00:40:08 +00:00
|
|
|
# Print out the colored progress info so that it can be brainlessly
|
|
|
|
# distinguished by users.
|
|
|
|
function title() {
|
|
|
|
echo -e "\033[1;32m$*\033[0m"
|
|
|
|
}
|
|
|
|
|
2014-01-29 18:19:34 +00:00
|
|
|
usage="Create new RocksDB version and prepare it for the release process\n"
|
2013-12-31 00:40:08 +00:00
|
|
|
usage+="USAGE: ./make_new_version.sh <version>"
|
|
|
|
|
|
|
|
# -- Pre-check
|
|
|
|
if [[ $# < 1 ]]; then
|
|
|
|
echo -e $usage
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
ROCKSDB_VERSION=$1
|
|
|
|
|
|
|
|
GIT_BRANCH=`git rev-parse --abbrev-ref HEAD`
|
2014-04-29 16:17:34 +00:00
|
|
|
echo $GIT_BRANCH
|
|
|
|
|
2013-12-31 00:40:08 +00:00
|
|
|
if [ $GIT_BRANCH != "master" ]; then
|
|
|
|
echo "Error: Current branch is '$GIT_BRANCH', Please switch to master branch."
|
2014-04-29 16:17:34 +00:00
|
|
|
exit 1
|
2013-12-31 00:40:08 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
title "Adding new tag for this release ..."
|
2014-04-29 16:17:34 +00:00
|
|
|
BRANCH="$ROCKSDB_VERSION.fb"
|
|
|
|
$GIT co -b $BRANCH
|
2013-12-31 00:40:08 +00:00
|
|
|
|
|
|
|
# Setting up the proxy for remote repo access
|
2014-04-29 16:17:34 +00:00
|
|
|
title "Pushing new branch to remote repo ..."
|
|
|
|
git push origin --set-upstream $BRANCH
|
2013-12-31 00:40:08 +00:00
|
|
|
|
2014-04-29 16:17:34 +00:00
|
|
|
title "Branch $BRANCH is pushed to github;"
|