From 2cd782368d6e9c29d810d05e05242eee78578691 Mon Sep 17 00:00:00 2001 From: pedro Date: Thu, 25 Jan 2024 15:13:08 +0100 Subject: [PATCH] add new pilot test --- .gitignore | 1 + build__all.sh | 1 + build__common.sh | 4 ++-- build__pilot-test.sh | 29 +++++++++++++++++++++++++++++ docker-compose__pilot-test.yml | 30 ++++++++++++++++++++++++++++++ 5 files changed, 63 insertions(+), 2 deletions(-) create mode 100755 build__pilot-test.sh create mode 100644 docker-compose__pilot-test.yml diff --git a/.gitignore b/.gitignore index e0ff752..5166802 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ ssikit_trustchain idhub1__* idhub2__* +idhub1__* diff --git a/build__all.sh b/build__all.sh index 2dcbd69..4ba0bca 100755 --- a/build__all.sh +++ b/build__all.sh @@ -14,6 +14,7 @@ main() { ./build__pilot-setem.sh ./build__pilot-lafede.sh ./build__pilot-pangea.sh + ./build__pilot-test.sh } main "${@}" diff --git a/build__common.sh b/build__common.sh index 5a12579..f68b4b5 100644 --- a/build__common.sh +++ b/build__common.sh @@ -27,8 +27,8 @@ common_start() { ) # some pilots might use idhub1 and/or idhub2 - idhub1="idhub1__${pilot}" - idhub2="idhub2__${pilot}" + idhub1="${idhub1:-idhub1__${pilot}}" + idhub2="${idhub2:-idhub2__${pilot}}" # force recreate rm -rf "./${idhub1}" "./${idhub2}" diff --git a/build__pilot-test.sh b/build__pilot-test.sh new file mode 100755 index 0000000..9676ace --- /dev/null +++ b/build__pilot-test.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +set -e +set -u +# DEBUG +set -x + +main() { + # includes functions: + # common_start + # common_end + . ./build__common.sh + + pilot='pilot-test' + + idhub1="idhub__${pilot}" + common_start + + # detect if is new + if [ ! -f "./${idhub1}" ]; then + echo 'Detected new deployment, recreating idhub git repo' + cp -rp IdHub "${idhub1}" + rm -f "${idhub1}/db.sqlite3" + fi + + common_end +} + +main "${@}" diff --git a/docker-compose__pilot-test.yml b/docker-compose__pilot-test.yml new file mode 100644 index 0000000..e92c4de --- /dev/null +++ b/docker-compose__pilot-test.yml @@ -0,0 +1,30 @@ +version: "3.9" +services: + + idhub: + init: true + image: dkr-dsg.ac.upc.edu/trustchain-oc1-orchestral/idhub:latest + environment: + - DEPLOYMENT=${IDHUB_DEPLOYMENT} + - 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://idhub.demo.pangea.org + - CSRF_TRUSTED_ORIGINS=https://idhub.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} + - SUPPORTED_CREDENTIALS=['FederationMembership', 'CourseCredential'] + ports: + - 9021:9001 + volumes: + - ./idhub__pilot-test:/opt/idhub