-
Notifications
You must be signed in to change notification settings - Fork 560
Issue parsing --env for app exec
#1399
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
Comments
This does look (and smell) like a parsing issue. What After looking at the description of
|
I tried to recreate this bug with my own deployment by running: The command worked without issue on
|
I was able to recreate this bug. This appears to be caused by a
The following variations of the above command succeed:
|
I've opened #1405 to raise a clearer error message to users. This appears to be a side effect the |
This seems to be similar to #800. TLDR: The underlying
|
@aliismayilov - Hi, yes It was parsed correctly. |
Ugh yeah this is annoying, looks like that's just how the thor hash arguments work. I guess we could switch them to repeatable string arguments instead and manually parse the key and value so you could do: kamal app exec --primary --env=TEST:1 --env=TEST2:2 '/usr/bin/echo :test' That would be a breaking change though so it will need to wait for v3. |
I opened #1405 awhile back as a stop-gap to try and raise a better error message to the user in this scenario. Long-term it seems like re-opening rails/thor#881 and getting |
I'm trying to reset my production database with this command:
kamal app exec --primary --env=DISABLE_DATABASE_ENVIRONMENT_CHECK:1 'bin/rails db:reset'
It turns into this docker command:
docker run --rm --network kamal --env SOLID_QUEUE_IN_PUMA="true" --env JOB_CONCURRENCY="3" --env WEB_CONCURRENCY="2" --env DB_HOST="xxx.xxx.xxx.xxx" --env-file .kamal/apps/market/env/roles/web.env --env DISABLE_DATABASE_ENVIRONMENT_CHECK="1" --env bin/rails db="reset" --log-opt max-size="10m" --volume market_storage:/rails/storage mktcode/market:latest
Throwing this error:
This seems to be wrong:
--env bin/rails db="reset"
kamal app exec --help
says:Anything I'm doing wrong or is this a bug in the parsing of the env argument?
Update:
When I change the order it works:
kamal app exec --primary 'bin/rails db:reset' --env=DISABLE_DATABASE_ENVIRONMENT_CHECK:1
The text was updated successfully, but these errors were encountered: