18870: Flexible branch naming
[arvados.git] / tools / salt-install / installer.sh
index 604bd7e325a528bdfb6dab49ca69083411f60644..b901651e7c7272633d4a50bf22b056aa8b815058 100755 (executable)
@@ -66,6 +66,8 @@ case "$subcmd" in
 
        set -x
 
+       BRANCH=$(git branch --show-current)
+
        git add -A
        if ! git diff --cached --exit-code ; then
            git commit -m"prepare for deploy"
@@ -77,12 +79,15 @@ case "$subcmd" in
            else
                if ! ssh $NODE test -d arvados-setup ; then
                    ssh $NODE git init --bare arvados-setup.git
-                   git remote add $NODE $DEPLOY_USER@$NODE:arvados-setup.git
-                   git push $NODE
+                   if ! git remote add $NODE $DEPLOY_USER@$NODE:arvados-setup.git ; then
+                       git remote set-url $NODE $DEPLOY_USER@$NODE:arvados-setup.git
+                   fi
+                   git push $NODE $BRANCH
                    ssh $NODE git clone arvados-setup.git arvados-setup
                fi
 
-               git push $NODE master
+               git push $NODE $BRANCH
+               ssh $NODE git -C arvados-setup checkout $BRANCH
                ssh $NODE git -C arvados-setup pull
 
                ssh $DEPLOY_USER@$NODE "cd arvados-setup && sudo ./provision.sh --config local.params --roles ${NODES[$NODE]}"