Replies: 1 comment 1 reply
-
You can do it in a bash.yq
Then run it with yq like: yq --from-file=bash.yq example.yaml To get: var0='string0'
var1='string1'
ary0=('aryval0','aryval1','aryval2') Explanation:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I use yq to add environment vars from yaml files.
example.yaml:
code:
error:
desired outcome:
The same yaml file gets read into bash, environment variables, ansible and php at different times for different purposes.
I need to catch array entries when reading the yaml file and convert those array entries into a string representation to export as an environment variable, but I don't know the syntax or methods to do this in yq.
array declaration and values; I don't know how to get the environment variable example to work:
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions