You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ho...@apache.org on 2024/01/19 21:15:58 UTC

(solr) branch main updated: Give NPM registry option for downloading node tools (#2208)

This is an automated email from the ASF dual-hosted git repository.

houston pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/main by this push:
     new a5337ee3fb9 Give NPM registry option for downloading node tools (#2208)
a5337ee3fb9 is described below

commit a5337ee3fb93eb042d0b93c62ce86ebdf9ae870c
Author: Houston Putman <ho...@apache.org>
AuthorDate: Fri Jan 19 16:15:53 2024 -0500

    Give NPM registry option for downloading node tools (#2208)
---
 gradle/node.gradle     |  7 +++++++
 help/localSettings.txt | 12 ++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/gradle/node.gradle b/gradle/node.gradle
index bb0ea5b3f82..1823b783053 100644
--- a/gradle/node.gradle
+++ b/gradle/node.gradle
@@ -18,6 +18,13 @@
 configure([project(":solr:packaging"), project(":solr:solr-ref-guide"), project(":solr:webapp")]) {
     apply plugin: "com.github.node-gradle.node"
 
+    def npmRegistry = "${ -> propertyOrEnvOrDefault("solr.npm.registry", "SOLR_NPM_REGISTRY", '') }"
+    if (!npmRegistry.isEmpty()) {
+        tasks.npmSetup {
+            args.addAll(['--registry', npmRegistry])
+        }
+    }
+
     ext {
         rootNodeDir = "$rootDir/.gradle/node"
         nodeProjectDir = file("$rootNodeDir/$project.name")
diff --git a/help/localSettings.txt b/help/localSettings.txt
index 5089bb669ca..3c261fd234d 100644
--- a/help/localSettings.txt
+++ b/help/localSettings.txt
@@ -6,3 +6,15 @@ and save a project-local 'gradle.properties' file from a template,
 with some default settings which you can modify.
 
 See your 'gradle.properties' file for more details of those settings.
+
+Building without access to the internet
+---------------------------------------
+
+-- Node --
+There are a few tasks that rely on downloading 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 NPM registry for Gradle to connect to, please use either:
+- The "SOLR_NPM_REGISTRY" environment variable
+- The "-Psolr.npm.registry" Gradle property.