Closed SimonLab closed 1 year ago
Merging #230 (29ddfbe) into main (302c079) will not change coverage. The diff coverage is
n/a
.
@@ Coverage Diff @@
## main #230 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 13 13
Lines 309 309
=========================================
Hits 309 309
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
For the mvp reivew apps to be able to run we need to add environment variables using Fly secrets: https://fly.io/docs/app-guides/minio/#secrets
We have to set the ENCRYPTION_KEYS
and AUTH_API_KEYS
. To be able for the Github action scripts to set the values we need to store and pass them from the Github repository secrets:
Edit: All works, after updating the auth_api_key in Github secrets!
So I think the script to deploy a new Fly appication when a PR is created works. It creates a new application names: mvp-pr-#<pr-number>. However I don't think the script can work for application using
auth: I've added the
AUTH_API_KEYas environment variables (copied from the mvp app) but this api key is unique to the
mvpname and doesn't work fro
mvp-pr-...` names:
For this to work, a new api key on auth needs to be created manually providing the correct url name:
So to conclude I don't think we can have an automatic way of creating review apps.
We can create one mvp-review-app
application manually and deploy PRs manually to this application if we want to showcase the new code
I have a similar issue to https://community.fly.io/t/postgres-lingering-connection-after-deleting-fly-app/4771/3
I've deleted manually the review apps while testing the script. The database created by the script is not deleted and I'm now blocked when attempting to run flyctl postgres attach
. The command fails (as the db already exists) and the DATABASE_URL
is not set which break the deployement.
To remove the database:
drop database <namedb> with (force);
then remove the user drop user <nameuser>;
The script for deploying review apps is now ready, see https://mvp-pr-230.fly.dev/ for this current PR. I haven't tried yet to check the review app is removed when a PR is merged but this can be tested once this PR is merged.
@SimonLab Could you please confirm that the review app is deleted automatically when no longer needed?
The action has been triggered by the "closed" event when the PR has been merged and the script to "destroy" the application exited without error:
On the Fly dasbhoard the mvp-pr-230
has been removed:
Nice one. Thanks. 🙏
Start documentation on how to create a Github action for review apps