Deploying one environment per branch

This commit is contained in:
David Négrier 2020-04-13 15:07:04 +02:00
parent 1c833f6114
commit b5901b253a
2 changed files with 24 additions and 21 deletions

View File

@ -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"
}
}
}
}

24
deeployer.libsonnet Normal file
View File

@ -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"
}
}
}
}