From b81969ab3f9d8d07bf106ad7b0ebf4ab7e8bd8eb Mon Sep 17 00:00:00 2001 From: Emma Date: Thu, 22 Aug 2024 09:53:50 +0100 Subject: [PATCH] added proxy test script --- .github/workflows/build_proxy.yml | 2 ++ proxy/docker/test | 17 ++++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) mode change 100644 => 100755 proxy/docker/test diff --git a/.github/workflows/build_proxy.yml b/.github/workflows/build_proxy.yml index f945240..f1dcb27 100644 --- a/.github/workflows/build_proxy.yml +++ b/.github/workflows/build_proxy.yml @@ -26,5 +26,7 @@ jobs: run: ./proxy/docker/build - name: Push SHA run: ./proxy/docker/push + - name: Test container + run: ./proxy/docker/test - name: Push branch tag run: ./proxy/docker/push-branch-tag diff --git a/proxy/docker/test b/proxy/docker/test old mode 100644 new mode 100755 index ef31336..0dc8c3a --- a/proxy/docker/test +++ b/proxy/docker/test @@ -12,14 +12,21 @@ docker network create daedalus # TODO: update branch when merged WEB_APP_TAG=$REGISTRY/$ORG/daedalus-web-app:jidea-59-dockerise-web-app -docker run -d --run \ +docker run -d \ --name daedalus-web-app \ --network=daedalus \ + -e DATABASE_URL=postgresql://daedalus-web-app-user:changeme@not-a-db:5432/daedalus-web-app \ $WEB_APP_TAG - -docker run -d --rm \ +docker run -d \ --name daedalus-proxy \ --network=daedalus \ - $TAG-SHA \ - localhost daedalus-proxy http://daedalus-web-app:3000 \ No newline at end of file + -p 443:443 \ + $TAG_SHA \ + localhost daedalus-proxy http://daedalus-web-app:3000 + +docker exec daedalus-proxy /usr/local/bin/build-self-signed-certificate /run/proxy GB London IC jameel-institute localhost + +sleep 1 +docker logs daedalus-proxy | 2>&1 grep "Certificate files detected. Running nginxx." || (echo "Expected output not found"; exit 1) +echo "Expected output was found" \ No newline at end of file