I have a build pipline defined as such:
- name: 'ubuntu'
env:
- 'URL="$$_URL/movies"'
secretEnv: ['_URL']
script: 'echo URL'
availableSecrets:
secretManager:
- versionName: projects/$PROJECT_ID/secrets/url/versions/latest
env: '_URL'
This produces $_URL/movies
and I’d like to have my value substituted in that string in env. If I use single $ I get error with no default substitution called _URL.
2
Answers
I resolved my problem in the end in quite an easy way.
Using variables from secrets in clauses other than args/script is not supported, so I used only script to define variables and do computation. I also took into account the mistake pointed out by guillaume blaquiere.
So the final yaml looks something like this:
You have to print the env var URL in your script, like that