GoogleCloudPlatform / cloud-builders-community

Community-contributed images for Google Cloud Build
https://cloud.google.com/cloud-build/
Apache License 2.0
1.25k stars 851 forks source link

[Feature request] envsubst: support passing -s multiple times #633

Open michaelCTS opened 11 months ago

michaelCTS commented 11 months ago

Affected builder image

gcr.io/cloud-builders-community/envsubst

Expected Behavior

When passing -s multiple times, only the last one is applied.

Actual Behavior

Accumulate the env vars to substitute and apply the substitution for them all.

Steps to Reproduce the Problem

mkdir /tmp/test123 && cd /tmp/test123
wget 'https://github.com/GoogleCloudPlatform/cloud-builders-community/raw/master/envsubst/entrypoint.bash'
echo '$A $B $C' > to_sub
export A=Hello
export B=World
export C=":)"
bash entrypoint.bash -s '$A' -s '$B' -s '$C' to_sub
cat to_sub

output: $A $B :)

Additional Info