taler-deployment

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

commit e7f9de0a48c9d62146babe7f01bf397735b2d413
parent dc9fab323fc836733b7cc998ee6141d7ecd19cc5
Author: Marcello Stanisci <marcello.stanisci@inria.fr>
Date:   Wed,  8 Mar 2017 14:27:33 +0100

Adding stepts' scripts.

Diffstat:
Ataler-build/switch_build.sh | 11+++++++++++
Ataler-build/switch_check_exchange.sh | 11+++++++++++
Ataler-build/switch_check_merchant.sh | 16++++++++++++++++
Ataler-build/switch_restart.sh | 7+++++++
Ataler-build/switch_switch.sh | 13+++++++++++++
5 files changed, 58 insertions(+), 0 deletions(-)

diff --git a/taler-build/switch_build.sh b/taler-build/switch_build.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +active=$(sudo -u test cat /home/test/active) +nonactive="test-blue" +echo "Active party: ${active}" + +if test $active = "test-blue"; then + nonactive="test-green" +fi + +sudo -u $nonactive bash -c 'source $HOME/activate; taler-deployment-build' diff --git a/taler-build/switch_check_exchange.sh b/taler-build/switch_check_exchange.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +status_code1=$(curl -s -o /dev/null -w "%{http_code}" https://exchange.test.taler.net/) +status_code2=$(curl -s -o /dev/null -w "%{http_code}" https://exchange.test.taler.net/keys) + +if test \ + $status_code1 = 502 -o \ + $status_code2 = 502; then + exit 1 +fi +exit 0 diff --git a/taler-build/switch_check_merchant.sh b/taler-build/switch_check_merchant.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +status_code1=$(curl -s -o /dev/null -w "%{http_code}" https://shop.test.taler.net/backend) +status_code2=$(curl -s -o /dev/null -w "%{http_code}" https://shop.test.taler.net/backend/proposal) +status_code3=$(curl -s -o /dev/null -w "%{http_code}" https://donations.test.taler.net/backend) +status_code4=$(curl -s -o /dev/null -w "%{http_code}" https://donations.test.taler.net/backend/proposal) + +if test \ + $status_code1 = 502 -o \ + $status_code2 = 502 -o \ + $status_code3 = 502 -o \ + $status_code4 = 502; then + exit 1 +fi + +exit 0 diff --git a/taler-build/switch_restart.sh b/taler-build/switch_restart.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +active=$(sudo -u test cat /home/test/active) +nonactive="test-blue" +echo "Active party: ${active}" + +sudo -u $nonactive bash -c 'cd $HOME; . activate; taler-deployment-restart' diff --git a/taler-build/switch_switch.sh b/taler-build/switch_switch.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +active=$(sudo -u test cat /home/test/active) +nonactive="test-blue" +echo "Active party: ${active}" + +if test $active = "test-blue"; then + nonactive="test-green" +fi + +echo "Switching to ${nonactive}." +sudo -u test bash -c "cd /home/test; ./ln-${nonactive}.sh" +sudo -u $nonactive bash -c 'cd $HOME; . activate; taler-deployment-restart'