summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-10-18 22:12:07 +0200
committerFlorian Dold <florian@dold.me>2023-10-18 22:12:07 +0200
commit3fcf7d8a32e1171186403da41cd0e1ceb8ea3555 (patch)
tree39be121042c12dfe448fe3b4d49203033dd175da
parentf980ff3de6a60e852618fa0791809367a6d37d6a (diff)
downloaddeployment-3fcf7d8a32e1171186403da41cd0e1ceb8ea3555.tar.gz
deployment-3fcf7d8a32e1171186403da41cd0e1ceb8ea3555.tar.bz2
deployment-3fcf7d8a32e1171186403da41cd0e1ceb8ea3555.zip
wip
-rw-r--r--sandcastle-ng/README.md17
-rwxr-xr-xsandcastle-ng/sandcastle-run3
-rwxr-xr-xsandcastle-ng/scripts/demo/setup-sandcastle.sh (renamed from sandcastle-ng/scripts/setup-sandcastle.sh)0
-rw-r--r--sandcastle-ng/scripts/none/setup-sandcastle.sh3
-rw-r--r--sandcastle-ng/systemd/setup-sandcastle.service3
5 files changed, 21 insertions, 5 deletions
diff --git a/sandcastle-ng/README.md b/sandcastle-ng/README.md
index 85caa2d..01339d0 100644
--- a/sandcastle-ng/README.md
+++ b/sandcastle-ng/README.md
@@ -29,7 +29,7 @@ Currently there is not much configuration.
The main adjustments to be made are:
-* scripts/setup-sandcastle.sh has the currency on top of the file
+* scripts/demo/setup-sandcastle.sh has the currency on top of the file
* sandcastle-run has variables for the port that'll be exposed ("published") on
the host. They can be overwritten with environment variables
(``TALER_SANDCASTLE_PORT_$COMPONENT``).
@@ -82,15 +82,24 @@ That volume also contains the postgres database files.
# Provisioning Details
-The whole deployment is configured by the script ``scripts/setup-sandcastle.sh``.
+The whole deployment is configured by the script ``/provision/setup-sandcastle.sh``.
This script will be run as a oneshot systemd service and will disable itself after
the first success.
To troubleshoot, run ``journalctl -u setup-sandcastle.service``.
-To run the container without any automatic provisioning, run ``./sandcastle-run -e SANDCASTLE_SKIP_SETUP=1``.
+There are different setup scripts in the ``scripts/$SANDCASTLE_SETUP_NAME``
+folders. Specifically:
-You can always manually run the script inside the container as ``/scripts/setup-sandcastle.sh``.
+* ``none`` does no setup at all
+* ``demo`` is the usual Taler demo
+* TBD: ``regio`` is a currency conversion setup
+
+By default, ``demo`` is used. To mount a different provision script, set ``$SANDCASTLE_SETUP_NAME``
+when running ``./sandcastle-run``.
+
+You can always manually run the provisioning script inside the container as
+``/scripts/$SANDCASTLE_SETUP_NAME/setup-sandcastle.sh``.
# Neat Things That Already Work
diff --git a/sandcastle-ng/sandcastle-run b/sandcastle-ng/sandcastle-run
index 737d3cf..c79551f 100755
--- a/sandcastle-ng/sandcastle-run
+++ b/sandcastle-ng/sandcastle-run
@@ -35,6 +35,8 @@ fi
# We need to be careful with SELinux when using volume mounts, relabel!
+SETUP_NAME=${SANDCASTLE_SETUP_NAME:-demo}
+
exec podman run \
-p=$SANDCASTLE_PORT_MERCHANT:$PORT_INTERNAL_MERCHANT \
-p=$SANDCASTLE_PORT_EXCHANGE:$PORT_INTERNAL_EXCHANGE \
@@ -48,6 +50,7 @@ exec podman run \
--systemd=always \
-v talerdata:/talerdata:Z \
-v $PWD/scripts:/scripts:Z \
+ -v $PWD/scripts/$SETUP_NAME:/provision:Z \
--entrypoint /sbin/init \
"$@" \
taler-base-all
diff --git a/sandcastle-ng/scripts/setup-sandcastle.sh b/sandcastle-ng/scripts/demo/setup-sandcastle.sh
index 887b5ed..887b5ed 100755
--- a/sandcastle-ng/scripts/setup-sandcastle.sh
+++ b/sandcastle-ng/scripts/demo/setup-sandcastle.sh
diff --git a/sandcastle-ng/scripts/none/setup-sandcastle.sh b/sandcastle-ng/scripts/none/setup-sandcastle.sh
new file mode 100644
index 0000000..f372d55
--- /dev/null
+++ b/sandcastle-ng/scripts/none/setup-sandcastle.sh
@@ -0,0 +1,3 @@
+#!/usr/bin/env
+
+echo "skipping provisioning"
diff --git a/sandcastle-ng/systemd/setup-sandcastle.service b/sandcastle-ng/systemd/setup-sandcastle.service
index c3d22ca..0acf5e0 100644
--- a/sandcastle-ng/systemd/setup-sandcastle.service
+++ b/sandcastle-ng/systemd/setup-sandcastle.service
@@ -3,7 +3,8 @@ Description=Provision the sandcastle
[Service]
Type=oneshot
-ExecStart=/scripts/setup-sandcastle.sh
+ConditionPathExists=/provision/setup-sandcastle.sh
+ExecStart=/provision/setup-sandcastle.sh
RemainAfterExit=yes
[Install]