set -x
+ BRANCH=$(git branch --show-current)
+
git add -A
- if ! git diff --exit-code ; then
+ if ! git diff --cached --exit-code ; then
git commit -m"prepare for deploy"
fi
for NODE in "${!NODES[@]}"
if test $NODE = localhost ; then
sudo ./provision.sh --config local.params --roles ${NODES[$NODE]}
else
- if ! ssh $NODE test -d arvados-setup.git ; then
+ 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]}"