From 23513bbde7f0e16d6486f54ec5f8132245591aa8 Mon Sep 17 00:00:00 2001 From: Zeger-Jan van de Weg Date: Wed, 24 Feb 2021 12:13:05 +0100 Subject: [PATCH] gitlab-ci: Update postgres connection details Docker links the containers differently than was priorly assumed for GitLab CI. As such the out-of-the-box settings weren't properly working. This change resolves that in the CI YAML definitions to isolate the changes from local setups. --- genny/ci/templates/-dot-gitlab-ci.yml.tmpl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/genny/ci/templates/-dot-gitlab-ci.yml.tmpl b/genny/ci/templates/-dot-gitlab-ci.yml.tmpl index c4abebaf6..6e8f70f27 100644 --- a/genny/ci/templates/-dot-gitlab-ci.yml.tmpl +++ b/genny/ci/templates/-dot-gitlab-ci.yml.tmpl @@ -16,11 +16,15 @@ stages: GO_ENV: "test" {{- if eq .opts.DBType "postgres" }} POSTGRES_DB: "{{.opts.App.Name.File}}_test" + POSTGRES_USER: runner + POSTGRES_PASSSWORD: "" + POSTGRES_HOST_AUTH_METHOD: trust + TEST_DATABASE_URL: "postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?sslmode=disable" {{- else if eq .opts.DBType "mysql" }} MYSQL_DATABASE: "{{.opts.App.Name.File}}_test" MYSQL_ROOT_PASSWORD: "root" -{{- end }} TEST_DATABASE_URL: "{{.testDbUrl}}" +{{- end }} # Golang version choice helper .use-golang-image: &use-golang-latest