]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: Replace "npm install" with "npm ci"
authorTiago Melo <tspmelo@gmail.com>
Fri, 27 Jul 2018 10:38:41 +0000 (11:38 +0100)
committerTiago Melo <tspmelo@gmail.com>
Tue, 31 Jul 2018 17:07:37 +0000 (18:07 +0100)
"npm ci" is the recommended command to install dependencies
in a continuous integration system.

It will make sure node_modules is empty and that the version in
"package-lock.json" match the ones in "package.json"

Signed-off-by: Tiago Melo <tmelo@suse.com>
make-dist
src/pybind/mgr/dashboard/CMakeLists.txt
src/pybind/mgr/dashboard/HACKING.rst
src/pybind/mgr/dashboard/run-frontend-e2e-tests.sh

index eb9aa7b0f2bf36150c0a5a5d72f3c1881e5f73ec..d4d5f7e62f9439b0490d9a3d6be6abb2b4e77ff6 100755 (executable)
--- a/make-dist
+++ b/make-dist
@@ -80,11 +80,12 @@ build_dashboard_frontend() {
   TEMP_DIR=`mktemp -d`
   $CURR_DIR/src/tools/setup-virtualenv.sh --python=$(_python_autoselect) $TEMP_DIR
   $TEMP_DIR/bin/pip install nodeenv
-  $TEMP_DIR/bin/nodeenv -p -n 8.10.0
+  $TEMP_DIR/bin/nodeenv -p --node=8.11.3
   cd src/pybind/mgr/dashboard/frontend
   . $TEMP_DIR/bin/activate
-  npm install
-  npm run build -- --prod
+  npm i -g npm --unsafe-perm
+  npm ci
+  npm run build -- --prod --progress=false
   deactivate
   cd $CURR_DIR
   rm -rf $TEMP_DIR
index 239af838de8ae41e563c86c570277fc49ae53084..7c77dafb8b098e7fa926b40010a46786f51cfa38 100644 (file)
@@ -34,7 +34,7 @@ add_custom_command(
   OUTPUT "${mgr-dashboard-nodeenv}/bin/npm"
   COMMAND ${CMAKE_SOURCE_DIR}/src/tools/setup-virtualenv.sh --python=${MGR_PYTHON_EXECUTABLE} ${mgr-dashboard-nodeenv}
   COMMAND ${mgr-dashboard-nodeenv}/bin/pip install nodeenv
-  COMMAND ${mgr-dashboard-nodeenv}/bin/nodeenv -p -8.11.3
+  COMMAND ${mgr-dashboard-nodeenv}/bin/nodeenv -p --node=8.11.3
   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
   COMMENT "dashboard nodeenv is being installed"
 )
@@ -45,7 +45,7 @@ add_custom_target(mgr-dashboard-nodeenv
 
 add_npm_command(
   OUTPUT "${CMAKE_SOURCE_DIR}/src/pybind/mgr/dashboard/frontend/node_modules"
-  COMMAND npm install
+  COMMAND npm i -g npm@6.2.0 --unsafe-perm && npm ci
   DEPENDS frontend/package.json
   WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/pybind/mgr/dashboard/frontend
   COMMENT "dashboard frontend dependencies are being installed"
index ad0fe3462465860284eedaa8ca1068fa17acef38..5faeee2ec487e60220112445fd6bd65a116c5999 100644 (file)
@@ -16,7 +16,7 @@ Prerequisites
 ~~~~~~~~~~~~~
 
  * Node 8.9.0 or higher
- * NPM 5.5.1 or higher
+ * NPM 5.7.0 or higher
 
 nodeenv:
   During Ceph's build we create a virtualenv with ``node`` and ``npm``
index 190175edd8f514dff7777aaf130b28235ecaeb0e..413bf4f0182170d0836f0340b7ae5031d5e7b265 100755 (executable)
@@ -49,7 +49,7 @@ fi
 cd $DASH_DIR/frontend
 jq '.["/api/"].target'=$BASE_URL proxy.conf.json.sample | jq '.["/ui-api/"].target'=$BASE_URL > proxy.conf.json
 . $BUILD_DIR/src/pybind/mgr/dashboard/node-env/bin/activate
-npm install
+npm ci
 
 if [ $DEVICE == "chrome" ]; then
     npm run e2e || stop