mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-16 18:04:52 +00:00
Co-authored-by: Huan Jiang <huanji@amazon.com> Signed-off-by: Peter Nied <petern@amazon.com>
This commit is contained in:
parent
0d1e9a7b64
commit
55b8ab4338
@ -78,15 +78,6 @@ if (USE_ARTIFACTORY) {
|
||||
}
|
||||
}
|
||||
|
||||
projectsLoaded {
|
||||
rootProject {
|
||||
project.pluginManager.withPlugin('com.gradle.build-scan') {
|
||||
buildScan.server = 'https://gradle-enterprise.elastic.co'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
final String buildCacheUrl = System.getProperty('org.elasticsearch.build.cache.url')
|
||||
final boolean buildCachePush = Boolean.valueOf(System.getProperty('org.elasticsearch.build.cache.push', 'false'))
|
||||
|
||||
|
@ -35,7 +35,6 @@
|
||||
fail: true
|
||||
- ansicolor
|
||||
- timestamps
|
||||
- gradle-build-scan
|
||||
properties:
|
||||
- github:
|
||||
url: https://github.com/elastic/elasticsearch/
|
||||
|
@ -39,7 +39,6 @@ plugins {
|
||||
id "com.diffplug.spotless" version "5.6.1" apply false
|
||||
}
|
||||
|
||||
apply from: 'gradle/build-scan.gradle'
|
||||
apply from: 'gradle/build-complete.gradle'
|
||||
apply from: 'gradle/runtime-jdk-provision.gradle'
|
||||
apply from: 'gradle/ide.gradle'
|
||||
|
@ -19,76 +19,4 @@ buildScan {
|
||||
if (BuildParams.inFipsJvm) {
|
||||
tag 'FIPS'
|
||||
}
|
||||
|
||||
// Automatically publish scans from Elasticsearch CI
|
||||
if (jenkinsUrl?.host?.endsWith('elastic.co')) {
|
||||
publishAlways()
|
||||
buildScan.server = 'https://gradle-enterprise.elastic.co'
|
||||
}
|
||||
|
||||
// Link to Jenkins worker logs and system metrics
|
||||
if (nodeName) {
|
||||
link 'System logs', "https://infra-stats.elastic.co/app/infra#/logs?" +
|
||||
"&logFilter=(expression:'host.name:${nodeName}',kind:kuery)"
|
||||
buildFinished {
|
||||
link 'System metrics', "https://infra-stats.elastic.co/app/infra#/metrics/host/" +
|
||||
"${nodeName}?_g=()&metricTime=(autoReload:!f,refreshInterval:5000," +
|
||||
"time:(from:${startTime - TimeUnit.MILLISECONDS.convert(5, TimeUnit.MINUTES)},interval:%3E%3D1m," +
|
||||
"to:${System.currentTimeMillis() + TimeUnit.MILLISECONDS.convert(5, TimeUnit.MINUTES)}))"
|
||||
}
|
||||
}
|
||||
|
||||
// Jenkins-specific build scan metadata
|
||||
if (jenkinsUrl) {
|
||||
// Disable async upload in CI to ensure scan upload completes before CI agent is terminated
|
||||
uploadInBackground = false
|
||||
|
||||
// Parse job name in the case of matrix builds
|
||||
// Matrix job names come in the form of "base-job-name/matrix_param1=value1,matrix_param2=value2"
|
||||
def splitJobName = jobName.split('/')
|
||||
if (splitJobName.length > 1 && splitJobName.last() ==~ /^([a-zA-Z0-9_\-]+=[a-zA-Z0-9_\-&\.]+,?)+$/) {
|
||||
def baseJobName = splitJobName.dropRight(1).join('/')
|
||||
tag baseJobName
|
||||
tag splitJobName.last()
|
||||
value 'Job Name', baseJobName
|
||||
def matrixParams = splitJobName.last().split(',')
|
||||
matrixParams.collect { it.split('=') }.each { param ->
|
||||
value "MATRIX_${param[0].toUpperCase()}", param[1]
|
||||
}
|
||||
} else {
|
||||
tag jobName
|
||||
value 'Job Name', jobName
|
||||
}
|
||||
|
||||
tag 'CI'
|
||||
link 'Jenkins Build', buildUrl
|
||||
link 'GCP Upload', "https://console.cloud.google.com/storage/elasticsearch-ci-artifacts/jobs/${jobName}/build/${buildNumber}.tar.bz2"
|
||||
value 'Job Number', buildNumber
|
||||
|
||||
System.getenv().getOrDefault('NODE_LABELS', '').split(' ').each {
|
||||
value 'Jenkins Worker Label', it
|
||||
}
|
||||
|
||||
// Add SCM information
|
||||
def isPrBuild = System.getenv('ROOT_BUILD_CAUSE_GHPRBCAUSE') != null
|
||||
if (isPrBuild) {
|
||||
value 'Git Commit ID', System.getenv('ghprbActualCommit')
|
||||
value 'Git Branch', System.getenv('ghprbTargetBranch')
|
||||
tag System.getenv('ghprbTargetBranch')
|
||||
tag "pr/${System.getenv('ghprbPullId')}"
|
||||
tag 'pull-request'
|
||||
link 'Source', "https://github.com/elastic/elasticsearch/tree/${System.getenv('ghprbActualCommit')}"
|
||||
link 'Pull Request', System.getenv('ghprbPullLink')
|
||||
} else {
|
||||
if (System.getenv('GIT_BRANCH')) {
|
||||
def branch = System.getenv('GIT_BRANCH').split('/').last()
|
||||
value 'Git Branch', branch
|
||||
tag branch
|
||||
}
|
||||
value 'Git Commit ID', BuildParams.gitRevision
|
||||
link 'Source', "https://github.com/elastic/elasticsearch/tree/${BuildParams.gitRevision}"
|
||||
}
|
||||
} else {
|
||||
tag 'LOCAL'
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user