summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Grossberger <code@grossberger.xyz>2021-01-30 16:54:52 +0100
committerLukas Grossberger <code@grossberger.xyz>2021-01-30 16:54:58 +0100
commite2b4140e4106eb15a139157639c428219036e5e8 (patch)
treec740a0ca6c7790310471383d5684c660b66a0755
parentc4e3dee8c57dd1ddb87cd4a6ccbd906817820c1e (diff)
downloadlibeufin-deployment-e2b4140e4106eb15a139157639c428219036e5e8.tar.gz
libeufin-deployment-e2b4140e4106eb15a139157639c428219036e5e8.tar.bz2
libeufin-deployment-e2b4140e4106eb15a139157639c428219036e5e8.zip
add basic compose sandbox cli test
-rw-r--r--docker/README.md24
-rw-r--r--docker/assets/apt_preferences (renamed from docker/apt_preferences)0
-rw-r--r--docker/assets/sandbox-cli-test.sh6
-rw-r--r--docker/cli.Dockerfile5
-rw-r--r--docker/compose.libeufin.yml6
-rw-r--r--docker/compose.sandbox.yml (renamed from docker/docker-compose.yml)14
-rw-r--r--docker/libeufin.Dockerfile2
-rw-r--r--docker/sandbox-cli.Dockerfile10
8 files changed, 35 insertions, 32 deletions
diff --git a/docker/README.md b/docker/README.md
index de76b23..985517b 100644
--- a/docker/README.md
+++ b/docker/README.md
@@ -3,38 +3,26 @@
This is meant as instructions for humans to run the different LibEuFin components
and examples from the documentation locally in Docker containers.
-This could become the bassis for an integration test style `docker-compose` setup.
-
-## Build Docker images
+## Build LibEuFin base image
```
-docker-compose build
+docker-compose -f compose.libeufin.yml build
```
+
## Scenario 1: Sandbox & CLI
In this scenario, the sandbox version is started fully self contained with its own
internal database to respond to interactions via the commandline interface even without
an EBICS compatible bank account.
-Start the sandbox image with
```
-docker run -d --name libeufin-sandbox -p 5000:5000 libeufin-sandbox:dev
+docker-compose -f compose.libeufin.yml -f compose.sandbox.yml build
+docker-compose -f compose.libeufin.yml -f compose.sandbox.yml up --abort-on-container-exit libeufin-sandbox-cli
```
-Start the base image for access to the CLI
-```
-docker run -it libeufin:dev /bin/bash
-```
-
-And run the command as specified in the
-[documentation](https://docs.taler.net/libeufin/nexus-tutorial.html#optional-configuring-the-sandbox)
-(use the IP of the docker sandbox image i.e. the docker network adapter)
-```
-export LIBEUFIN_SANDBOX_URL=http://172.17.0.1:5000/
-libeufin-cli sandbox check
-```
+This should exit with a success and at least print a version response from the sandbox.
## [WIP] Scenario 2: Nexus
diff --git a/docker/apt_preferences b/docker/assets/apt_preferences
index 83b74fe..83b74fe 100644
--- a/docker/apt_preferences
+++ b/docker/assets/apt_preferences
diff --git a/docker/assets/sandbox-cli-test.sh b/docker/assets/sandbox-cli-test.sh
new file mode 100644
index 0000000..a9721fd
--- /dev/null
+++ b/docker/assets/sandbox-cli-test.sh
@@ -0,0 +1,6 @@
+#/bin/bash
+
+# Wait for the sandbox to start
+sleep 5
+
+libeufin-cli sandbox check
diff --git a/docker/cli.Dockerfile b/docker/cli.Dockerfile
deleted file mode 100644
index e48e860..0000000
--- a/docker/cli.Dockerfile
+++ /dev/null
@@ -1,5 +0,0 @@
-FROM libeufin:dev
-
-ENV LIBEUFIN_SANDBOX_URL "http://localhost:5000/"
-
-CMD ["libeufin-cli","sandbox","check"]
diff --git a/docker/compose.libeufin.yml b/docker/compose.libeufin.yml
new file mode 100644
index 0000000..8f49250
--- /dev/null
+++ b/docker/compose.libeufin.yml
@@ -0,0 +1,6 @@
+services:
+ libeufin:
+ build:
+ context: ./
+ dockerfile: libeufin.Dockerfile
+ image: libeufin:dev \ No newline at end of file
diff --git a/docker/docker-compose.yml b/docker/compose.sandbox.yml
index 1fc5aed..1fa62a1 100644
--- a/docker/docker-compose.yml
+++ b/docker/compose.sandbox.yml
@@ -1,9 +1,4 @@
services:
- libeufin:
- build:
- context: ./
- dockerfile: libeufin.Dockerfile
- image: libeufin:dev
libeufin-sandbox:
depends_on:
- libeufin
@@ -11,10 +6,13 @@ services:
context: ./
dockerfile: sandbox.Dockerfile
image: libeufin-sandbox:dev
- libeufin-nexus:
+ ports:
+ - 5000:5000
+ libeufin-sandbox-cli:
depends_on:
- libeufin
+ - libeufin-sandbox
build:
context: ./
- dockerfile: nexus.Dockerfile
- image: libeufin-nexus:dev \ No newline at end of file
+ dockerfile: sandbox-cli.Dockerfile
+ image: libeufin-sandbox-cli:dev \ No newline at end of file
diff --git a/docker/libeufin.Dockerfile b/docker/libeufin.Dockerfile
index 3aeaeb5..a2d5546 100644
--- a/docker/libeufin.Dockerfile
+++ b/docker/libeufin.Dockerfile
@@ -6,7 +6,7 @@ RUN apt-get -y upgrade
RUN apt-get install -y gnupg2 wget
# LibEuFin setup
-COPY ./apt_preferences /etc/apt/preferences
+COPY ./assets/apt_preferences /etc/apt/preferences
RUN echo "deb https://deb.taler.net/apt/debian sid main" >> /etc/apt/sources.list
RUN wget -O - https://taler.net/static/taler-systems.gpg.key | apt-key add -
RUN apt-get update
diff --git a/docker/sandbox-cli.Dockerfile b/docker/sandbox-cli.Dockerfile
new file mode 100644
index 0000000..7e15a60
--- /dev/null
+++ b/docker/sandbox-cli.Dockerfile
@@ -0,0 +1,10 @@
+# Testing the sandbox with the CLI
+FROM libeufin:dev
+
+ENV SANDBOX_PORT 5000
+ENV LIBEUFIN_SANDBOX_URL "http://libeufin-sandbox:${SANDBOX_PORT}/"
+
+COPY ./assets/sandbox-cli-test.sh /sandbox-cli-test.sh
+RUN chmod +x /sandbox-cli-test.sh
+
+CMD /sandbox-cli-test.sh