From: Kefu Chai Date: Tue, 6 Oct 2020 06:58:55 +0000 (+0800) Subject: cmake: read $NPM_REGISTRY for npm registry mirror X-Git-Tag: v16.1.0~895^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F37561%2Fhead;p=ceph.git cmake: read $NPM_REGISTRY for npm registry mirror in case the offical npm registry is slow or unreachable. Signed-off-by: Kefu Chai --- diff --git a/src/pybind/mgr/dashboard/CMakeLists.txt b/src/pybind/mgr/dashboard/CMakeLists.txt index cb692cba752f..dd6aa9f0e718 100644 --- a/src/pybind/mgr/dashboard/CMakeLists.txt +++ b/src/pybind/mgr/dashboard/CMakeLists.txt @@ -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