gnunet-svn
[Top][All Lists]
Advanced

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

[taler-deployment] branch master updated: ensure default instance helper


From: gnunet
Subject: [taler-deployment] branch master updated: ensure default instance helper function
Date: Tue, 25 May 2021 13:45:58 +0200

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 a357d8f  ensure default instance helper function
a357d8f is described below

commit a357d8f39f48a991296eaac3bba9f828f3a5eb10
Author: MS <ms@taler.net>
AuthorDate: Tue May 25 13:45:50 2021 +0200

    ensure default instance helper function
---
 bin/taler-deployment-config-instances | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/bin/taler-deployment-config-instances 
b/bin/taler-deployment-config-instances
index d0e129d..83ce134 100755
--- a/bin/taler-deployment-config-instances
+++ b/bin/taler-deployment-config-instances
@@ -12,6 +12,7 @@ import requests
 from os import environ, system
 from sys import exit
 from urllib.parse import urljoin
+from subprocess import Popen
 
 def expect_env(name):
     val = environ.get(name)
@@ -27,10 +28,6 @@ TALER_CONFIG_CURRENCY = expect_env("TALER_CONFIG_CURRENCY")
 TALER_ENV_FRONTENDS_APITOKEN = expect_env("TALER_ENV_FRONTENDS_APITOKEN")
 authorization_header = {"Authorization": f"Bearer 
{TALER_ENV_FRONTENDS_APITOKEN}"}
 
-
-def ensure_default_instance():
-    system("taler-deployment-arm -k taler-merchant")
-
 def ensure_instance(instance_id, name, payto_uris, auth):
     # FIXME: Use auth once the default instance also uses token auth
     instance_response = requests.get(
@@ -75,6 +72,21 @@ def ensure_instance(instance_id, name, payto_uris, auth):
         else:
             exit(1)
 
+def ensure_default_instance():
+    system("taler-deployment-arm -k taler-merchant")
+    env_with_token = os.environ.copy()
+    env_with_token["TALER_MERCHANT_TOKEN"] = TALER_ENV_FRONTENDS_APITOKEN
+    merchant = Popen(["taler-merchant-httpd"], env=env_with_token)
+    ensure_instance(
+        "default", 
+        "default",
+        
payto_uris=[f"payto://x-taler-bank/bank.{TALER_ENV_NAME}.taler.net/Taler"],
+        auth=dict(method="token", token="secret-token:sandbox")
+    )
+    merchant.terminate()
+    merchant.wait()
+    system("taler-deployment-arm -i taler-merchant")
+
 ensure_default_instance()
 
 ensure_instance(
@@ -135,3 +147,5 @@ ensure_instance(
     
payto_uris=[f"payto://x-taler-bank/bank.{TALER_ENV_NAME}.taler.net/Tutorial"],
     auth=dict(method="token", token="secret-token:sandbox")
 )
+
+

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