This commit is contained in:
2024-04-13 20:17:00 +02:00
parent 632786c8ad
commit c81a2921ad
3 changed files with 11 additions and 11 deletions

7
scripts/env.sh Normal file → Executable file
View File

@@ -4,9 +4,4 @@ response=`curl -X 'GET' "https://$VAULT_HOST/v1/$VAULT_SECRET_PATH" -s \
-H 'accept: application/json' \
-H "X-Vault-Token: $VAULT_TOKEN"`
data=`echo $response | jq -r '.data.data'`
for key in $(echo "$data" | jq -r 'keys[]'); do
value=$(echo "$data" | jq -r ".\"$key\"") # Corrected syntax
echo "$key"="$value"
done
echo "$(echo "$response" | jq -r '.data.data | to_entries | map("\(.key)='\''\(.value)'\''") | .[]')"

View File

@@ -1,6 +1,8 @@
#! /usr/bin/env sh
export $(/env.sh)
/env.sh > ./.env
. ./.env
rm ./.env
cd /app
mkdir -p prometheus