From: David Taylor Date: Sat, 17 Sep 2022 12:22:34 +0000 (+0100) Subject: FIX: Reorder yarn/bundle install for compatibility (#642) X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=8c40388ae4dabf1c0052ddd8eab4c72dbf7e0ca3;p=discourse_docker.git FIX: Reorder yarn/bundle install for compatibility (#642) Some existing templates (e.g. those written by following [the multisite guide](https://meta.discourse.org/t/multisite-configuration-with-docker/14084) use the `after_bundle_exec` hook to run application code like `multisite:migrate`. Relatively recently, the ruby app has started depending on `yarn` dependencies for basic functionality, and therefore requires `yarn install` to have been run to avoid errors. This commit moves the `yarn install` step before `bundle install`, so that existing users of the `after_bundle_exec` hook do not need to update their templates. --- diff --git a/templates/web.template.yml b/templates/web.template.yml index ee3021c..3bd3c8c 100644 --- a/templates/web.template.yml +++ b/templates/web.template.yml @@ -155,14 +155,14 @@ run: - exec: cd: $home - hook: bundle_exec cmd: - - su discourse -c 'bundle install --deployment --retry 3 --jobs 4 --verbose --without test development' + - "[ ! -d 'node_modules' ] || su discourse -c 'yarn install --production --frozen-lockfile && yarn cache clean'" - exec: cd: $home + hook: bundle_exec cmd: - - "[ ! -d 'node_modules' ] || su discourse -c 'yarn install --production --frozen-lockfile && yarn cache clean'" + - su discourse -c 'bundle install --deployment --retry 3 --jobs 4 --verbose --without test development' - exec: cd: $home