-
-
Notifications
You must be signed in to change notification settings - Fork 610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to pass environment variable as value #468
Comments
As you would with any other shell command.
|
How is this done on v4, where everything is in a string that will not get expanded by the shell? |
This works, even though it's a bit ugly:
|
I tried above it just got me the thing i changed. other parameters got DELETED ! |
for v4 this works To change with var -i, --inplace update the yaml file inplace of first yaml file given. Thanks to above command @StianOvrevage Just need to escape properly. |
I still had to escape the double quotes in your above response to get it to work yq eval ".services.app.volumes[0] = \"$myvar\"" -i docker-compose.yml |
my mistake was to not include code tag that is why it is messed up in the post. yq eval ".services.app.volumes[0] = "$myvar"" -i docker-compose.yml
|
In a Dockerfile, I created an ARG VARIABLE
yq -i '.this.is.yourproperty = strenv(VARIABLE)' file.yml |
@CarMoreno that inserts the value as a string right? Is there a way to parse VARIABLE into an integer? |
Yes @aerlaut as string. I did not know a way to parse it into an integer, sorry |
Just use |
can i get a value from yml file, and store to a variable in a pipeline? im working with azure |
Hi @mikefarah |
Describe the bug
how to pass environment variable as value?
yq w temp.yaml data.role ${VALUE}
The text was updated successfully, but these errors were encountered: