From: David NĂ©grier Date: Mon, 13 Apr 2020 13:07:04 +0000 (+0200) Subject: Deploying one environment per branch X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b5901b253acd9541d8ef0decbeb7e6778e9d366e;p=libreadventure.git Deploying one environment per branch --- diff --git a/deeployer.json b/deeployer.json deleted file mode 100644 index 930e6f3..0000000 --- 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 0000000..60c5d47 --- /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" + } + } + } +}