Use a node_modules symlink in /etc/gitlab instead of setting NODE_PATH

This commit is contained in:
Pirate Praveen 2021-01-17 18:26:29 +05:30
parent c16076696d
commit 0139ac7e71
2 changed files with 4 additions and 1 deletions

3
debian/gitlab.links vendored
View file

@ -2,6 +2,9 @@ var/lib/gitlab/public usr/share/gitlab/public
var/lib/gitlab/shared usr/share/gitlab/shared
var/lib/gitlab/db usr/share/gitlab/db
var/lib/gitlab/node_modules usr/share/gitlab/node_modules
# This is required for webpack to resolve direct dependencies mentioned
# in config/webpack.config.js, because it is a symbolic link to /etc/gitlab
var/lib/gitlab/node_modules etc/gitlab/node_modules
var/lib/gitlab/package.json usr/share/gitlab/package.json
var/lib/gitlab/yarn-error.log usr/share/gitlab/yarn-error.log
var/lib/gitlab/yarn.lock usr/share/gitlab/yarn.lock

View file

@ -53,4 +53,4 @@ runuser -u ${gitlab_user} -- sh -c '/usr/bin/bundle exec rake tmp:cache:clear as
echo "Webpacking..."
# Workaround for webpack crashing with nodejs 10 - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=956211
# Build assets in production mode - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=956508
runuser -u ${gitlab_user} -- sh -c 'NODE_ENV="production" NODE_PATH="node_modules" NODE_OPTIONS="--max-old-space-size=4096" webpack --config config/webpack.config.js'
runuser -u ${gitlab_user} -- sh -c 'NODE_ENV="production" NODE_OPTIONS="--max-old-space-size=4096" webpack --config config/webpack.config.js'