Skip to content

Commit

Permalink
Cleanup build-scan, remove publish scan to elastic server (#1) (#4)
Browse files Browse the repository at this point in the history
Co-authored-by: Huan Jiang <[email protected]>
Signed-off-by: Peter Nied <[email protected]>
  • Loading branch information
2 people authored and peternied committed Mar 13, 2021
1 parent 0d1e9a7 commit 55b8ab4
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 83 deletions.
9 changes: 0 additions & 9 deletions .ci/init.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'))

Expand Down
1 change: 0 additions & 1 deletion .ci/jobs.t/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
fail: true
- ansicolor
- timestamps
- gradle-build-scan
properties:
- github:
url: https://github.com/elastic/elasticsearch/
Expand Down
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
72 changes: 0 additions & 72 deletions gradle/build-scan.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}

0 comments on commit 55b8ab4

Please sign in to comment.