From 915f9f5d653211be24a7bec124fa9248fece05e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Anne?= Date: Fri, 12 Apr 2019 15:06:41 +0200 Subject: [PATCH] Fix dev dependencies install 1. Fix command run from outside GLPI root dir 2. Fix generation of package.hash file --- .circleci/config.yml | 8 ++++---- bin/console | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e9712c6343..77bdf9c941 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 diff --git a/bin/console b/bin/console index e293a64311..ee1d42bab3 100755 --- a/bin/console +++ b/bin/console @@ -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(); } -- GitLab