From f9171b65c53c5e7b0c7fe9153e7b1a82ccba2701 Mon Sep 17 00:00:00 2001 From: pedro Date: Thu, 29 Feb 2024 18:18:40 +0100 Subject: [PATCH] add instance autotest-pair --- README.md | 5 ++ build__common.sh | 2 +- build__instance-autotest-pair.sh | 27 ++++++++ docker-compose__instance-autotest-pair.yml | 78 ++++++++++++++++++++++ 4 files changed, 111 insertions(+), 1 deletion(-) create mode 100755 build__instance-autotest-pair.sh create mode 100644 docker-compose__instance-autotest-pair.yml diff --git a/README.md b/README.md index 3008e0f..5a315fe 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,11 @@ - **autotest**: - Instance: https://idhub-autotest.demo.pangea.org - Motivation: regenerated on each commit in main, intended for automated and fast testing +- **autotest-pair**: + - Instances: + - https://idhub1-autotest.demo.pangea.org + - https://idhub2-autotest.demo.pangea.org + - Motivation: regenerated on each commit in main, intended for automated and fast testing. For testing that requires two instances - **nightly**: - Instance: https://idhub-nightly.demo.pangea.org - Motivation: regenerated on each day at 4:00 AM diff --git a/build__common.sh b/build__common.sh index 3fa30c8..9d5af7e 100644 --- a/build__common.sh +++ b/build__common.sh @@ -6,7 +6,7 @@ set -u #set -x common_start() { - figlet -w 100 "${target}" + figlet -w 120 "${target}" deployment="${1:-${deployment:-}}" action="${action:-deploy}" diff --git a/build__instance-autotest-pair.sh b/build__instance-autotest-pair.sh new file mode 100755 index 0000000..c18c497 --- /dev/null +++ b/build__instance-autotest-pair.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +set -e +set -u +# DEBUG +set -x + +main() { + cd "$(dirname "${0}")" + + # includes functions: + # common_start + # common_end + . ./build__common.sh + + # vars used in common_start and end + target='instance-autotest-pair' + persistence='n' + idhubs='idhub1 idhub2' + idhub_branch='release' + + common_start + + common_end +} + +main "${@}" diff --git a/docker-compose__instance-autotest-pair.yml b/docker-compose__instance-autotest-pair.yml new file mode 100644 index 0000000..cdbd632 --- /dev/null +++ b/docker-compose__instance-autotest-pair.yml @@ -0,0 +1,78 @@ +version: "3.9" +services: + + idhub1: + init: true + image: dkr-dsg.ac.upc.edu/trustchain-oc1-orchestral/idhub:latest + environment: + - DEBUG=true + - ADMIN_EMAIL=${IDHUB_PILOT_TEST__ADMIN_EMAIL} + - CREATE_TEST_USERS=true + - ENABLE_EMAIL=false + - ENABLE_2FACTOR_AUTH=false + - SECRET_KEY=${IDHUB_SECRET_KEY:-publicsecretisnotsecureVtmKBfxpVV47PpBCF2Nzz2H6qnbd} + - ALLOWED_HOSTS=${IDHUB_ALLOWED_HOSTS:-*} + - STATIC_ROOT=${IDHUB_STATIC_ROOT:-/static/} + - MEDIA_ROOT=${IDHUB_MEDIA_ROOT:-/media/} + - PORT=${IDHUB_PORT:-9001} + - DJANGO_SUPERUSER_USERNAME=${IDHUB_USER} + - DJANGO_SUPERUSER_PASSWORD=${IDHUB_PASSWD} + - DJANGO_SUPERUSER_EMAIL=${IDHUB_EMAIL} + - DOMAIN=https://idhub1-autotest.demo.pangea.org + - CSRF_TRUSTED_ORIGINS=https://idhub1-autotest.demo.pangea.org + - DEFAULT_FROM_EMAIL=${IDHUB_DEFAULT_FROM_EMAIL} + - EMAIL_HOST=${IDHUB_EMAIL_HOST} + - EMAIL_HOST_USER=${IDHUB_EMAIL_HOST_USER} + - EMAIL_HOST_PASSWORD=${IDHUB_EMAIL_HOST_PASSWORD} + - EMAIL_PORT=${IDHUB_EMAIL_PORT} + - EMAIL_USE_TLS=${IDHUB_EMAIL_USE_TLS} + - EMAIL_BACKEND=${IDHUB_EMAIL_BACKEND} + - RESPONSE_URI=https://idhub1-autotest.demo.pangea.org/oidc4vp/ + - ALLOW_CODE_URI=https://idhub1-autotest.demo.pangea.org/oidc4vp/allow_code + - SUPPORTED_CREDENTIALS=['CourseCredential', 'EOperatorClaim', 'FederationMembership', 'FinancialVulnerabilityCredential', 'MembershipCard'] + - SYNC_ORG_DEV=${IDHUB_SYNC_ORG_DEV} + - ORG_FILE=examples/organizations__instance_autotest-pair.csv + ports: + - 9071:9001 + volumes: + - ./idhub1__instance-autotest-pair:/opt/idhub + - sharedsecret:/sharedsecret:rw + idhub2: + init: true + image: dkr-dsg.ac.upc.edu/trustchain-oc1-orchestral/idhub:latest + environment: + - DEBUG=true + - ADMIN_EMAIL=${IDHUB_PILOT_TEST__ADMIN_EMAIL} + - CREATE_TEST_USERS=true + - ENABLE_EMAIL=false + - ENABLE_2FACTOR_AUTH=false + - SECRET_KEY=${IDHUB_SECRET_KEY:-publicsecretisnotsecureVtmKBfxpVV47PpBCF2Nzz2H6qnbd} + - ALLOWED_HOSTS=${IDHUB_ALLOWED_HOSTS:-*} + - STATIC_ROOT=${IDHUB_STATIC_ROOT:-/static/} + - MEDIA_ROOT=${IDHUB_MEDIA_ROOT:-/media/} + - PORT=${IDHUB_PORT:-9001} + - DJANGO_SUPERUSER_USERNAME=${IDHUB_USER} + - DJANGO_SUPERUSER_PASSWORD=${IDHUB_PASSWD} + - DJANGO_SUPERUSER_EMAIL=${IDHUB_EMAIL} + - DOMAIN=https://idhub2-autotest.demo.pangea.org + - CSRF_TRUSTED_ORIGINS=https://idhub2-autotest.demo.pangea.org + - DEFAULT_FROM_EMAIL=${IDHUB_DEFAULT_FROM_EMAIL} + - EMAIL_HOST=${IDHUB_EMAIL_HOST} + - EMAIL_HOST_USER=${IDHUB_EMAIL_HOST_USER} + - EMAIL_HOST_PASSWORD=${IDHUB_EMAIL_HOST_PASSWORD} + - EMAIL_PORT=${IDHUB_EMAIL_PORT} + - EMAIL_USE_TLS=${IDHUB_EMAIL_USE_TLS} + - EMAIL_BACKEND=${IDHUB_EMAIL_BACKEND} + - RESPONSE_URI=https://idhub2-autotest.demo.pangea.org/oidc4vp/ + - ALLOW_CODE_URI=https://idhub2-autotest.demo.pangea.org/oidc4vp/allow_code + - SUPPORTED_CREDENTIALS=['CourseCredential', 'EOperatorClaim', 'FederationMembership', 'FinancialVulnerabilityCredential', 'MembershipCard'] + - SYNC_ORG_DEV=${IDHUB_SYNC_ORG_DEV} + - ORG_FILE=examples/organizations__instance_autotest-pair.csv + ports: + - 9072:9001 + volumes: + - ./idhub2__instance-autotest-pair:/opt/idhub + - sharedsecret:/sharedsecret:rw + +volumes: + sharedsecret: