fetch secrets by uuid instead of listing all
This commit is contained in:
+4
-3
@@ -57,11 +57,12 @@ if [ -f "docker/$APP/.env.keys" ] && [ -f /etc/bws-token ]; then
|
||||
env_content=""
|
||||
while IFS= read -r line || [ -n "$line" ]; do
|
||||
[ -z "$line" ] && continue
|
||||
[[ "$line" = \#* ]] && continue
|
||||
var_name="${line%%=*}"
|
||||
secret_key="${line#*=}"
|
||||
value=$(bws secret list | jq -r --arg key "$secret_key" '.[] | select(.key == $key) | .value')
|
||||
secret_id="${line#*=}"
|
||||
value=$(bws secret get "$secret_id" | jq -r .value)
|
||||
if [ -z "$value" ]; then
|
||||
echo "ERROR: Secret '$secret_key' not found in bws."
|
||||
echo "ERROR: Secret '$secret_id' not found in bws."
|
||||
echo " Check that the secret exists and the machine account has access."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user