You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ds...@apache.org on 2024/02/16 21:18:44 UTC

(solr) 01/02: Capture build scans on ge.apache.org to benefit from deep build insights (#2042)

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

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

commit aedb259d8afd4f14ed08c89022bcdc058656baa1
Author: Clay Johnson <cj...@gradle.com>
AuthorDate: Mon Nov 6 15:37:23 2023 -0600

    Capture build scans on ge.apache.org to benefit from deep build insights (#2042)
    
    Apache committers who opt-in (via authentication) can have their local build scans be submitted to ge.apache.org.
    
    (cherry picked from commit 0b59d371d85bd3d9da3c7cef5514dc286ef8c7a2)
---
 .github/workflows/bin-solr-test.yml    |  3 +++
 .github/workflows/docker-test.yml      |  1 +
 .github/workflows/gradle-precommit.yml |  3 +++
 .github/workflows/solrj-test.yml       |  3 +++
 gradle/ge.gradle                       | 41 ++++++++++++++++++++++++++++++++++
 settings.gradle                        |  7 ++++++
 6 files changed, 58 insertions(+)

diff --git a/.github/workflows/bin-solr-test.yml b/.github/workflows/bin-solr-test.yml
index d8a6076da64..a832bdcc541 100644
--- a/.github/workflows/bin-solr-test.yml
+++ b/.github/workflows/bin-solr-test.yml
@@ -15,6 +15,9 @@ jobs:
 
     runs-on: ubuntu-latest
 
+    env:
+      GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
+
     steps:
     # Setup
     - uses: actions/checkout@v2
diff --git a/.github/workflows/docker-test.yml b/.github/workflows/docker-test.yml
index ddf6292d46f..dc8cc9df728 100644
--- a/.github/workflows/docker-test.yml
+++ b/.github/workflows/docker-test.yml
@@ -20,6 +20,7 @@ jobs:
     env:
       SOLR_DOCKER_IMAGE_REPO: github-pr/solr
       SOLR_DOCKER_IMAGE_TAG: ${{github.event.number}}
+      GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
 
     steps:
     # Setup
diff --git a/.github/workflows/gradle-precommit.yml b/.github/workflows/gradle-precommit.yml
index 6cc1425db84..6b4634736f2 100644
--- a/.github/workflows/gradle-precommit.yml
+++ b/.github/workflows/gradle-precommit.yml
@@ -11,6 +11,9 @@ jobs:
 
     runs-on: ubuntu-latest
 
+    env:
+      GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
+
     steps:
     # Setup
     - uses: actions/checkout@v2
diff --git a/.github/workflows/solrj-test.yml b/.github/workflows/solrj-test.yml
index 625ab7ee437..0941fcd41c7 100644
--- a/.github/workflows/solrj-test.yml
+++ b/.github/workflows/solrj-test.yml
@@ -14,6 +14,9 @@ jobs:
 
     runs-on: ubuntu-latest
 
+    env:
+      GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
+
     steps:
     # Setup
     - uses: actions/checkout@v2
diff --git a/gradle/ge.gradle b/gradle/ge.gradle
new file mode 100644
index 00000000000..c718d41af81
--- /dev/null
+++ b/gradle/ge.gradle
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+def isCIBuild = System.getenv().keySet().find { it ==~ /(?i)((JENKINS|HUDSON)(_\w+)?|CI)/ } != null
+
+gradleEnterprise {
+    server = "https://ge.apache.org"
+    buildScan {
+        capture { taskInputFiles = true }
+        uploadInBackground = !isCIBuild
+        publishAlways()
+        publishIfAuthenticated()
+        obfuscation {
+            ipAddresses { addresses -> addresses.collect { address -> "0.0.0.0"} }
+        }
+    }
+}
+
+buildCache {
+    local {
+        enabled = !isCIBuild
+    }
+
+    remote(gradleEnterprise.buildCache) {
+        enabled = false
+    }
+}
\ No newline at end of file
diff --git a/settings.gradle b/settings.gradle
index 50912027467..91e1eb36608 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -22,6 +22,13 @@ pluginManagement {
     }
 }
 
+plugins {
+    id 'com.gradle.enterprise' version '3.15.1'
+    id 'com.gradle.common-custom-user-data-gradle-plugin' version '1.12'
+}
+
+apply from: file('gradle/ge.gradle')
+
 rootProject.name = "solr-root"
 
 includeBuild("dev-tools/solr-missing-doclet")