summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2019-02-13 19:13:53 +0100
committerMarcello Stanisci <stanisci.m@gmail.com>2019-02-13 19:13:53 +0100
commit27c277d752aac8ec5a7aacb308f061cb68361534 (patch)
tree5b7a83fe015324099432699c52bdfda0a7e72446
parentb8713c9c7b79ecd2af6d273fe182a8d0de798a6a (diff)
downloaddeployment-27c277d752aac8ec5a7aacb308f061cb68361534.tar.gz
deployment-27c277d752aac8ec5a7aacb308f061cb68361534.tar.bz2
deployment-27c277d752aac8ec5a7aacb308f061cb68361534.zip
Addressing #5424. Not tested (relatively depends on #5490).
-rwxr-xr-xbuildbot/config.sh13
-rwxr-xr-xbuildbot/keys.sh13
-rw-r--r--buildbot/master.cfg34
-rwxr-xr-xbuildbot/restart.sh13
-rwxr-xr-xbuildbot/sign.sh13
-rwxr-xr-xbuildbot/switch.sh13
6 files changed, 65 insertions, 34 deletions
diff --git a/buildbot/config.sh b/buildbot/config.sh
index a3f9434..dd22421 100755
--- a/buildbot/config.sh
+++ b/buildbot/config.sh
@@ -1,11 +1,16 @@
#!/bin/bash
-active=$(sudo -u test cat /home/test/active)
-nonactive="test-blue"
+DEPLOYMENT="test"
+
+if test "stable" = ${BRANCH}; then
+ DEPLOYMENT="demo"
+
+active=$(sudo -u ${DEPLOYMENT} cat /home/${DEPLOYMENT}/active)
+nonactive="${DEPLOYMENT}-blue"
echo "Active party: ${active}"
-if test $active = "test-blue"; then
- nonactive="test-green"
+if test $active = "${DEPLOYMENT}-blue"; then
+ nonactive="${DEPLOYMENT}-green"
fi
sudo -u $nonactive bash -c 'source $HOME/activate; taler-deployment-config-generate'
diff --git a/buildbot/keys.sh b/buildbot/keys.sh
index 45f4f86..220492f 100755
--- a/buildbot/keys.sh
+++ b/buildbot/keys.sh
@@ -1,11 +1,16 @@
#!/bin/bash
-active=$(sudo -u test cat /home/test/active)
-nonactive="test-blue"
+DEPLOYMENT="test"
+
+if test "stable" = ${BRANCH}; then
+ DEPLOYMENT="demo"
+
+active=$(sudo -u ${DEPLOYMENT} cat /home/${DEPLOYMENT}/active)
+nonactive="${DEPLOYMENT}-blue"
echo "Active party: ${active}"
-if test $active = "test-blue"; then
- nonactive="test-green"
+if test $active = "${DEPLOYMENT}-blue"; then
+ nonactive="${DEPLOYMENT}-green"
fi
sudo -u $nonactive bash -c 'source $HOME/activate; taler-deployment-keyup'
diff --git a/buildbot/master.cfg b/buildbot/master.cfg
index c5cbf8e..e770cf2 100644
--- a/buildbot/master.cfg
+++ b/buildbot/master.cfg
@@ -1,12 +1,11 @@
import re
from buildbot.steps.source.git import Git
from buildbot.steps.shell import ShellCommand
-from buildbot.plugins import \
- (reporters,
- worker,
- changes,
- schedulers,
- util)
+from buildbot.plugins import (reporters,
+ worker,
+ changes,
+ schedulers,
+ util)
# This is a sample buildmaster config file. It must be installed as
# 'master.cfg' in your buildmaster's base directory.
@@ -111,7 +110,7 @@ TIP_RESERVE_TOPPER_SCHEDULER = schedulers.Periodic(
ALL_SCHEDULER = schedulers.SingleBranchScheduler(
name="all-scheduler",
change_filter=util.ChangeFilter(
- branch="master",
+ branch_re="master|stable",
project_re="backoffice|wallet|bank|exchange|"
"merchant|deployment|donations|twister|"
"blog|help|survey|landing|playground"),
@@ -272,7 +271,8 @@ SWITCHER_FACTORY.addStep(ShellCommand(
descriptionDone="Configuration file generated.",
command=["./config.sh"],
workdir="build/buildbot",
- haltOnFailure=True))
+ haltOnFailure=True,
+ env={'BRANCH': util.Property("branch")}))
SWITCHER_FACTORY.addStep(ShellCommand(
name="build",
@@ -280,7 +280,8 @@ SWITCHER_FACTORY.addStep(ShellCommand(
descriptionDone="Inactive party got built.",
command=["./build.sh"],
workdir="build/buildbot",
- haltOnFailure=True))
+ haltOnFailure=True,
+ env={'BRANCH': util.Property("branch")}))
SWITCHER_FACTORY.addStep(ShellCommand(
name="keys generation and sign",
@@ -288,7 +289,8 @@ SWITCHER_FACTORY.addStep(ShellCommand(
descriptionDone="Exchange keys generated, and auditor-signed.",
command=["./keys.sh"],
workdir="build/buildbot",
- haltOnFailure=True))
+ haltOnFailure=True,
+ env={'BRANCH': util.Property("branch")}))
SWITCHER_FACTORY.addStep(ShellCommand(
name="wire details sign",
@@ -296,7 +298,8 @@ SWITCHER_FACTORY.addStep(ShellCommand(
descriptionDone="Exchange wire details got signed.",
command=["./sign.sh"],
workdir="build/buildbot",
- haltOnFailure=True))
+ haltOnFailure=True,
+ env={'BRANCH': util.Property("branch")}))
SWITCHER_FACTORY.addStep(ShellCommand(
name="restart services",
@@ -304,7 +307,8 @@ SWITCHER_FACTORY.addStep(ShellCommand(
descriptionDone="Restarting Taler.",
command=["./restart.sh"],
workdir="build/buildbot",
- haltOnFailure=True))
+ haltOnFailure=True,
+ env={'BRANCH': util.Property("branch")}))
SWITCHER_FACTORY.addStep(ShellCommand(
name="check services correctly restarted",
@@ -312,14 +316,16 @@ SWITCHER_FACTORY.addStep(ShellCommand(
descriptionDone="All services are correctly restarted.",
command=["./checks.sh"],
workdir="build/buildbot",
- haltOnFailure=True))
+ haltOnFailure=True,
+ env={'BRANCH': util.Property("branch")}))
SWITCHER_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"))
+ workdir="build/buildbot",
+ env={'BRANCH': util.Property("branch")}))
SELENIUM_FACTORY = util.BuildFactory()
SELENIUM_FACTORY.addStep(ShellCommand(
diff --git a/buildbot/restart.sh b/buildbot/restart.sh
index dad6366..19a18d1 100755
--- a/buildbot/restart.sh
+++ b/buildbot/restart.sh
@@ -1,11 +1,16 @@
#!/bin/bash
-active=$(sudo -u test cat /home/test/active)
-nonactive="test-blue"
+DEPLOYMENT="test"
+
+if test "stable" = ${BRANCH}; then
+ DEPLOYMENT="demo"
+
+active=$(sudo -u ${DEPLOYMENT} cat /home/${DEPLOYMENT}/active)
+nonactive="${DEPLOYMENT}-blue"
echo "Active party: ${active}"
-if test $active = "test-blue"; then
- nonactive="test-green"
+if test $active = "${DEPLOYMENT}-blue"; then
+ nonactive="${DEPLOYMENT}-green"
fi
sudo -u $nonactive bash -c 'cd $HOME; . activate; taler-deployment-restart'
diff --git a/buildbot/sign.sh b/buildbot/sign.sh
index 68c4b51..cc93052 100755
--- a/buildbot/sign.sh
+++ b/buildbot/sign.sh
@@ -1,11 +1,16 @@
#!/bin/bash
-active=$(sudo -u test cat /home/test/active)
-nonactive="test-blue"
+DEPLOYMENT="test"
+
+if test "stable" = ${BRANCH}; then
+ DEPLOYMENT="demo"
+
+active=$(sudo -u ${DEPLOYMENT} cat /home/${DEPLOYMENT}/active)
+nonactive="${DEPLOYMENT}-blue"
echo "Active party: ${active}"
-if test $active = "test-blue"; then
- nonactive="test-green"
+if test $active = "${DEPLOYMENT}-blue"; then
+ nonactive="${DEPLOYMENT}-green"
fi
sudo -u $nonactive bash -c 'source $HOME/activate; taler-deployment-config-sign'
diff --git a/buildbot/switch.sh b/buildbot/switch.sh
index 0489727..82c169d 100755
--- a/buildbot/switch.sh
+++ b/buildbot/switch.sh
@@ -1,11 +1,16 @@
#!/bin/bash
-active=$(sudo -u test cat /home/test/active)
-nonactive="test-blue"
+DEPLOYMENT="test"
+
+if test "stable" = ${BRANCH}; then
+ DEPLOYMENT="demo"
+
+active=$(sudo -u ${DEPLOYMENT} cat /home/${DEPLOYMENT}/active)
+nonactive="${DEPLOYMENT}-blue"
echo "Active party: ${active}"
-if test $active = "test-blue"; then
- nonactive="test-green"
+if test $active = "${DEPLOYMENT}-blue"; then
+ nonactive="${DEPLOYMENT}-green"
fi
cmd=$(printf "%s; %s" \