summaryrefslogtreecommitdiff
path: root/buildbot/switch.sh
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2019-04-16 22:14:29 +0200
committerMarcello Stanisci <stanisci.m@gmail.com>2019-04-16 22:14:29 +0200
commit60b0f6bb93ee4ab9e88453b7b847bec988283caf (patch)
tree4c36ef2ff0a8a6033bb725ee4dc3a9f3767d4ab3 /buildbot/switch.sh
parent8e715805f5a24e1f08343d0a9aa29b6de941e9cb (diff)
downloaddeployment-60b0f6bb93ee4ab9e88453b7b847bec988283caf.tar.gz
deployment-60b0f6bb93ee4ab9e88453b7b847bec988283caf.tar.bz2
deployment-60b0f6bb93ee4ab9e88453b7b847bec988283caf.zip
fix paths
Diffstat (limited to 'buildbot/switch.sh')
-rwxr-xr-xbuildbot/switch.sh25
1 files changed, 8 insertions, 17 deletions
diff --git a/buildbot/switch.sh b/buildbot/switch.sh
index 5b464ca..ae17325 100755
--- a/buildbot/switch.sh
+++ b/buildbot/switch.sh
@@ -1,22 +1,13 @@
#!/bin/bash
-DEPLOYMENT="test"
+set -e
-if test "stable" = ${BRANCH}; then
- DEPLOYMENT="demo"
-fi
+NONACTIVE_COLOR="$(cat /home/test/nonactive)"
-active=$(cat /home/${DEPLOYMENT}/active)
-nonactive="${DEPLOYMENT}-blue"
-echo "Active party: ${active}"
+##
+# PWD is the weak part here, as it makes this script
+# only useful if run under Buildbot..
+CMD="${PWD}/bin/taler-deployment-switch-${NONACTIVE_COLOR}"
-if test $active = "${DEPLOYMENT}-blue"; then
- nonactive="${DEPLOYMENT}-green"
-fi
-
-cmd=$(printf "%s; %s" \
- "cd /home/test" \
- "./deployment/bin/taler-deployment-switch-${nonactive}")
-
-echo "Switching to ${nonactive}."
-sudo -u test bash -c "${cmd}"
+echo "Switching to ${NONACTIVE_COLOR}."
+bash -c "${CMD}"