From a5a80b76872aff778449033f497b232740941b59 Mon Sep 17 00:00:00 2001 From: Houston Putman Date: Mon, 22 Jan 2024 12:22:48 -0600 Subject: [PATCH] Fix nodeSetup, use node distBaseUrl instead of registry (#2208) (cherry picked from commit c2af5fa1a07b6dfbfcb5c190264a506fedcecf2e) --- gradle/node.gradle | 8 +++++--- help/localSettings.txt | 6 +++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gradle/node.gradle b/gradle/node.gradle index 6bec66456e0..41a853799c5 100644 --- a/gradle/node.gradle +++ b/gradle/node.gradle @@ -23,9 +23,6 @@ configure([project(":solr:packaging"), project(":solr:solr-ref-guide"), project( tasks.npmSetup { args.addAll(['--registry', npmRegistry]) } - tasks.nodeSetup { - args.addAll(['--registry', npmRegistry]) - } } ext { @@ -37,6 +34,11 @@ configure([project(":solr:packaging"), project(":solr:solr-ref-guide"), project( download = true version = "16.15.1" // LTS + def nodeDistUrl = "${ -> propertyOrEnvOrDefault("solr.node.distUrl", "SOLR_NODE_DIST_URL", '') }" + if (!nodeDistUrl.isEmpty()) { + distBaseUrl = nodeDistUrl + } + // The directory where Node.js is unpacked (when download is true) workDir = file("${project.ext.rootNodeDir}/nodejs") diff --git a/help/localSettings.txt b/help/localSettings.txt index 3c261fd234d..a0f66f5ed58 100644 --- a/help/localSettings.txt +++ b/help/localSettings.txt @@ -11,10 +11,14 @@ Building without access to the internet --------------------------------------- -- Node -- -There are a few tasks that rely on downloading node tools from NPM. +There are a few tasks that rely on downloading node itself and node tools from NPM. These include the Reference Guide build, the integration (e2e) tests and the webapp build. Some of these can be disabled, however other tasks such as building the solr webapp often cannot be disabled. +In order to set a Node Distribution base URL for Gradle to download Node from, please use either: +- The "SOLR_NODE_DIST_URL" environment variable +- The "-Psolr.node.distUrl" Gradle property. + In order to set a NPM registry for Gradle to connect to, please use either: - The "SOLR_NPM_REGISTRY" environment variable - The "-Psolr.npm.registry" Gradle property.