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

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: ...@@ -79,15 +79,15 @@ commands:
- run: - run:
name: npm install name: npm install
command: | command: |
# use npm ci instead of npm install to make sure that it will install exact packages mv package-lock.json package-lock.json.bak
# described in package-lock.json, without any additionnal checks npm install
npm ci php -r "file_put_contents('.package.hash', sha1_file('package-lock.json'));"
- save_cache: - save_cache:
key: npm-cache-{{ .Environment.CIRCLE_JOB }}-{{ epoch }} key: npm-cache-{{ .Environment.CIRCLE_JOB }}-{{ epoch }}
paths: paths:
- /home/circleci/.npm/_cacache/ - /home/circleci/.npm/_cacache/
- save_cache: - save_cache:
key: npm-install-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package-lock.json" }} key: npm-install-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package-lock.json.bak" }}
paths: paths:
- ./node_modules - ./node_modules
......
...@@ -32,9 +32,11 @@ ...@@ -32,9 +32,11 @@
*/ */
// Handle specific dependencies update command that cannot be made upon symfony console // 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('composer install');
passthru('npm install'); passthru('npm install');
file_put_contents('.package.hash', sha1_file('package-lock.json'));
passthru('npm run-script build-dev'); passthru('npm run-script build-dev');
exit(); 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