aboutsummaryrefslogtreecommitdiff
path: root/deploy.sh
diff options
context:
space:
mode:
authorMaZderMind2016-12-20 22:38:02 +0100
committerMaZderMind2016-12-20 22:38:02 +0100
commit5ec71310d5ed6e1c4879506de7cae65ef1aab922 (patch)
tree7a5064564a9ac3ddd8f058ddf52230bb2f3b4fe1 /deploy.sh
parent86331ff4c0fbac69c9a8df32838c282a0ed2ce12 (diff)
support depoloying a different branch
fixes #28 kinda
Diffstat (limited to 'deploy.sh')
-rwxr-xr-xdeploy.sh15
1 files changed, 14 insertions, 1 deletions
diff --git a/deploy.sh b/deploy.sh
index 2d32a31..eec51c5 100755
--- a/deploy.sh
+++ b/deploy.sh
@@ -11,6 +11,17 @@ if [ $? -ne 0 ]; then
exit 1
fi
+echo ""
+DEPLOY_BRANCH=`git rev-parse --abbrev-ref HEAD`
+if [ "x$DEPLOY_BRANCH" != "xmaster" ]; then
+ echo "You're currently on branch $DEPLOY_BRANCH."
+ echo "Are you sure you want to deoloy that branch (and not master)? then type yes"
+ read -p "" input
+ if [ "x$input" != "xyes" ]; then
+ exit 2
+ fi
+fi
+
if [ `git rev-parse --verify origin/$DEPLOY_BRANCH` != `git rev-parse --verify $DEPLOY_BRANCH` ]; then
echo "You have commits on the master branch not pushed to origin yet. They would not be deployed."
echo "do you still which to deploy what's already in the repo? then type yes"
@@ -32,7 +43,9 @@ fi
ssh -A voc@lb.dus.c3voc.de 'sudo sh' << EOT
cd /srv/nginx/streaming-website
git fetch origin
-git reset --hard origin/master
+git reset --hard HEAD
+git checkout $DEPLOY_BRANCH
+git reset --hard origin/$DEPLOY_BRANCH
chown -R voc:staff .
chown -R downloader configs
./clear_cache