gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-deployment] branch master updated: sandbox: git-pull with tags


From: gnunet
Subject: [taler-deployment] branch master updated: sandbox: git-pull with tags
Date: Sat, 12 Nov 2022 12:02:46 +0100

This is an automated email from the git hooks/post-receive script.

ms pushed a commit to branch master
in repository deployment.

The following commit(s) were added to refs/heads/master by this push:
     new c6f20a3  sandbox: git-pull with tags
c6f20a3 is described below

commit c6f20a326fac579f2fc3a6e16c634de46940bcf7
Author: MS <ms@taler.net>
AuthorDate: Sat Nov 12 12:01:42 2022 +0100

    sandbox: git-pull with tags
---
 docker/demo/README                 | 18 ++++++++++----
 docker/demo/build_base.sh          | 49 ++++++++++++++++++++++++++++++++++++++
 docker/demo/images/base/Dockerfile | 29 +++++++++++++---------
 docker/demo/tags.env               |  5 ++++
 4 files changed, 86 insertions(+), 15 deletions(-)

diff --git a/docker/demo/README b/docker/demo/README
index 6432650..1780e3d 100644
--- a/docker/demo/README
+++ b/docker/demo/README
@@ -28,10 +28,18 @@ Base image
 This image contains a minimal Debian distribution
 with ALL the Taler software and its dependencies.
 
-Navigate to the "images/base" directory, and run the
-following command:
+From this directory, run:
+
+  # Without arguments, it prints the help message.
+  $ ./build_base.sh $docker-file [tags-file]
 
-  $ docker build --no-cache -t taler_local/taler_base .
+tags-file is a bash source having environment variable
+definitions to specify which tags should be pulled for
+some of the components.  The following tags can be given:
+TAG_LIBMHD, TAG_GNUNET, TAG_EXCHANGE, TAG_MERCHANT,
+TAG_WALLET, TAG_LIBEUFIN, TAG_MERCHANT_DEMOS, TAG_SYNC.
+If tags-file is missing, all the code will be pulled
+to master's HEAD.
 
 Composed containers
 -------------------
@@ -78,7 +86,7 @@ Run
 ---
 
 The following command starts all the services in the background,
-and manages all the restarts (FIXME: observed once, to be confirmed!).
+and manages all the restarts (FIXME: double-check this).
 Run it from this directory:
 
   $ docker-compose up --remove-orphans -d 
@@ -244,3 +252,5 @@ Nginx configuration example deploys this sandbox under
       proxy_pass http://localhost:5562/;
     }
   }
+
+  TBD: need entry for Sync here.
diff --git a/docker/demo/build_base.sh b/docker/demo/build_base.sh
new file mode 100755
index 0000000..01e13dc
--- /dev/null
+++ b/docker/demo/build_base.sh
@@ -0,0 +1,49 @@
+#!/bin/bash
+
+# args: $1 base Dockerfile, $2 optional tags file
+
+set -e
+if test $# -eq 0; then
+  echo Usage: ./build_base.sh docker-file [tags-file]
+  echo
+  echo Builds the taler_local/taler_base base image, optionally
+  echo using the 'tags-file', a text file containing environment
+  echo variables definitions to specify to which Git tag each Taler
+  echo component should be pulled.
+  exit 0
+fi
+
+if ! which realpath > /dev/null; then
+  echo "Please, install 'realpath' (coreutils)"
+fi
+
+DOCKER_FILE=$(realpath $1)
+
+# Check base file.
+if ! test -a $DOCKER_FILE; then
+  echo Base Dockerfile: $DOCKER_FILE not found.
+  exit 1
+fi
+
+if test -n "$2"; then
+  ! test -a "$2" && (echo "Tag file: $2 not found." && exit 1) 
+  TAGS_FILE_DIR=$(dirname $2)
+  TAGS_FILE_NAME=$(basename $2)
+  cd $TAGS_FILE_DIR
+  docker build --no-cache \
+    -t taler_local/taler_base \
+    -f $DOCKER_FILE \
+    --build-arg tags_file=$TAGS_FILE_NAME .
+  cd -
+  exit 0
+fi
+echo Creating the dummy 'taler_notags' file.
+touch taler_notags
+docker build --no-cache \
+  -t taler_local/taler_base \
+  -f $DOCKER_FILE . || (
+    echo Removing the dummy 'taler_notags' file.
+    rm -f taler_notags
+  )
+echo Removing the dummy 'taler_notags' file.
+rm -f taler_notags
diff --git a/docker/demo/images/base/Dockerfile 
b/docker/demo/images/base/Dockerfile
index 98f9799..8f5252b 100644
--- a/docker/demo/images/base/Dockerfile
+++ b/docker/demo/images/base/Dockerfile
@@ -8,18 +8,27 @@ RUN apt-get install -y autoconf autopoint libtool texinfo \
   libqrencode-dev zip jq npm openjdk-17-jre nginx procps \
   curl python3-jinja2 wget curl python3-sphinx socat apache2-utils \
   python3-sphinx-rtd-theme 
-
 RUN pip3 install requests click poetry uwsgi
 
-RUN git clone git://git.gnunet.org/libmicrohttpd
-RUN git clone git://git.gnunet.org/gnunet
-RUN git clone git://git.taler.net/exchange /exchange
-RUN git clone git://git.taler.net/merchant /merchant
-RUN git clone git://git.taler.net/libeufin /libeufin
-RUN git clone git://git.taler.net/taler-merchant-demos /taler-merchant-demos
-RUN git clone git://git.taler.net/wallet-core /wallet-core
-RUN git clone git://git.taler.net/sync /sync
+ARG tags_file
+COPY ${tags_file:-taler_notags} /tags.sh
 
+RUN . /tags.sh && git clone git://git.gnunet.org/libmicrohttpd \
+  --branch ${TAG_LIBMHD:-master} --depth 1
+RUN . /tags.sh && git clone git://git.gnunet.org/gnunet \
+  --branch ${TAG_GNUNET:-master} --depth 1
+RUN . /tags.sh && git clone git://git.taler.net/exchange \
+  --branch ${TAG_EXCHANGE:-master} --depth 1
+RUN . /tags.sh && git clone git://git.taler.net/merchant \
+  --branch ${TAG_MERCHANT:-master} --depth 1
+RUN . /tags.sh && git clone git://git.taler.net/libeufin \
+  --branch ${TAG_LIBEUFIN:-master} --depth 1
+RUN . /tags.sh && git clone git://git.taler.net/taler-merchant-demos \
+  --branch ${TAG_MERCHANT_DEMOS:-master} --depth 1
+RUN . /tags.sh && git clone git://git.taler.net/wallet-core \
+  --branch ${TAG_WALLET:-master} --depth 1
+RUN . /tags.sh && git clone git://git.taler.net/sync \
+  --branch ${TAG_SYNC:-master} --depth 1
 
 WORKDIR /libmicrohttpd
 RUN ./bootstrap
@@ -70,6 +79,4 @@ RUN ./configure CFLAGS="-ggdb -O0" \
   --disable-doc
 RUN make install
 
-
-
 WORKDIR /
diff --git a/docker/demo/tags.env b/docker/demo/tags.env
new file mode 100644
index 0000000..93cf7e2
--- /dev/null
+++ b/docker/demo/tags.env
@@ -0,0 +1,5 @@
+TAG_EXCHANGE=v0.9.0
+TAG_MERCHANT=v0.9.0
+TAG_EXCHANGE=v0.9.0
+TAG_SYNC=v0.9.0
+TAG_WALLET=v0.9.0

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]