diff options
author | ms <ms@taler.net> | 2021-08-20 16:38:20 +0200 |
---|---|---|
committer | ms <ms@taler.net> | 2021-08-20 16:38:52 +0200 |
commit | 711c0dbd837a43c1e1b29df675bb063f35865b95 (patch) | |
tree | 20fa6a758fc2ad8752b0d6e3431429c7c0ae5f51 | |
parent | 4e8169b9d271f7a41f76fc84e0ac26d39ad6c413 (diff) | |
download | anastasis-711c0dbd837a43c1e1b29df675bb063f35865b95.tar.gz anastasis-711c0dbd837a43c1e1b29df675bb063f35865b95.zip |
Anastasis/Libeufin setup script: first steps.
-rwxr-xr-x[-rw-r--r--] | src/cli/test_iban.sh | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/cli/test_iban.sh b/src/cli/test_iban.sh index e43dc10..a7695e5 100644..100755 --- a/src/cli/test_iban.sh +++ b/src/cli/test_iban.sh | |||
@@ -14,6 +14,7 @@ set -eu | |||
14 | # installed/available | 14 | # installed/available |
15 | #* starts Nexus (in background) | 15 | #* starts Nexus (in background) |
16 | #* starts sandbox (in background) | 16 | #* starts sandbox (in background) |
17 | # ~~~~~~~~~ | ||
17 | #* creates two IBAN accounts | 18 | #* creates two IBAN accounts |
18 | #* stores IBANs of both accounts in shell variables, | 19 | #* stores IBANs of both accounts in shell variables, |
19 | # call them IBAN_CREDIT and IBAN_DEBIT. | 20 | # call them IBAN_CREDIT and IBAN_DEBIT. |
@@ -34,3 +35,59 @@ set -eu | |||
34 | #echo -n "Starting sandbox ..." | 35 | #echo -n "Starting sandbox ..." |
35 | ## DO WORK | 36 | ## DO WORK |
36 | #echo " DONE" | 37 | #echo " DONE" |
38 | |||
39 | if ! libeufin-cli --version &> /dev/null; then | ||
40 | echo "libeufin-cli not found" | ||
41 | exit 77; | ||
42 | fi | ||
43 | |||
44 | if ! libeufin-nexus --version &> /dev/null; then | ||
45 | echo "libeufin-nexus not found" | ||
46 | exit 77; | ||
47 | fi | ||
48 | |||
49 | if ! libeufin-sandbox --version &> /dev/null; then | ||
50 | echo "libeufin-sandbox not found" | ||
51 | exit 77; | ||
52 | fi | ||
53 | |||
54 | if ! psql -d anastasischeck -c "\q" &> /dev/null; then | ||
55 | echo "Postgresql database 'anastasischeck' not reachable" | ||
56 | exit 77 | ||
57 | fi | ||
58 | |||
59 | CURRENCY="TESTKUDOS" | ||
60 | export LIBEUFIN_NEXUS_DB_CONNECTION="jdbc:sqlite:$(mktemp -u /tmp/nexus-db-XXXXXX.sqlite)" | ||
61 | export LIBEUFIN_SANDBOX_DB_CONNECTION="jdbc:sqlite:$(mktemp -u /tmp/sandbox-db-XXXXXX.sqlite)" | ||
62 | NEXUS_URL="http://localhost:5001/" | ||
63 | SANDBOX_URL="http://localhost:5000/" | ||
64 | |||
65 | echo "Starting Nexus .." | ||
66 | libeufin-nexus serve &> nexus.log & | ||
67 | nexus_pid=$! | ||
68 | if ! curl -s --retry 5 --retry-connrefused $NEXUS_URL > /dev/null; then | ||
69 | echo "Could not launch Nexus" | ||
70 | exit 77 | ||
71 | fi | ||
72 | echo "Nexus started." | ||
73 | |||
74 | echo "Starting Sandbox .." | ||
75 | libeufin-sandbox serve &> sandbox.log & | ||
76 | sandbox_pid=$! | ||
77 | if ! curl -s --retry 5 --retry-connrefused $SANDBOX_URL > /dev/null; then | ||
78 | echo "Could not launch Sandbox" | ||
79 | exit 77 | ||
80 | fi | ||
81 | echo "Sandbox started." | ||
82 | |||
83 | #libeufin-nexus serve &> nexus.log & | ||
84 | #nexus_pid=$! | ||
85 | #echo "Starting Sandbox .." | ||
86 | #libeufin-sandbox serve &> sandbox.log & | ||
87 | #sandbox_pid=$! | ||
88 | # | ||
89 | # FIXME: not always both services get killed. | ||
90 | trap "echo Terminating services.; kill $nexus_pid; kill $sandbox_pid" EXIT | ||
91 | # | ||
92 | #curl -s --retry 5 --retry-connrefused $NEXUS_URL > /dev/null | ||
93 | #curl -s --retry 5 --retry-connrefused $SANDBOX_URL > /dev/null | ||