taler-deployment

Deployment scripts and configuration files
Log | Files | Refs | README

commit 3f8dccd9dd97ee03624ddcf62260a949d22cec26
parent e1b8f9192b6a0f890f8df8a574cc352101a5dfca
Author: Florian Dold <florian.dold@gmail.com>
Date:   Fri, 11 Oct 2019 00:27:40 +0530

build subcommand

Diffstat:
Mbin/taler-deployment | 38++++++++++++++++++++++++++++++++++++--
1 file changed, 36 insertions(+), 2 deletions(-)

diff --git a/bin/taler-deployment b/bin/taler-deployment @@ -3,6 +3,7 @@ import click import types import os +import sys import os.path import subprocess import time @@ -21,7 +22,7 @@ function taler-exchange-keyup () {{ echo "Command disabled. Please use taler-deployment-keyup instead." }} -export PATH="$HOME/deployment/bin:$HOME/local/bin:\$PATH" +export PATH="$HOME/deployment/bin:$HOME/local/bin:{curr_path}" export TALER_BOOTSTRAP_TIMESTAMP={timestamp} export TALER_CHECKDB="postgres:///talercheck-$USER" export TALER_CONFIG_CURRENCY={currency} @@ -45,6 +46,36 @@ def cli(): currmap = {"test": "TESTKUDOS", "demo": "KUDOS", "int": "INTKUDOS"} +def ensure_activated(): + """Make sure that the environment variables have been + loaded correctly via the ~/activate script""" + ts = os.environ.get("TALER_BOOTSTRAP_TIMESTAMP") + if ts is None: + print("Please do 'source ~/.activate' first.", file=sys.stderr) + sys.exit(1) + out = subprocess.check_output( + ["bash", "-c", "source ~/activate; echo $TALER_BOOTSTRAP_TIMESTAMP"] + ) + out = out.strip(" \n") + if out != ts: + print( + f"Please do 'source ~/.activate'. Current ts={ts}, new ts={out}", + file=sys.stderr, + ) + sys.exit(1) + + +@cli.command +def build(): + """Build the deployment from source.""" + ensure_activated() + os.chdir((Path.home() / "deployment" / "taler-build").as_posix()) + subprocess.run(["./invalidate.sh"], check=True) + subenv = os.environ.copy() + subenv["GNUNET_FORCE_LOG"] = "util;;;;WARNING/taler;;;;DEBUG/twister;;;;DEBUG/test;;;;DEBUG" + subprocess.run(["make"], check=True, env=subenv) + + @cli.command() @click.argument("envname", type=click.Choice(["test", "int", "demo"])) def bootstrap(envname): @@ -90,7 +121,10 @@ def bootstrap(envname): with (home / "activate").open("w") as f: f.write( activate_template.format( - envname=envname, timestamp=str(time.time()), currency=currmap[envname] + envname=envname, + timestamp=str(time.time()), + currency=currmap[envname], + curr_path=os.environ["PATH"], ) )