]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: read $NPM_REGISTRY for npm registry mirror 37561/head
authorKefu Chai <kchai@redhat.com>
Tue, 6 Oct 2020 06:58:55 +0000 (14:58 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 6 Oct 2020 07:01:11 +0000 (15:01 +0800)
in case the offical npm registry is slow or unreachable.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/pybind/mgr/dashboard/CMakeLists.txt

index cb692cba752f55cfa4e88ca9cd2adef636d08044..dd6aa9f0e718bd764c868a82ad6cd85d0e824d7e 100644 (file)
@@ -59,11 +59,15 @@ else(WITH_SYSTEM_NPM)
     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
     COMMENT "dashboard nodeenv is being installed"
     )
+  if(DEFINED ENV{NPM_REGISTRY})
+    set(npm_registry_opts "OPTION" "registry=$ENV{NPM_REGISTRY}")
+  endif()
   add_npm_options(
     NODEENV_DIR ${mgr-dashboard-nodeenv-dir}
     TARGET mgr-dashboard-nodeenv
     OPTION python=${MGR_PYTHON_EXECUTABLE}
-    OPTION cache=${mgr-dashboard-nodeenv-dir}/.npm)
+    OPTION cache=${mgr-dashboard-nodeenv-dir}/.npm
+    ${npm_registry_opts})
   add_custom_target(mgr-dashboard-frontend-deps
     DEPENDS frontend/node_modules mgr-dashboard-nodeenv
     WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/pybind/mgr/dashboard/frontend