gnunet-svn
[Top][All Lists]
Advanced

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

[taler-deployment] branch master updated (98fbb52 -> 688e1e1)


From: gnunet
Subject: [taler-deployment] branch master updated (98fbb52 -> 688e1e1)
Date: Fri, 15 Sep 2023 11:41:07 +0200

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

javier-sepulveda pushed a change to branch master
in repository deployment.

    from 98fbb52  force gcc-12
     new b62a018  Improve base image Dockerfile to compile ALL programs 
contained in the folder --packages of the walle-core.git repository.
     new 275d1ea  fund-rewards.sh script added to the --new folder:  utils
     new 688e1e1  Modify base Dockerfile to copy Rewards script 
(fund-rewards.sh) to root directory / of all containers

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 sandcastle/images/base/Dockerfile | 26 +++++++++++----
 sandcastle/utils/fund-rewards.sh  | 67 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 87 insertions(+), 6 deletions(-)
 create mode 100755 sandcastle/utils/fund-rewards.sh

diff --git a/sandcastle/images/base/Dockerfile 
b/sandcastle/images/base/Dockerfile
index 78ef5e5..90e4db5 100644
--- a/sandcastle/images/base/Dockerfile
+++ b/sandcastle/images/base/Dockerfile
@@ -48,6 +48,8 @@ RUN apt-get install -y \
 # a venv or per-user installation of the package.
 RUN pip3 install --break-system-packages requests click poetry uwsgi htmlark
 
+# Libmicro httpd
+
 WORKDIR /
 COPY buildconfig/libmhd.tag /buildconfig/
 RUN TAG=$(cat /buildconfig/libmhd.tag) && \
@@ -59,6 +61,8 @@ RUN ./configure --disable-doc
 RUN make install
 WORKDIR /
 
+# Gnunet
+
 COPY buildconfig/gnunet.tag /buildconfig/
 WORKDIR /
 RUN TAG=$(cat /buildconfig/gnunet.tag) && \
@@ -70,6 +74,8 @@ RUN ./configure --enable-logging=verbose 
--disable-documentation
 RUN make install
 WORKDIR /
 
+# Exchange
+
 WORKDIR /
 COPY buildconfig/exchange.tag /buildconfig/
 RUN TAG=$(cat /buildconfig/exchange.tag) && \
@@ -81,6 +87,8 @@ RUN ./configure CFLAGS="-ggdb -O0" --enable-logging=verbose 
--disable-doc
 RUN make install
 WORKDIR /
 
+# Merchant
+
 WORKDIR /
 COPY buildconfig/merchant.tag /buildconfig/
 RUN TAG=$(cat /buildconfig/merchant.tag) && \
@@ -94,6 +102,8 @@ RUN ./configure CFLAGS="-ggdb -O0" \
 RUN make install
 WORKDIR /
 
+# Libeufin
+
 WORKDIR /
 COPY buildconfig/libeufin.tag /buildconfig/
 RUN TAG=$(cat buildconfig/libeufin.tag) && \
@@ -105,6 +115,8 @@ RUN ./configure
 RUN make install
 WORKDIR /
 
+# Merchant demos
+
 WORKDIR /
 COPY buildconfig/merchant-demos.tag /buildconfig/
 RUN TAG=$(cat buildconfig/merchant-demos.tag) && \
@@ -116,6 +128,8 @@ RUN ./configure
 RUN make install
 WORKDIR /
 
+# Wallet
+
 WORKDIR /
 COPY buildconfig/wallet.tag /buildconfig/
 RUN TAG=$(cat /buildconfig/wallet.tag) && \
@@ -124,14 +138,10 @@ RUN TAG=$(cat /buildconfig/wallet.tag) && \
 RUN npm install -g pnpm@^8.0.0
 WORKDIR /wallet-core
 RUN ./bootstrap
-WORKDIR ./packages/demobank-ui
 RUN ./configure
 RUN make install
-# Install CLI to provide integration tests.
-WORKDIR ../taler-wallet-cli
-RUN ./configure
-RUN make install
-WORKDIR /
+
+# Sync
 
 COPY buildconfig/sync.tag /buildconfig/
 WORKDIR /
