summaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
authorMS <ms@taler.net>2022-12-16 20:32:02 +0100
committerMS <ms@taler.net>2022-12-16 20:32:02 +0100
commitb08ee236d273a6e34b0ed4f10cf9d3d543484d6d (patch)
treeedd3822c44f7a0ef5b7cae88fa87d9494a180b58 /docker
parent694ea520cb4ea9fdefd3817633c20f8f5200b7d5 (diff)
downloaddeployment-b08ee236d273a6e34b0ed4f10cf9d3d543484d6d.tar.gz
deployment-b08ee236d273a6e34b0ed4f10cf9d3d543484d6d.tar.bz2
deployment-b08ee236d273a6e34b0ed4f10cf9d3d543484d6d.zip
Sandcastle: source checker.
Diffstat (limited to 'docker')
-rw-r--r--docker/sandcastle/compile-and-check/README19
-rw-r--r--docker/sandcastle/compile-and-check/base/Dockerfile26
-rwxr-xr-xdocker/sandcastle/compile-and-check/base/compile_and_check.sh76
3 files changed, 121 insertions, 0 deletions
diff --git a/docker/sandcastle/compile-and-check/README b/docker/sandcastle/compile-and-check/README
new file mode 100644
index 0000000..86aaaa0
--- /dev/null
+++ b/docker/sandcastle/compile-and-check/README
@@ -0,0 +1,19 @@
+This Docker image compiles all the Taler code, along
+its entrypoint. Upon failures, it offers a debug shell
+to inspect the running container.
+
+Build
+-----
+
+To compile the Git master code, run the following
+command from this directory. Note: some versions
+may require to first export the env var DOCKER_BUILDKIT=1.
+
+$ docker build -t sandcastle-checker base/
+
+Run
+---
+
+From anywhere in the filesystem, run:
+
+$ docker run -it sandcastle-checker
diff --git a/docker/sandcastle/compile-and-check/base/Dockerfile b/docker/sandcastle/compile-and-check/base/Dockerfile
new file mode 100644
index 0000000..0d6fc34
--- /dev/null
+++ b/docker/sandcastle/compile-and-check/base/Dockerfile
@@ -0,0 +1,26 @@
+FROM debian:experimental
+RUN apt-get update
+
+RUN apt-get install -y autoconf autopoint libtool texinfo \
+ libgcrypt-dev libidn11-dev zlib1g-dev libunistring-dev \
+ libjansson-dev python3-pip git recutils libsqlite3-dev \
+ libpq-dev postgresql libcurl4-openssl-dev libsodium-dev git \
+ libqrencode-dev zip jq npm openjdk-17-jre nginx procps \
+ curl python3-jinja2 wget curl python3-sphinx socat apache2-utils \
+ python3-sphinx-rtd-theme sqlite3 vim emacs
+RUN pip3 install requests click poetry uwsgi htmlark
+
+ARG tags_file
+# The following command provides a conditional copy from
+# the host filesystem. It mounts the current directory -
+# where the tags file MIGHT be - to /context in the container.
+# It appears NOT possible to mount arbitrary paths from the
+# host with "RUN --mount". Hence, when a tags file is given,
+# the CWD has to be the one containing the tags file. build_base.sh
+# sets (1) the CWD this way and (2) $tags_file to be the tags file
+# basename, before starting the compilation.
+RUN --mount=target=/context if test -n "$tags_file"; then cp \
+/context/${tags_file} /tags.sh; else touch /tags.sh; fi
+RUN chmod +x /tags.sh
+COPY ./compile_and_check.sh /
+ENTRYPOINT /compile_and_check.sh
diff --git a/docker/sandcastle/compile-and-check/base/compile_and_check.sh b/docker/sandcastle/compile-and-check/base/compile_and_check.sh
new file mode 100755
index 0000000..b2462fc
--- /dev/null
+++ b/docker/sandcastle/compile-and-check/base/compile_and_check.sh
@@ -0,0 +1,76 @@
+#!/bin/bash
+
+set -eu
+
+start_debug_shell () {
+ bash --init-file <(echo \
+ "echo 'Press enter for the debug shell..'; read -t 300 || exit $?"
+ ) -i
+}
+trap start_debug_shell ERR
+
+echo -n Exporting the tags environment..
+set -a
+. tags.sh
+set +a
+echo DONE
+echo Exported tags:
+{ env | grep TAG_; } || echo NONE
+
+git clone git://git.gnunet.org/libmicrohttpd --branch ${TAG_LIBMHD:-master}
+git clone git://git.gnunet.org/gnunet --branch ${TAG_GNUNET:-master}
+git clone git://git.taler.net/exchange --branch ${TAG_EXCHANGE:-master}
+git clone git://git.taler.net/merchant --branch ${TAG_MERCHANT:-master}
+git clone git://git.taler.net/libeufin --branch ${TAG_LIBEUFIN:-master}
+git clone git://git.taler.net/taler-merchant-demos --branch ${TAG_MERCHANT_DEMOS:-master}
+git clone git://git.taler.net/wallet-core --branch ${TAG_WALLET:-master}
+git clone git://git.taler.net/sync --branch ${TAG_SYNC:-master}
+
+cd /libmicrohttpd
+./bootstrap
+./configure --disable-doc
+make install
+
+cd /gnunet
+./bootstrap
+./configure --enable-logging=verbose --disable-documentation
+make install
+
+cd /exchange
+if test "${TAG_EXCHANGE:-}" = "v0.9.0"; then
+ # Init Gana and checkout the v0.9.0-compatible commit.
+ git submodule init contrib/gana
+ git submodule update --remote contrib/gana
+ # Note: without init first, the following checkout hits "reference is not a tree".
+ git -C contrib/gana checkout 6b9824cb4d4561f1167c7f518998a226a82222d6;
+ # Remove master branch tracking the remote
+ git -C contrib/gana branch -d master
+ git -C contrib/gana remote set-url origin .
+ git -C contrib/gana branch master
+fi
+./bootstrap
+./configure CFLAGS="-ggdb -O0" --enable-logging=verbose --disable-doc
+make install
+make check
+
+cd /merchant
+./bootstrap
+./configure CFLAGS="-ggdb -O0" --enable-logging=verbose --disable-doc
+make install
+make check
+
+cd /libeufin
+./bootstrap
+./configure
+make install
+
+cd /taler-merchant-demos
+./bootstrap
+./configure
+make install
+
+cd /sync
+./bootstrap
+./configure CFLAGS="-ggdb -O0" --enable-logging=verbose --disable-doc
+make install
+make check