Skip to content

Commit

Permalink
Rework beats artifacts resolution in docker build (elastic#100157) (e…
Browse files Browse the repository at this point in the history
…lastic#100421)

* Rework metricbeat artifacts resolution to avoid misleading error message
* Pass File object to beats repo uri to workaround parsing problems
  • Loading branch information
breskeby authored Oct 6, 2023
1 parent 4a8a987 commit 41cdc2a
Showing 1 changed file with 25 additions and 19 deletions.
44 changes: 25 additions & 19 deletions distribution/docker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,30 +38,36 @@ repositories {
}
}

if(useDra == false) {
if (useDra == false) {
repositories {
// Cloud builds bundle some beats
ivy {
name = 'beats'
if (useLocalArtifacts) {
url "file://${buildDir}/artifacts/"
patternLayout {
artifact '/[organisation]/[module]-[revision]-[classifier].[ext]'
}
} else {
url "https://artifacts-snapshot.elastic.co/"
patternLayout {
if (VersionProperties.isElasticsearchSnapshot()) {
artifact '/[organization]/[revision]/downloads/[organization]/[module]/[module]-[revision]-[classifier].[ext]'
exclusiveContent {
// Cloud builds bundle some beats
forRepository {
ivy {
name = 'beats'
if (useLocalArtifacts) {
url getLayout().getBuildDirectory().dir("artifacts").get().asFile
patternLayout {
artifact '/[organisation]/[module]-[revision]-[classifier].[ext]'
}
} else {
// When building locally we always use snapshot artifacts even if passing `-Dbuild.snapshot=false`.
// Release builds are always done with a local repo.
artifact '/[organization]/[revision]-SNAPSHOT/downloads/[organization]/[module]/[module]-[revision]-SNAPSHOT-[classifier].[ext]'
url "https://artifacts-snapshot.elastic.co/"
patternLayout {
if (VersionProperties.isElasticsearchSnapshot()) {
artifact '/[organization]/[revision]/downloads/[organization]/[module]/[module]-[revision]-[classifier].[ext]'
} else {
// When building locally we always use snapshot artifacts even if passing `-Dbuild.snapshot=false`.
// Release builds are always done with a local repo.
artifact '/[organization]/[revision]-SNAPSHOT/downloads/[organization]/[module]/[module]-[revision]-SNAPSHOT-[classifier].[ext]'
}
}
}
metadataSources { artifact() }
}
}
metadataSources { artifact() }
content { includeGroup 'beats' }
filter {
includeGroup("beats")
}
}
}
}
Expand Down

0 comments on commit 41cdc2a

Please sign in to comment.