-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Capture build scans on ge.apache.org to benefit from deep build insig…
…hts (#1288) * Capture build scans on ge.apache.org to benefit from deep build insights (#1) * Add Develocity plugin and configure it to publish to Apache Develocity instance * Add Develocity access token to CI jobs * Use convention plugin to configure Develocity * Add opt-in property * Revert "Add opt-in property" This reverts commit ff556b9. * Improve variable name * Use upper case i in CI abbreviation
- Loading branch information
Showing
16 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
import com.gradle.develocity.agent.sbt.DevelocityPlugin | ||
import com.gradle.develocity.agent.sbt.DevelocityPlugin.autoImport.{ | ||
develocityConfiguration, | ||
FlakyTestPolicy, | ||
ProjectId, | ||
Publishing | ||
} | ||
import sbt.{ url, AutoPlugin, Def, PluginTrigger, Plugins, Setting } | ||
import sbt.Keys.insideCI | ||
|
||
object PekkoDevelocityPlugin extends AutoPlugin { | ||
|
||
private val ApacheDevelocityUrl = url("https://ge.apache.org") | ||
private val PekkoProjectId = ProjectId("pekko") | ||
private val ObfuscatedIPv4Address = "0.0.0.0" | ||
|
||
override lazy val trigger: PluginTrigger = allRequirements | ||
override lazy val requires: Plugins = DevelocityPlugin | ||
|
||
override lazy val buildSettings: Seq[Setting[_]] = Def.settings( | ||
develocityConfiguration := { | ||
val isInsideCI = insideCI.value | ||
|
||
val original = develocityConfiguration.value | ||
val apacheDevelocityConfiguration = | ||
original | ||
.withProjectId(PekkoProjectId) | ||
.withServer( | ||
original.server | ||
.withUrl(Some(ApacheDevelocityUrl)) | ||
.withAllowUntrusted(false)) | ||
.withBuildScan( | ||
original.buildScan | ||
.withPublishing(Publishing.onlyIf(_.authenticated)) | ||
.withBackgroundUpload(!isInsideCI) | ||
.withObfuscation( | ||
original.buildScan.obfuscation | ||
.withIpAddresses(_.map(_ => ObfuscatedIPv4Address)))) | ||
if (isInsideCI) { | ||
apacheDevelocityConfiguration | ||
.withTestRetryConfiguration( | ||
original.testRetryConfiguration | ||
.withMaxRetries(1) | ||
.withFlakyTestPolicy(FlakyTestPolicy.Fail) // preserve the original build outcome in case of flaky tests | ||
) | ||
} else apacheDevelocityConfiguration | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters