From 88ef310a9ade070fdc6b34f8a209f14b8079bd14 Mon Sep 17 00:00:00 2001 From: kjuulh Date: Sun, 14 Aug 2022 20:12:22 +0200 Subject: [PATCH] Added templates --- cuddle.yaml | 1 + scripts/deploy_release.sh | 5 ++++- ...y_release.yml => docker-compose.deploy_release.yml.tmpl} | 6 +++--- 3 files changed, 8 insertions(+), 4 deletions(-) rename templates/{docker-compose.deploy_release.yml => docker-compose.deploy_release.yml.tmpl} (80%) diff --git a/cuddle.yaml b/cuddle.yaml index e2f08b3..109c61e 100644 --- a/cuddle.yaml +++ b/cuddle.yaml @@ -3,6 +3,7 @@ base: "git@git.front.kjuulh.io:kjuulh/cuddle-base.git" vars: registry: "kasperhermansen" + port: "3000:3000" scripts: build_release: diff --git a/scripts/deploy_release.sh b/scripts/deploy_release.sh index b24118b..2464a1e 100755 --- a/scripts/deploy_release.sh +++ b/scripts/deploy_release.sh @@ -13,7 +13,10 @@ git clone "$DEPLOYMENTS" _deployments mkdir -p "_deployments/$SERVICE" -cp "$TMP/docker-compose.deploy_release.yml" "_deployments/$SERVICE/docker-compose.yml" +CUDDLE_FETCH_POLICY=never cuddle_cli render_template \ + --template-file docker-compose.deploy_release.yml.tmpl \ + --dest "_deployments/$SERVICE/docker-compose.yml" \ + --extra-var "image=$tag" cd _deployments diff --git a/templates/docker-compose.deploy_release.yml b/templates/docker-compose.deploy_release.yml.tmpl similarity index 80% rename from templates/docker-compose.deploy_release.yml rename to templates/docker-compose.deploy_release.yml.tmpl index b02167c..929fcf8 100644 --- a/templates/docker-compose.deploy_release.yml +++ b/templates/docker-compose.deploy_release.yml.tmpl @@ -1,10 +1,10 @@ version: '3.7' services: - {{.service}}: - image: {{.image}} + {{ service }}: + image: {{ image }} ports: - - {{.ports}} + - {{ port }} env_file: ".env" restart: always depends_on: