From b5901b253acd9541d8ef0decbeb7e6778e9d366e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Mon, 13 Apr 2020 15:07:04 +0200 Subject: [PATCH] Deploying one environment per branch --- deeployer.json | 21 --------------------- deeployer.libsonnet | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 21 deletions(-) delete mode 100644 deeployer.json create mode 100644 deeployer.libsonnet diff --git a/deeployer.json b/deeployer.json deleted file mode 100644 index 930e6f37..00000000 --- a/deeployer.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/thecodingmachine/deeployer/master/deeployer.schema.json", - "containers": { - "back": { - "image": "thecodingmachine/workadventure-back:cd", - "host": "api.workadventure.test.thecodingmachine.com", - "ports": [8080], - "env": { - "SECRET_KEY": "tempSecretKeyNeedsToChange" - } - }, - "front": { - "image": "thecodingmachine/workadventure-front:cd", - "host": "workadventure.test.thecodingmachine.com", - "ports": [80], - "env": { - "API_URL": "http://api.workadventure.test.thecodingmachine.com" - } - } - } -} diff --git a/deeployer.libsonnet b/deeployer.libsonnet new file mode 100644 index 00000000..60c5d470 --- /dev/null +++ b/deeployer.libsonnet @@ -0,0 +1,24 @@ +{ + local env = std.extVar("env"), + # FIXME: namespace does not work if the branch contains a "/" + local namespace = std.split(env.GITHUB_REF, "/")[2] + "$schema": "https://raw.githubusercontent.com/thecodingmachine/deeployer/master/deeployer.schema.json", + "containers": { + "back": { + "image": "thecodingmachine/workadventure-back:"+namespace, + "host": "api."+namespace+".workadventure.test.thecodingmachine.com", + "ports": [8080], + "env": { + "SECRET_KEY": "tempSecretKeyNeedsToChange" + } + }, + "front": { + "image": "thecodingmachine/workadventure-front:"+namespace, + "host": namespace+".workadventure.test.thecodingmachine.com", + "ports": [80], + "env": { + "API_URL": "http://api."+namespace+".workadventure.test.thecodingmachine.com" + } + } + } +}