Commit 915f9f5d authored by Cédric Anne's avatar Cédric Anne Committed by Johan Cwiklinski

Fix dev dependencies install

1. Fix command run from outside GLPI root dir
2. Fix generation of package.hash file
parent 1086d077
......@@ -79,15 +79,15 @@ commands:
- run:
name: npm install
command: |
# use npm ci instead of npm install to make sure that it will install exact packages
# described in package-lock.json, without any additionnal checks
npm ci
mv package-lock.json package-lock.json.bak
npm install
php -r "file_put_contents('.package.hash', sha1_file('package-lock.json'));"
- save_cache:
key: npm-cache-{{ .Environment.CIRCLE_JOB }}-{{ epoch }}
paths:
- /home/circleci/.npm/_cacache/
- save_cache:
key: npm-install-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package-lock.json" }}
key: npm-install-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package-lock.json.bak" }}
paths:
- ./node_modules
......
......@@ -32,9 +32,11 @@
*/
// Handle specific dependencies update command that cannot be made upon symfony console
if (isset($_SERVER['argv']) && ['bin/console', 'dependencies', 'install'] === $_SERVER['argv']) {
if (isset($_SERVER['argv']) && ['dependencies', 'install'] === array_slice($_SERVER['argv'], 1, 2)) {
chdir(dirname(__FILE__, 2));
passthru('composer install');
passthru('npm install');
file_put_contents('.package.hash', sha1_file('package-lock.json'));
passthru('npm run-script build-dev');
exit();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment