taler-deployment

Deployment scripts and configuration files
Log | Files | Refs | README

commit 60b0f6bb93ee4ab9e88453b7b847bec988283caf
parent 8e715805f5a24e1f08343d0a9aa29b6de941e9cb
Author: Marcello Stanisci <stanisci.m@gmail.com>
Date:   Tue, 16 Apr 2019 22:14:29 +0200

fix paths

Diffstat:
Mbuildbot/master.cfg | 6++++--
Mbuildbot/switch.sh | 25++++++++-----------------
2 files changed, 12 insertions(+), 19 deletions(-)

diff --git a/buildbot/master.cfg b/buildbot/master.cfg @@ -323,14 +323,16 @@ BUILD_FACTORY.addStep(ShellCommand( haltOnFailure=True, env={'DEPLOYMENT': "test"})) + +SWITCH_FACTORY.addStep(git_step( + "git://git.taler.net/deployment.git")) SWITCH_FACTORY = util.BuildFactory() SWITCH_FACTORY.addStep(ShellCommand( name="switch active party", description="Switch to the party which was inactive.", descriptionDone="Active party has been switched.", command=["./switch.sh"], - workdir="build/buildbot", - env={'BRANCH': util.Property("branch")})) + workdir="build/buildbot")) SELENIUM_FACTORY = util.BuildFactory() SELENIUM_FACTORY.addStep(ShellCommand( diff --git 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}"