Hey I’m wondering if there’s any built-in support or if anyone has custom tooling for Fly.io deploys that allows smoke testing blue/green deploys. I’m essentially wanting to add some safety to blue/green deploys beyond just a health-check endpoint.
Example (assuming “blue” is deployed)
Deploy to green
Run a suite of smoke tests against green
If tests succeed, switch traffic to green and kill blue
If tests fail, kill green
Looks like there is support for blue/green deploys but not sure how this testing piece would fit in.
We don’t support anything this extensive natively. What kinds of tests would you want to run?
If I were trying to do this on Fly.io, I’d probably run a haproxy app in between us and your app servers. It’s not ideal, but it would give you a tremendous amount of control over where traffic gets routed during deploys.
The tests would be a series of HTTP requests (currently done via RSpec) to test a happy path through the app (create user, login, create post, update post, etc.)
So with haproxy on Fly with a blue/green setup, what would you envision that looking like? Something like this?
* "Green" Fly.io app
* "Blue" Fly.io app
* haproxy Fly.io app tied to the domain and pointing to both apps
* Scripting to handle the deployment process
Just a random thought: maybe the health check can run the tests, assuming they don’t take too long. This could be messy
You could have the health check - when run for the first time - run the suite against its own VM and respond with status 200. Then write to a file on disk, in each VM, marking the smoke test as ‘done’ so future health check runs skip the test suite. That means every VM is running the tests, so it may not be ideal.