Skip to content

Commit

Permalink
CURATOR-669. Integrate with ge.apache.org Gradle Enterprise server (a…
Browse files Browse the repository at this point in the history
…pache#459)

Signed-off-by: tison <[email protected]>
  • Loading branch information
tisonkun authored May 6, 2023
1 parent 780c242 commit 447878f
Show file tree
Hide file tree
Showing 5 changed files with 128 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ jobs:
fail-fast: false
matrix:
java: [8, 11]
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
steps:
- uses: actions/checkout@v3

Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,7 @@ atlassian-ide-plugin.xml

# NetBeans specific files/directories
.nbattrs

# Gradle Enterprise
test-reports/
.mvn/.gradle-enterprise/
34 changes: 34 additions & 0 deletions .mvn/extensions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0 http://maven.apache.org/xsd/core-extensions-1.0.0.xsd">
<extension>
<groupId>com.gradle</groupId>
<artifactId>gradle-enterprise-maven-extension</artifactId>
<version>1.17</version>
</extension>
<extension>
<groupId>com.gradle</groupId>
<artifactId>common-custom-user-data-maven-extension</artifactId>
<version>1.11.1</version>
</extension>
</extensions>
38 changes: 38 additions & 0 deletions .mvn/gradle-enterprise-custom-user-data.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* 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.
*/

if (System.env.GITHUB_ACTIONS) {
if (session.goals.size() == 1 && session.goals[0] == 'initialize') {
// omit publishing build scan when the only goal is "initialize"
buildScan.publishOnDemand()
} else {
def jobName = System.env.GITHUB_JOB
buildScan.value('GitHub Actions Job name', jobName)
buildScan.value('GitHub Actions Event name', System.env.GITHUB_EVENT_NAME)
buildScan.value('GitHub Ref name', System.env.GITHUB_REF_NAME)
buildScan.value('GitHub Actor', System.env.GITHUB_ACTOR)
buildScan.link('GitHub Repository', "https://github.com/" + System.env.GITHUB_REPOSITORY)
buildScan.link('GitHub Commit', "https://github.com/" + System.env.GITHUB_REPOSITORY + "/commits/" + System.env.GITHUB_SHA)
buildScan.buildScanPublished { publishedBuildScan ->
new File(System.env.GITHUB_STEP_SUMMARY).withWriterAppend { out ->
out.println("\n[Gradle build scan for ${jobName}](${publishedBuildScan.buildScanUri})\n")
}
}
}
}
50 changes: 50 additions & 0 deletions .mvn/gradle-enterprise.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!--
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.
-->
<gradleEnterprise
xmlns="https://www.gradle.com/gradle-enterprise-maven" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://www.gradle.com/gradle-enterprise-maven https://www.gradle.com/schema/gradle-enterprise-maven.xsd">
<server>
<url>https://ge.apache.org</url>
<allowUntrusted>false</allowUntrusted>
</server>
<buildScan>
<capture>
<goalInputFiles>true</goalInputFiles>
<buildLogging>true</buildLogging>
<testLogging>true</testLogging>
</capture>
<backgroundBuildScanUpload>#{isFalse(env['GITHUB_ACTIONS'])}</backgroundBuildScanUpload>
<publish>ALWAYS</publish>
<publishIfAuthenticated>true</publishIfAuthenticated>
<obfuscation>
<ipAddresses>#{{'0.0.0.0'}}</ipAddresses>
</obfuscation>
</buildScan>
<buildCache>
<local>
<enabled>#{isFalse(env['GITHUB_ACTIONS'])}</enabled>
</local>
<remote>
<enabled>false</enabled>
</remote>
</buildCache>
</gradleEnterprise>

0 comments on commit 447878f

Please sign in to comment.