Skip to content

Commit

Permalink
docs(gitlab): add comments to gitlab example
Browse files Browse the repository at this point in the history
  • Loading branch information
FalcoSuessgott authored Nov 16, 2023
1 parent ff56ae7 commit 3c9eb81
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions docs/10_advanced_examples/gitlab.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@ Gitlab-CI Example for reading Secrets from Vault using vkv

```yaml
variables:
VKV_VERSION: "0.4.0"
# vaults env vars
# all of vault env vars are supported (https://developer.hashicorp.com/vault/docs/commands#environment-variables)
# required:
VAULT_ADDR: ""

# optional
VAULT_NAMESPACE: ""
VAULT_TLS_SKIP_VERIFY: "true"

# vkv env vars
VKV_VERSION: "0.4.0" # https://github.com/FalcoSuessgott/vkv/releases/tag/v0.4.0
VKV_EXPORT_PATH: "secrets"
VKV_EXPORT_FORMAT: "export"

Expand All @@ -19,7 +29,7 @@ default:
- curl -LO "https://github.com/FalcoSuessgott/vkv/releases/download/v${VKV_VERSION}/vkv_${VKV_VERSION}_linux_amd64.apk"
# install vkv
- apk add --allow-untrusted ./vkv_${VKV_VERSION}_linux_amd64.apk
# auth to vault (requires jwt auth configuration)
# auth to vault (requires jwt auth configuration, https://docs.gitlab.com/ee/ci/examples/authenticating-with-hashicorp-vault/)
- export VAULT_TOKEN="$(vault write -field=token auth/jwt/login role="${CI_PROJECT_ROOT_NAMESPACE}" jwt="${VAULT_JWT_TOKEN}")"
# source env vars into shell
- eval $(vkv export)
Expand Down

0 comments on commit 3c9eb81

Please sign in to comment.