Skip to content

Commit

Permalink
Update pipeline remove deprecated compose version (#273)
Browse files Browse the repository at this point in the history
Co-authored-by: daniele <[email protected]>
  • Loading branch information
daniele-20tab and daniele authored May 7, 2024
1 parent ae140de commit 935ee62
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 7 additions & 5 deletions {{cookiecutter.project_dirname}}/.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ image:
services:
- docker:20-dind

.terraform:
.terraform:{% if cookiecutter.use_vault == "true" %}
id_tokens:
VAULT_ID_TOKEN:
aud: ${VAULT_ADDR}{% endif %}
script:
- >
docker run --rm
Expand All @@ -29,16 +32,14 @@ services:
-w ${PWD}{% if cookiecutter.terraform_backend == "gitlab" %}
-e CI_API_V4_URL
-e CI_COMMIT_SHA
-e CI_JOB_ID{% if cookiecutter.use_vault == "true" %}
-e CI_JOB_JWT_V2{% endif %}
-e CI_JOB_ID
-e CI_JOB_STAGE
-e CI_JOB_TOKEN
-e CI_PROJECT_ID
-e CI_PROJECT_NAME
-e CI_PROJECT_NAMESPACE
-e CI_PROJECT_PATH
-e CI_PROJECT_URL{% elif cookiecutter.use_vault == "true" %}
-e CI_JOB_JWT_V2{% endif %}
-e CI_PROJECT_URL
-e ENV_SLUG
-e PROJECT_DIR=${CI_PROJECT_DIR}
-e PROJECT_SLUG={{ cookiecutter.project_slug }}
Expand Down Expand Up @@ -67,6 +68,7 @@ services:
-e TF_WORKSPACE{% endif %}{% if cookiecutter.terraform_backend == "terraform-cloud" and cookiecutter.use_vault == "false" %}
-e TFC_TOKEN{% endif %}{% if cookiecutter.use_vault == "true" %}
-e VAULT_ADDR
-e VAULT_ID_TOKEN
-e VAULT_ROLE
-e VAULT_SECRETS
-e VAULT_SECRETS_PREFIX
Expand Down
2 changes: 0 additions & 2 deletions {{cookiecutter.project_dirname}}/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.9"

services:
{% if cookiecutter.backend_type != "none" %}
{{ cookiecutter.backend_service_slug }}:
Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.project_dirname}}/scripts/deploy/vault.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

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)
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)

secrets_data="{}"

Expand Down

0 comments on commit 935ee62

Please sign in to comment.