-
Notifications
You must be signed in to change notification settings - Fork 92
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
ENV vars are ignored (sometimes) #241
Comments
Cloud Run Button only asks for env vars which are not already set: It might be nice to have a param on the env var to control that behavior. I'm not sure if there is a good workaround right now since all the hooks run after the env var handling. So you couldn't delete the hook at the right time. However, I think that hooks support stdin so you could do your own env var handling in a hook script. |
If the service exists then it will find the env var on a second run. Glad your workaround works. :) |
hold on, are these envvars taken from an existing CRun service? :-( ) So, it's not just vars inside a Shell VM? |
Yeah, the env vars in Cloud Run Button are for setting env vars on Cloud Run services. |
I have a repo with app.json.
That app.json contains the "env" section with a variable. After I introduced the variable it worked and it was asked. But during all subsequent runs the variable is ignored (not being asked).
I tried both required true/false, with and without value.
If I rename it, it starts working again. But if I rename it back it stops.
All that I'm doing with the var is checking for its value in my prebuild.sh:
Welcome to Cloud Shell! Type "help" to get started.
To set your Cloud Platform project in this session use “gcloud config set project [PROJECT_ID]”
sergei@cloudshell:~$ cloudshell_open --repo_url "https://github.com/evil-shrike/cloud-run-button-test.git" --page "shell" --force_new_clone
[ ✓ ] Cloned git repository https://github.com/evil-shrike/cloud-run-button-test.git.
[ ✓ ] Queried list of your projects
[ ✓ ] Found 11 projects in your GCP account.
[ ? ] Choose a project or press ctrl-c to create a new project: myproject1
[ ✓ ] Enabled Cloud Run API on project myproject1
[ ? ] Choose a region to deploy this application: us-central1
[ ! ] Running command: ./cloud-run-hooks/prebuild.sh
^C
sergei@cloudshell:~ (myproject1)$ cd cloud-run-button-test/
sergei@cloudshell:~/cloud-run-button-test (myproject1)$ cat app.json
{
"env": {
"USE_GOOGLE_ADS_CONFIG": {
"description": "Would you like to use a google-ads.yaml (Y) - please upload one, otherewise (N) you'll be asked to enter credentials later",
"required": true,
"value": ""
}
},
...
}
The text was updated successfully, but these errors were encountered: