Clean Up Gradle Enterprise Config
- remove unused file and overridden directive
This commit is contained in:
@@ -1,90 +0,0 @@
|
||||
tagOs()
|
||||
tagIde()
|
||||
tagCiOrLocal()
|
||||
addCiMetadata()
|
||||
addGitMetadata()
|
||||
//addTestTaskMetadata()
|
||||
|
||||
void tagOs() {
|
||||
gradleEnterprise.buildScan.tag System.getProperty('os.name')
|
||||
}
|
||||
|
||||
void tagIde() {
|
||||
if (System.getProperty('idea.version')) {
|
||||
gradleEnterprise.buildScan.tag 'IntelliJ IDEA'
|
||||
} else if (System.getProperty('eclipse.buildId')) {
|
||||
gradleEnterprise.buildScan.tag 'Eclipse'
|
||||
}
|
||||
}
|
||||
|
||||
void tagCiOrLocal() {
|
||||
gradleEnterprise.buildScan.tag(isCi() ? 'CI' : 'LOCAL')
|
||||
}
|
||||
|
||||
void addGitMetadata() {
|
||||
gradleEnterprise.buildScan.background {
|
||||
def gitCommitId = execAndGetStdout('git', 'rev-parse', '--short=8', '--verify', 'HEAD')
|
||||
def gitBranchName = execAndGetStdout('git', 'rev-parse', '--abbrev-ref', 'HEAD')
|
||||
def gitStatus = execAndGetStdout('git', 'status', '--porcelain')
|
||||
|
||||
if(gitCommitId) {
|
||||
def commitIdLabel = 'Git Commit ID'
|
||||
value commitIdLabel, gitCommitId
|
||||
link 'Git commit build scans', customValueSearchUrl([(commitIdLabel): gitCommitId])
|
||||
}
|
||||
if (gitBranchName) {
|
||||
tag gitBranchName
|
||||
value 'Git branch', gitBranchName
|
||||
}
|
||||
if (gitStatus) {
|
||||
tag 'dirty'
|
||||
value 'Git status', gitStatus
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void addCiMetadata() {
|
||||
def ciBuild = 'CI BUILD'
|
||||
if (isBamboo()) {
|
||||
gradleEnterprise.buildScan.link ciBuild, System.getenv('bamboo_resultsUrl')
|
||||
}
|
||||
}
|
||||
|
||||
void addTestTaskMetadata() {
|
||||
allprojects {
|
||||
tasks.withType(Test) { test ->
|
||||
doFirst {
|
||||
gradleEnterprise.buildScan.value "Test#maxParallelForks[${test.path}]", test.maxParallelForks.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
boolean isCi() {
|
||||
isBamboo()
|
||||
}
|
||||
|
||||
boolean isBamboo() {
|
||||
System.getenv('bamboo_resultsUrl')
|
||||
}
|
||||
|
||||
String execAndGetStdout(String... args) {
|
||||
def stdout = new ByteArrayOutputStream()
|
||||
exec {
|
||||
commandLine(args)
|
||||
standardOutput = stdout
|
||||
}
|
||||
return stdout.toString().trim()
|
||||
}
|
||||
|
||||
String customValueSearchUrl(Map<String, String> search) {
|
||||
def query = search.collect { name, value ->
|
||||
"search.names=${encodeURL(name)}&search.values=${encodeURL(value)}"
|
||||
}.join('&')
|
||||
|
||||
"$gradleEnterprise.buildScan.server/scans?$query"
|
||||
}
|
||||
|
||||
String encodeURL(String url) {
|
||||
URLEncoder.encode(url, 'UTF-8')
|
||||
}
|
||||
@@ -11,12 +11,6 @@ plugins {
|
||||
id "io.spring.ge.conventions" version "0.0.13"
|
||||
}
|
||||
|
||||
gradleEnterprise {
|
||||
buildScan {
|
||||
publishOnFailure()
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.name = 'spring-kafka-dist'
|
||||
|
||||
include 'spring-kafka'
|
||||
|
||||
Reference in New Issue
Block a user