summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2018-11-28 11:25:40 +0100
committerMarcello Stanisci <stanisci.m@gmail.com>2018-11-28 11:25:40 +0100
commit6ad237699ad68239875c6bf487f9b33241542986 (patch)
tree6e175c3ce90a94643ccd82acb03bc1e2a815adf6
parent11f1874a227ca99e0c26fbdd1f854b4701e722f0 (diff)
downloaddeployment-6ad237699ad68239875c6bf487f9b33241542986.tar.gz
deployment-6ad237699ad68239875c6bf487f9b33241542986.tar.bz2
deployment-6ad237699ad68239875c6bf487f9b33241542986.zip
Adapt "services checker" script to "demo" deployment.
-rwxr-xr-xbuildbot/checks.sh34
-rw-r--r--buildbot/master.cfg27
2 files changed, 47 insertions, 14 deletions
diff --git a/buildbot/checks.sh b/buildbot/checks.sh
index 85d031f..aba64be 100755
--- a/buildbot/checks.sh
+++ b/buildbot/checks.sh
@@ -1,14 +1,14 @@
#!/bin/bash
-if test -z ${DEPLOYMENT}; then
- echo "Please export env variable DEPLOYMENT=(test|demo) before running this script"
+if test -z ${TALER_DEPLOYMENT}; then
+ echo "Please export env variable TALER_DEPLOYMENT=(test|demo) before running this script"
exit 1
fi
nonactive="dummy"
-if test $DEPLOYMENT = "test"; then
- active=$(sudo -u $DEPLOYMENT cat /home/$DEPLOYMENT/active)
+if test ${TALER_DEPLOYMENT} = "test"; then
+ active=$(sudo -u ${TALER_DEPLOYMENT} cat /home/${TALER_DEPLOYMENT}/active)
nonactive="blue"
echo "Active party: ${active}"
@@ -30,7 +30,7 @@ error_stringify ()
error_fmt="%s (http status code: %s)/(curl exit code: %s - %s)\n"
-URL="https://exchange.${DEPLOYMENT}.taler.net/"
+URL="https://exchange.${TALER_DEPLOYMENT}.taler.net/"
http_status_code=$(curl \
-H "X-Taler-Deployment-Color: $nonactive" \
-s "$URL" -o /dev/null \
@@ -43,7 +43,7 @@ if ! test 200 = $http_status_code; then
exit 1
fi
-URL="http://backend.${DEPLOYMENT}.taler.net/"
+URL="http://backend.${TALER_DEPLOYMENT}.taler.net/"
http_status_code=$(curl \
-H "X-Taler-Deployment-Color: $nonactive" \
-s $URL \
@@ -59,7 +59,7 @@ if ! test 200 = $http_status_code; then
fi
-URL="https://shop.${DEPLOYMENT}.taler.net/"
+URL="https://shop.${TALER_DEPLOYMENT}.taler.net/"
http_status_code=$(curl \
-H "X-Taler-Deployment-Color: $nonactive" \
-s $URL -o /dev/null \
@@ -72,8 +72,20 @@ if ! test 200 = $http_status_code; then
exit 1
fi
+URL="https://survey.${TALER_DEPLOYMENT}.taler.net/"
+http_status_code=$(curl \
+ -H "X-Taler-Deployment-Color: $nonactive" \
+ -s $URL -o /dev/null \
+ -w "%{http_code}")
+if ! test 200 = $http_status_code; then
+ printf "%s failed" $URL
+ printf "$error_fmt" \
+ "Survey site did not restart correctly" \
+ $http_status_code $? "$(error_stringify $?)"
+ exit 1
+fi
-URL="https://donations.${DEPLOYMENT}.taler.net/"
+URL="https://donations.${TALER_DEPLOYMENT}.taler.net/"
http_status_code=$(curl \
-H "X-Taler-Deployment-Color: $nonactive" \
-s $URL -o /dev/null \
@@ -86,9 +98,7 @@ if ! test 200 = $http_status_code; then
exit 1
fi
-
-
-URL="https://bank.${DEPLOYMENT}.taler.net/"
+URL="https://bank.${TALER_DEPLOYMENT}.taler.net/"
http_status_code=$(curl \
-H "X-Taler-Deployment-Color: $nonactive" \
-s $URL -o /dev/null \
@@ -101,7 +111,7 @@ if ! test 302 = $http_status_code; then
exit 1
fi
-URL="https://${DEPLOYMENT}.taler.net/en/index.html"
+URL="https://${TALER_DEPLOYMENT}.taler.net/en/index.html"
http_status_code=$(curl \
-H "X-Taler-Deployment-Color: $nonactive" \
-s $URL -o /dev/null \
diff --git a/buildbot/master.cfg b/buildbot/master.cfg
index dbafad8..668672a 100644
--- a/buildbot/master.cfg
+++ b/buildbot/master.cfg
@@ -31,6 +31,7 @@ c["workers"] = [
worker.Worker("switcher-worker", "switcher-pass"),
worker.Worker("debug-worker", "debug-pass"),
worker.Worker("lint-worker", "lint-pass"),
+ worker.Worker("demo-worker", "demo-pass"),
worker.Worker("wallet-worker", "wallet-pass")]
# 'protocols' contains information about protocols which master
@@ -95,6 +96,11 @@ WALLET_SCHEDULER = schedulers.SingleBranchScheduler(
treeStableTimer=None,
builderNames=[])
+DEMO_SERVICES_CHECKER_SCHEDULER = schedulers.Periodic(
+ name="demo-services-checker-scheduler",
+ periodicBuildTimer=60*60, # 1 hour
+ builderNames=["demo-services-checker-builder"])
+
TIP_RESERVE_TOPPER_SCHEDULER = schedulers.Periodic(
name="tip-reserve-topper-scheduler",
periodicBuildTimer=60*60*24*10, # 10 days
@@ -143,6 +149,7 @@ FORCE_SCHEDULER = schedulers.ForceScheduler(
c["schedulers"] = [
NIGHTLY_SCHEDULER,
TIP_RESERVE_TOPPER_SCHEDULER,
+ DEMO_SERVICES_CHECKER_SCHEDULER,
DOC_SCHEDULER,
WALLET_SCHEDULER,
ALL_SCHEDULER,
@@ -316,6 +323,18 @@ DOC_FACTORY.addStep(ShellCommand(
workdir="build/buildbot",
haltOnFailure=True))
+DEMO_SERVICES_CHECKER_FACTORY = util.BuildFactory()
+DEMO_SERVICES_CHECKER_FACTORY.addStep(git_step(
+ "git://git.taler.net/deployment.git"))
+DEMO_SERVICES_CHECKER_FACTORY.addStep(ShellCommand(
+ name="demo services checker",
+ description="Checking demo services are online",
+ descriptionDone="Demo services are online!.",
+ command=["./checks.sh"],
+ workdir="build/buildbot",
+ haltOnFailure=True,
+ env={"TALER_DEPLOYMENT": "demo"}))
+
DEBUG_BUILDER = util.BuilderConfig(
name="debug-builder",
workernames=["debug-worker"],
@@ -334,8 +353,12 @@ LCOV_BUILDER = util.BuilderConfig(
TIP_RESERVE_TOPPER_BUILDER = util.BuilderConfig(
name="tip-reserve-topper-builder",
workernames="switcher-worker",
- factory=TIP_RESERVE_TOPPER_FACTORY
-)
+ factory=TIP_RESERVE_TOPPER_FACTORY)
+
+DEMO_SERVICES_CHECKER_BUILDER = util.BuilderConfig(
+ name="demo-services-checker-builder",
+ workernames="demo-worker",
+ factory=DEMO_SERVICES_CHECKER_FACTORY)
SWITCHER_BUILDER = util.BuilderConfig(
name="switcher-builder",