@@ -145,3 +155,7 @@ RUN ./configure CFLAGS="-ggdb -O0" \
   --disable-doc
 RUN make install
 WORKDIR /
+
+# Copy utils/fund-rewards.sh script to the base image
+
+COPY utils/fund-rewards.sh /
diff --git a/sandcastle/utils/fund-rewards.sh b/sandcastle/utils/fund-rewards.sh
new file mode 100755
index 0000000..cf09723
--- /dev/null
+++ b/sandcastle/utils/fund-rewards.sh
@@ -0,0 +1,67 @@
+#!/bin/bash
+
+# This file is in the public domain.
+
+set -eu
+
+# Maybe add these to base Dockerfile as ENV?
+
+export LD_LIBRARY_PATH=/usr/local/lib
+export GNUNET_FORCE_LOG=";;;;WARNING"
+
+# Configuration variables - Please change to your needs
+
+DOMAIN="demo.taler.net"
+
+# Program variables - No need to be changed by the user.
+
+MERCHANT_URL="https://backend.${DOMAIN}/";
+MERCHANT_APIKEY=$(taler-config -c /config/deployment.conf -s taler-deployment 
-o merchant-apikey)
+BANK_ACCESS_URL="https://bank.${DOMAIN}/demobanks/default/access-api/";
+WIRE_METHOD="iban"
+AMOUNT="100" # Amount to add, on each new reserve (tiptopup option)
+BANK_ACCOUNT="survey-at-sandbox"
+BANK_PASSWORD="secret-at-sandbox"
+#BANK_PASSWORD=$(taler-config -c /config/deployment.conf -s taler-deployment 
-o db-password)
+EXCHANGE_URL=$(taler-config -c /config/deployment.conf -s taler-deployment -o 
default-exchange)
+EXCHANGE_URL="https://exchange.${DOMAIN}/";
+# shellcheck disable=SC2034
+CURRENCY=$(taler-config -c /config/deployment.conf -s taler-deployment -o 
currency)
+
+# Obtain current reserves in json format
+# Just one single call to the taler-harness program to avoid inconsistencies
+
+JSON=$(taler-harness deployment tip-status \
+       --merchant-url "$MERCHANT_URL" \
+       --merchant-apikey "$MERCHANT_APIKEY")
+
+# Calculate remaining funds
+
+ACTIVE_FUNDS=$(echo "$JSON" | jq '[.reserves[] | select(.active)]')
+TOTAL_EXCHANGE_INITIAL_AMOUNT=$(echo "$ACTIVE_FUNDS" | jq --arg cur 
"$CURRENCY" '[.[].exchange_initial_amount | sub($cur + ":"; "") | tonumber] | 
add')
+TOTAL_PICKUP_AMOUNT=$(echo "$ACTIVE_FUNDS" | jq --arg cur "$CURRENCY" 
'[.[].pickup_amount | sub($cur + ":"; "") | tonumber] | add')
+TOTAL_RESERVE_AMOUNT=$((TOTAL_EXCHANGE_INITIAL_AMOUNT - TOTAL_PICKUP_AMOUNT))
+
+# Decide whether add a new reserve, or leave it as is.
+
+if [ "$TOTAL_RESERVE_AMOUNT" -lt 100 ]; then
+       # Add new reserve amount  of 100 units
+       taler-harness deployment tip-topup \
+               --merchant-url "$MERCHANT_URL" \
+               --merchant-apikey="$MERCHANT_APIKEY" \
+               --bank-access-url "$BANK_ACCESS_URL" \
+               --wire-method="$WIRE_METHOD" \
+               --amount=KUDOS:"$AMOUNT" \
+               --bank-account="$BANK_ACCOUNT" \
+               --bank-password="$BANK_PASSWORD" \
+               --exchange-url "$EXCHANGE_URL"
+fi
+
+# If the json variable contains more than 100 records, wipe its content
+
+TOTAL_JSON_RECORDS=$(echo "$JSON" | jq '.[] | length')
+
+if [ "$TOTAL_JSON_RECORDS" -gt 100 ]; then
+       taler-harness deployment tip-cleanup --merchant-url "$BACKEND_URL"
+fi
+

-- 
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]