Jets has the concept of extra environments. This can be controlled by the
JETS_ENV_EXTRA variable. By setting
JETS_ENV_EXTRA you can create additional identical environments.
jets deploy # first environment demo-dev JETS_ENV_EXTRA=2 jets deploy # creates a demo-dev-2 environment
JETS_ENV_EXTRA can also be set in the
Jets.application.configure do # ... config.env_extra = 2 # can also set this with JETS_ENV_EXTRA end
Interestingly, since AWS Lambda pricing is based on usage. These extra environments cost you pretty much nothing. They’re literally free until you exceed the free tier. Create 10 extra development, staging or uat environments if you need to 🎉
- JETS_ENV_EXTRA - takes the highest precedence
config/application.rbenv_extra setting - takes lower precedence
With the ability to create entire applications with just a variable change, you can use it to perform blue-green deployments.
- Create another environment
- Test it to your heart’s content
- Switch the DNS over to the new stack
- Delete the old environment
Pro tip: Use the <- and -> arrow keys to move back and forward.