-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Automate collectstatic and migrate commands #427
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #427 +/- ##
==========================================
+ Coverage 82.72% 82.80% +0.07%
==========================================
Files 124 126 +2
Lines 2599 2611 +12
==========================================
+ Hits 2150 2162 +12
Misses 449 449 ☔ View full report in Codecov by Sentry. |
Running commands on Docker startup is not necessarily a bad thing, for example it's a common practice to run migrations like this, but:
|
Thanks for your input, much appreciated! Re: Re: |
Any time, hope it helps :)
I think the simple option is some kind of cron mechanism. I've noticed there's a new Helm deployment being set up, and I don't know much about Helm/Kubernetes, but it looks like Kubernetes has the concept of cron jobs? |
There are a number of other management commands that are recommended to be run periodically at https://docs.wagtail.org/en/stable/reference/management_commands.html |
I've updated the init script so that it only runs
@mgax I have looked into including static files in the image itself, but it expects some environment variables such as |
@microamp yep, setting placeholder values for the required environment variables in Dockerfile
I'd also include |
@mgax Thanks for your input once again. I will try to build and include static files in the image itself.
Thanks for pointing that out. That is right - it needs to be part of the init process. I'll include that in EDIT: typo |
Fixes #426
deploy.sh
already exists, so it's being reused here.We can expand the list if there are any commands missing that need to run on init.