From e36a1f1ced70b22d3414ab3d9241adab73afdd3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Thu, 17 Feb 2022 15:04:51 +0100 Subject: [PATCH] Continuous Deployment: add connect to admin We can now connect to a remote admin server in the CD environment by using the new "deploy-connect-to-admin" label in the PR. --- .github/workflows/build-and-deploy.yml | 4 ++++ deeployer.libsonnet | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 9c91e0ca..bf8d4612 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -149,6 +149,10 @@ jobs: # Create a slugified value of the branch - uses: rlespinasse/github-slug-action@3.1.0 + - name: Set ADMIN_URL if "deploy-connect-to-admin" label is set + run: echo "ADMIN_API_URL=https://${{ github.event_name == 'pull_request' && env.GITHUB_HEAD_REF_SLUG || env.GITHUB_REF_SLUG }}.test.workadventu.re" >> $GITHUB_ENV + if: ${{ github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'deploy-connect-to-admin') }} + - name: Write certificate run: echo "${CERTS_PRIVATE_KEY}" > secret.key && chmod 0600 secret.key env: diff --git a/deeployer.libsonnet b/deeployer.libsonnet index 4012b186..72e6dd43 100644 --- a/deeployer.libsonnet +++ b/deeployer.libsonnet @@ -4,7 +4,7 @@ local tag = namespace, local url = namespace+".test.workadventu.re", // develop branch does not use admin because of issue with SSL certificate of admin as of now. - local adminUrl = if std.startsWith(namespace, "admin") then "https://"+url else null, + local adminUrl = if std.objectHas(env, 'ADMIN_API_URL') then env.ADMIN_API_URL else null, "$schema": "https://raw.githubusercontent.com/thecodingmachine/deeployer/master/deeployer.schema.json", "version": "1.0", "containers": {