@@ -31,7 +31,7 @@ dependencies {
31
31
ossDockerSource project(path : " :distribution:archives:oss-linux-tar" )
32
32
}
33
33
34
- ext. expansions = { Architecture architecture , boolean oss , boolean ubi , boolean local ->
34
+ ext. expansions = { Architecture architecture , boolean oss , boolean ubi , boolean local , Project p ->
35
35
String classifier
36
36
if (local || ubi) {
37
37
switch (architecture) {
@@ -82,7 +82,7 @@ RUN curl --retry 8 -S -L \\
82
82
' license' : oss ? ' Apache-2.0' : ' Elastic-License' ,
83
83
' source_elasticsearch' : sourceElasticsearch,
84
84
' version' : VersionProperties . elasticsearch,
85
- ' version_hash' : ubi ? getChecksum(configurations. dockerSource. singleFile) : ' '
85
+ ' version_hash' : ubi ? getChecksum(p . configurations. dockerSource. singleFile) : ' '
86
86
]
87
87
}
88
88
@@ -122,9 +122,9 @@ private static String taskName(final String prefix, final Architecture architect
122
122
}
123
123
124
124
project. ext {
125
- dockerBuildContext = { Architecture architecture , boolean oss , boolean ubi , boolean local ->
125
+ dockerBuildContext = { Architecture architecture , boolean oss , boolean ubi , boolean local , Project p ->
126
126
copySpec {
127
- final Map<String ,String > varExpansions = expansions(architecture, oss, ubi, local)
127
+ final Map<String ,String > varExpansions = expansions(architecture, oss, ubi, local, p )
128
128
final Path projectDir = project. projectDir. toPath()
129
129
130
130
if (ubi) {
@@ -164,12 +164,12 @@ project.ext {
164
164
165
165
void addCopyDockerContextTask (final Architecture architecture , final boolean oss ) {
166
166
task(taskName(" copy" , architecture, oss, " DockerContext" ), type : Sync ) {
167
- expansions(architecture, oss, false , true ). findAll { it. key != ' build_date' }. each { k , v ->
167
+ expansions(architecture, oss, false , true , project ). findAll { it. key != ' build_date' }. each { k , v ->
168
168
inputs. property(k, { v. toString() })
169
169
}
170
170
into buildPath(architecture, oss)
171
171
172
- with dockerBuildContext(architecture, oss, false , true )
172
+ with dockerBuildContext(architecture, oss, false , true , project )
173
173
174
174
if (architecture == Architecture . AARCH64 ) {
175
175
if (oss) {
@@ -300,6 +300,16 @@ if (tasks.findByName("composePull")) {
300
300
* that they can be easily reloaded, for example into a VM for distribution testing
301
301
*/
302
302
subprojects { Project subProject ->
303
+ if (subProject. name. endsWith(' -context' )) {
304
+ configurations {
305
+ dockerSource
306
+ }
307
+
308
+ dependencies {
309
+ dockerSource project(path : " :distribution:archives:linux-tar" )
310
+ }
311
+ }
312
+
303
313
if (subProject. name. endsWith(' -export' )) {
304
314
apply plugin : ' distribution'
305
315
0 commit comments