From d08413da54dd7e1d1d5445b897ae5a039fb491f5 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 29 Feb 2016 02:21:48 +0100 Subject: arm based deployment --- crontab.template | 16 ++++++---------- launch_merchant.sh | 24 ------------------------ launch_mint.sh | 19 ------------------- start.sh | 13 +++++++++++++ update_bank.sh | 3 +++ update_gnunet.sh | 3 +++ update_merchant.sh | 14 ++++++++++++++ update_mint.sh | 13 +++++++++++++ update_wallet.sh | 3 +++ 9 files changed, 55 insertions(+), 53 deletions(-) delete mode 100755 launch_merchant.sh delete mode 100755 launch_mint.sh create mode 100755 start.sh create mode 100755 update_bank.sh create mode 100755 update_gnunet.sh create mode 100755 update_merchant.sh create mode 100755 update_mint.sh create mode 100755 update_wallet.sh diff --git a/crontab.template b/crontab.template index 5c05cd9..7cd9491 100644 --- a/crontab.template +++ b/crontab.template @@ -4,13 +4,9 @@ MAILTO=demo@localhost # minute hour day-of-month month day-of-week command -# Occasionaly update GNUnet -@monthly { cd $HOME/gnunet/ && make && make install; } &>/dev/null -# Update mint -3 * * * * { cd $HOME/mint && git pull && cd $HOME/deployment && ./build_mint.sh && ./launch_mint.sh; } &>/dev/null -# Update the landing page, which is in the wallet repo -3 * * * * cd $HOME/wallet && git pull &>/dev/null -# Update merchant -13 * * * * { cd $HOME/merchant/ && git pull && cd $HOME/deployment && ./build_merchant.sh && ./launch_merchant.sh; } &>/dev/null -# Update bank -*/13 * * * * { cd $HOME/bank/ && git pull && cd $HOME/deployment && ./django_wsgi.sh; } &>/dev/null +@reboot $HOME/deployment/start.sh +@monthly $HOME/deployment/update_gnunet.sh +3 * * * * $HOME/deployment/update_mint.sh +3 * * * * $HOME/deployment/update_wallet.sh +13 * * * * $HOME/deployment/update_merchant.sh +*/13 * * * * $HOME/deployment/update_bank.sh diff --git a/launch_merchant.sh b/launch_merchant.sh deleted file mode 100755 index 31e5f64..0000000 --- a/launch_merchant.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -set -eu - -ulimit -c unlimited - -pids=$(pidof taler-merchant-httpd || true) -if [[ ! -z "$pids" ]]; then - kill $pids || true - sleep 1 -fi -pids=$(pidof taler-merchant-httpd || true) -if [[ ! -z "$pids" ]]; then - kill -9 $pids || true -fi - -echo launching merchant - -cd $HOME - -nohup $HOME/local/bin/taler-merchant-httpd -t -c $HOME/merchant.conf | tee $HOME/nohup.merchant.out & -disown - -echo "Merchant PID:" $(pgrep -a -U $(whoami) taler-merchant) diff --git a/launch_mint.sh b/launch_mint.sh deleted file mode 100755 index d730114..0000000 --- a/launch_mint.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -set -eu - -ulimit -c unlimited - -pids=$(pidof taler-mint-httpd || true) -if [[ ! -z "$pids" ]]; then - kill $pids || true - sleep 1 - kill -9 $pids || true -fi - -echo launching mint - -cd $HOME - -nohup $HOME/local/bin/taler-mint-httpd -d $HOME/mint_config | tee $HOME/nohup.mint.out & -disown diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..4b4b165 --- /dev/null +++ b/start.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +export GNUNET_BASE_CONFIG=$HOME/deployment/taler-arm +export PATH="$HOME/local/bin":$PATH + +{ + cd $HOME/deployment && \ + gnunet-arm -s && \ + gnunet-arm -i taler-mint && \ + gnunet-arm -i taler-merchant +} &>/dev/null + + diff --git a/update_bank.sh b/update_bank.sh new file mode 100755 index 0000000..626e888 --- /dev/null +++ b/update_bank.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +{ cd $HOME/bank/ && git pull && cd $HOME/deployment && ./django_wsgi.sh; } &>/dev/null diff --git a/update_gnunet.sh b/update_gnunet.sh new file mode 100755 index 0000000..6d249a1 --- /dev/null +++ b/update_gnunet.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +{ cd $HOME/gnunet/ && make && make install; } &>/dev/null diff --git a/update_merchant.sh b/update_merchant.sh new file mode 100755 index 0000000..d3f9243 --- /dev/null +++ b/update_merchant.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +export GNUNET_BASE_CONFIG=$HOME/deployment/taler-arm +export PATH="$HOME/local/bin":$PATH + +{ + cd $HOME/merchant/ && \ + git pull && \ + cd $HOME/deployment && \ + ./build_merchant.sh && \ + gnunet-arm -k taler-merchant + gnunet-arm -i taler-merchant +} &>/dev/null + diff --git a/update_mint.sh b/update_mint.sh new file mode 100755 index 0000000..9bbd82f --- /dev/null +++ b/update_mint.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +export GNUNET_BASE_CONFIG=$HOME/deployment/taler-arm +export PATH="$HOME/local/bin":$PATH + +{ + cd $HOME/mint && \ + git pull && \ + cd $HOME/deployment && \ + ./build_mint.sh && \ + gnunet-arm -k taler-mint + gnunet-arm -i taler-mint +} &>/dev/null diff --git a/update_wallet.sh b/update_wallet.sh new file mode 100755 index 0000000..c93a102 --- /dev/null +++ b/update_wallet.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +cd $HOME/wallet && git pull &>/dev/null -- cgit v1.2.3