Page MenuHomePhabricator

Fix production build step
Closed, ResolvedPublic

Description

Currently, server compiled assets that require CSS files fail because they are not transferred to the dist/ folder so require fails before ignore-styles can do its thing.

As an interim solution, let's copy non-JS assets to dist/ so that require doesn't fail.

  • Copy non-TS/JS files to dist on npm run build in a cross-OS way (something like copyfiles) maintaining the folder structure from src to dist.
  • Remove the staging hack in marvin.wmflabs.org in the post-merge hook that does this copying with cp --parents
  • Revise the staging docs as needed

Event Timeline

Change 377223 had a related patch set uploaded (by Jhernandez; owner: Jhernandez):
[marvin@master] Chore: Fix npm run build

https://gerrit.wikimedia.org/r/377223

Change 377223 merged by jenkins-bot:
[marvin@master] Chore: Fix npm run build

https://gerrit.wikimedia.org/r/377223

Going to review the staging hook and the docs next.

Removed:

/home/marvin/sources/.git/hooks/post-merge#11
# Temporary hack until we fix CSS requires in PROD
 12 cd src/ && find . -name '*.css' -exec cp -v --parents \{\} ../dist \; && cd ..

...from marvin.wmflabs.org

Staging seems to be stuck because of npm modifying the lock file.

I run

cd sources/
git checkout -- package-lock.json

Changed the sources/.git/hooks/post-merge hook to do npm install --no-save to avoid modifying the package-lock.json.

I've updated the staging guide. Will submit patch after I verify it works fine.

Change 377309 had a related patch set uploaded (by Jhernandez; owner: Jhernandez):
[marvin@master] Fix: Specify a mount path for static assets

https://gerrit.wikimedia.org/r/377309

Change 377309 merged by jenkins-bot:
[marvin@master] Fix: Specify a mount path for static assets

https://gerrit.wikimedia.org/r/377309

Change 377311 had a related patch set uploaded (by Jhernandez; owner: Jhernandez):
[marvin@master] Docs: Update staging server guide to install w/ --no-save

https://gerrit.wikimedia.org/r/377311

Change 377311 merged by jenkins-bot:
[marvin@master] Docs: Update staging server guide to install w/ --no-save

https://gerrit.wikimedia.org/r/377311

Jhernandez updated the task description. (Show Details)