Skip to content

Commit 935ee62

Browse files
daniele-20tabdaniele
andauthored
Update pipeline remove deprecated compose version (#273)
Co-authored-by: daniele <daniele.pompa@20tab.com>
1 parent ae140de commit 935ee62

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

{{cookiecutter.project_dirname}}/.gitlab-ci.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ image:
2020
services:
2121
- docker:20-dind
2222

23-
.terraform:
23+
.terraform:{% if cookiecutter.use_vault == "true" %}
24+
id_tokens:
25+
VAULT_ID_TOKEN:
26+
aud: ${VAULT_ADDR}{% endif %}
2427
script:
2528
- >
2629
docker run --rm
@@ -29,16 +32,14 @@ services:
2932
-w ${PWD}{% if cookiecutter.terraform_backend == "gitlab" %}
3033
-e CI_API_V4_URL
3134
-e CI_COMMIT_SHA
32-
-e CI_JOB_ID{% if cookiecutter.use_vault == "true" %}
33-
-e CI_JOB_JWT_V2{% endif %}
35+
-e CI_JOB_ID
3436
-e CI_JOB_STAGE
3537
-e CI_JOB_TOKEN
3638
-e CI_PROJECT_ID
3739
-e CI_PROJECT_NAME
3840
-e CI_PROJECT_NAMESPACE
3941
-e CI_PROJECT_PATH
40-
-e CI_PROJECT_URL{% elif cookiecutter.use_vault == "true" %}
41-
-e CI_JOB_JWT_V2{% endif %}
42+
-e CI_PROJECT_URL
4243
-e ENV_SLUG
4344
-e PROJECT_DIR=${CI_PROJECT_DIR}
4445
-e PROJECT_SLUG={{ cookiecutter.project_slug }}
@@ -67,6 +68,7 @@ services:
6768
-e TF_WORKSPACE{% endif %}{% if cookiecutter.terraform_backend == "terraform-cloud" and cookiecutter.use_vault == "false" %}
6869
-e TFC_TOKEN{% endif %}{% if cookiecutter.use_vault == "true" %}
6970
-e VAULT_ADDR
71+
-e VAULT_ID_TOKEN
7072
-e VAULT_ROLE
7173
-e VAULT_SECRETS
7274
-e VAULT_SECRETS_PREFIX

{{cookiecutter.project_dirname}}/docker-compose.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: "3.9"
2-
31
services:
42
{% if cookiecutter.backend_type != "none" %}
53
{{ cookiecutter.backend_service_slug }}:

{{cookiecutter.project_dirname}}/scripts/deploy/vault.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -e
44

5-
vault_token=$(curl --silent --request POST --data "role=${VAULT_ROLE}" --data "jwt=${CI_JOB_JWT_V2}" "${VAULT_ADDR%/}"/v1/auth/gitlab-jwt/login | jq -r .auth.client_token)
5+
vault_token=$(curl --silent --request POST --data "role=${VAULT_ROLE}" --data "jwt=${VAULT_ID_TOKEN}" "${VAULT_ADDR%/}"/v1/auth/gitlab-jwt/login | jq -r .auth.client_token)
66

77
secrets_data="{}"
88

0 commit comments

Comments
 (0)