Skip to content

Commit

Permalink
Use VAULT_ID_TOKEN to authenticate pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
michele-brambilla committed Apr 22, 2024
1 parent bb4aadb commit 733987e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ get_credentials:
tags:
- Fulen
- K8s
id_tokens:
VAULT_ID_TOKEN:
aud: https://git.cscs.ch
script:
- export VAULT_TOKEN="$(vault write -field=token auth/jwt/login role=iam jwt=$CI_JOB_JWT)"
- export VAULT_TOKEN="$(vault write -field=token auth/jwt_idtoken/login role=iam jwt=$VAULT_ID_TOKEN)"
- if [[ ${#VAULT_TOKEN} -lt 3 ]]; then echo "ERROR, Vault token empty"; exit 1; fi
- export JFROG_USER="$(vault kv get -field=JFROG_USER $VAULT_PATH)"
- export JFROG_TOKEN="$(vault kv get -field=JFROG_TOKEN $VAULT_PATH)"
Expand Down

0 comments on commit 733987e

Please sign in to comment.