Fix: use awk instead of jq/python
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
ac4ac36360
commit
903ad98289
1 changed files with 2 additions and 2 deletions
|
|
@ -10,8 +10,8 @@ steps:
|
||||||
from_secret: vault_secret_id
|
from_secret: vault_secret_id
|
||||||
commands:
|
commands:
|
||||||
- export VAULT_TOKEN=$(vault write -field=token auth/approle/login role_id=$VAULT_ROLE_ID secret_id=$VAULT_SECRET_ID)
|
- export VAULT_TOKEN=$(vault write -field=token auth/approle/login role_id=$VAULT_ROLE_ID secret_id=$VAULT_SECRET_ID)
|
||||||
- vault kv get -format=json projects/test/demo > /tmp/secrets.json
|
- echo "Auth successful"
|
||||||
- python3 -c "import json; d=json.load(open('/tmp/secrets.json'))['data']['data']; f=open('.env.vault','w'); [f.write(f'export {k}={v}\n') for k,v in d.items()]"
|
- vault kv get -format=table projects/test/demo | awk '/^====== Data/,0 { if ($1 != "======" && $1 != "Key" && $1 != "---") print "export "$1"="$2 }' > .env.vault
|
||||||
- echo "Fetched secrets:"
|
- echo "Fetched secrets:"
|
||||||
- cat .env.vault
|
- cat .env.vault
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue