violet_rails
violet_rails copied to clipboard
Review App needs their own app host
Describe the bug Once we deploy each PR to its review app, the APP_HOST needs to be its own.
Expected behavior If a PR is deployed to review app. for eg: If no issues, PR#1111 will be deployed to https://review-1111.violet-test.net/ The APP_HOST name must be review-1111 instead of "public" or other subdomain.
@donrestarone While working on this task: https://github.com/restarone/violet_rails/issues/1127, the MAILGUN credentials for the dokku apps were specific to violet-test.net domain and does not work for its subdomains. For the main app, its APP_HOST is violet-test.net. And, while an new review-app is created, the ENVs are simply copied.
So, should we make the APP_HOST be dynamic (review-[PR number].violet-test.net)? We will need to make some changes in the dokku CI for this. If we make the APP_HOST to be dynamic, the email feature will not work in the review-apps unless we make the MAILGUN credentials to work for subdomains of violet-test.net.
that's a good callout @alis-khadka -- lets hold on this for now
The only thing holding us back for making the ENV["APP_HOST"] to be dynamic is the email functionality.
As per this, the MAILGUN does support wildcard subdomains and we would have to manually add the subdomains which does not fulfill our requirement.
Similar to MAILGUN, we have POSTMARK which supports wildcard subdomain as per this article. I have not looked into it in detail. So, I am not sure if it fulfills our requirement.
Maybe we could use some fresh eyes in this matter. CC @Pralish
Another approach would be:
If the MAILGUN supports adding sub-domains with its API, we could integrate the process of adding/removing the sub-domains into the dokku-CI while deploying/removing the review-app.
Credits to @Regaron for suggesting this approach.