Conversation
Add `env:[name_of_env]` rake tasks that allow switching between local, staging and production environments. Display environment when running `rake app:up`.
|
✔️ All good! |
d2593cc to
74441c5
Compare
|
CI failure unrelated, fixed in #364. |
There was a problem hiding this comment.
Something like this would be nice, yes! Here are some non-binding thoughts:
Wondering if we could have it print the whole contents of appsignal_key.env on boot, and then we don't need to keep around .appsignal_environment for that purpose (which is a piece of state that may fall out of sync with the state it's supposed to correlate to) -- the file could have a # ENV: prod comment added at the top of it when you switch.
I think giving the implementation another spin could work. Replacing global:set_push_api_key or getting rid of it entirely seems necessary, yes.
I'd suggest not having aliases that don't match the required file names. If the file has to be named _local.env, don't let me use env:development, that only makes it more confusing when I name the file _development.env and it doesn't work.
Consider replacing the three tasks with a parameter? Something like rake env=prod env:switch replacing all three, for example. That way there's no mandatory set of allowed names.
This comment has been minimized.
This comment has been minimized.
12 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
|
This is a message from the daily scheduled checks. |
This is what I use to quickly switch between different environments. I run
rake env:localorrake env:staging, orrake env:prodand that's it.It's basically just 3
appsignal_key_[env].envfiles, and an.appsignal_environmentfile that tracks which env file is used inappsignal_key.env. A command likerake env:localcopiesappsignal_key_local.envtoappsignal_key.env, which then gets used in all test-setups.I haven't made this work with
rake global:set_push_api_key, but I will do that if this is something that we actually want to add.