FEATURE: add missing hooks into web.yml template

FEATURE: add missing hooks into web.yml template

Previously bundle+migrate+precompile were in 1 big chunk making it impossible to add multisite:migrate cleanly.

This adds 2 more hooks db_migrate and assets_precompile which make it way simple to inject multisite migrate (either before or after db_migrate)

diff --git a/templates/web.template.yml b/templates/web.template.yml
index 14a52fd..395ddcb 100644
--- a/templates/web.template.yml
+++ b/templates/web.template.yml
@@ -156,9 +156,16 @@ run:
       hook: bundle_exec
       cmd:
         - su discourse -c 'bundle install --deployment --verbose --without test --without development --retry 3 --jobs 4'
+  - exec:
+      cd: $home
+      hook: db_migrate
+      cmd:
         - su discourse -c 'bundle exec rake db:migrate'
+  - exec:
+      cd: $home
+      hook: assets_precompile
+      cmd:
         - su discourse -c 'bundle exec rake assets:precompile'
-
   - file:
      path: /usr/local/bin/discourse
      chmod: +x

GitHub sha: 5716d28f

1 Like

This commit has been mentioned on Discourse Meta. There might be relevant details there:

Note this was a breaking change for us and broke deployments :frowning:

1 Like

Apologies, it is a very much needed change, however I really should have done it first thing in my day vs left you guys to deal with it.

1 Like

No problem just wanted to attach a note indicating what happened for posterity/historical purposes.

2 Likes