@@ -73,6 +73,8 @@ public class DistributionDownloadPlugin implements Plugin<Project> {
73
73
private static final String RELEASE_PATTERN_LAYOUT = "/core/opensearch/[revision]/[module]-min-[revision](-[classifier]).[ext]" ;
74
74
private static final String SNAPSHOT_PATTERN_LAYOUT =
75
75
"/snapshots/core/opensearch/[revision]/[module]-min-[revision](-[classifier])-latest.[ext]" ;
76
+ private static final String BUNDLE_PATTERN_LAYOUT =
77
+ "/ci/dbc/distribution-build-opensearch/[revision]/latest/linux/x64/tar/dist/opensearch/[module]-[revision](-[classifier]).[ext]" ;
76
78
77
79
private NamedDomainObjectContainer <OpenSearchDistribution > distributionsContainer ;
78
80
private NamedDomainObjectContainer <DistributionResolution > distributionsResolutionStrategiesContainer ;
@@ -174,20 +176,39 @@ private static void setupDownloadServiceRepo(Project project) {
174
176
return ;
175
177
}
176
178
Object customDistributionUrl = project .findProperty ("customDistributionUrl" );
177
- // checks if custom Distribution Url has been passed by user from plugins
179
+ Object customDistributionDownloadType = project .findProperty ("customDistributionDownloadType" );
180
+ // distributionDownloadType is default min if is not specified; download the distribution from CI if is bundle
181
+ String distributionDownloadType = customDistributionDownloadType != null
182
+ && customDistributionDownloadType .toString ().equals ("bundle" ) ? "bundle" : "min" ;
178
183
if (customDistributionUrl != null ) {
179
184
addIvyRepo (project , DOWNLOAD_REPO_NAME , customDistributionUrl .toString (), FAKE_IVY_GROUP , "" );
180
185
addIvyRepo (project , SNAPSHOT_REPO_NAME , customDistributionUrl .toString (), FAKE_SNAPSHOT_IVY_GROUP , "" );
181
- } else {
182
- addIvyRepo (
183
- project ,
184
- DOWNLOAD_REPO_NAME ,
185
- "https://artifacts.opensearch.org" ,
186
- FAKE_IVY_GROUP ,
187
- "/releases" + RELEASE_PATTERN_LAYOUT ,
188
- "/release-candidates" + RELEASE_PATTERN_LAYOUT
189
- );
190
- addIvyRepo (project , SNAPSHOT_REPO_NAME , "https://artifacts.opensearch.org" , FAKE_SNAPSHOT_IVY_GROUP , SNAPSHOT_PATTERN_LAYOUT );
186
+ return ;
187
+ }
188
+ switch (distributionDownloadType ) {
189
+ case "bundle" :
190
+ addIvyRepo (project , DOWNLOAD_REPO_NAME , "https://ci.opensearch.org" , FAKE_IVY_GROUP , BUNDLE_PATTERN_LAYOUT );
191
+ addIvyRepo (project , SNAPSHOT_REPO_NAME , "https://ci.opensearch.org" , FAKE_SNAPSHOT_IVY_GROUP , BUNDLE_PATTERN_LAYOUT );
192
+ break ;
193
+ case "min" :
194
+ addIvyRepo (
195
+ project ,
196
+ DOWNLOAD_REPO_NAME ,
197
+ "https://artifacts.opensearch.org" ,
198
+ FAKE_IVY_GROUP ,
199
+ "/releases" + RELEASE_PATTERN_LAYOUT ,
200
+ "/release-candidates" + RELEASE_PATTERN_LAYOUT
201
+ );
202
+ addIvyRepo (
203
+ project ,
204
+ SNAPSHOT_REPO_NAME ,
205
+ "https://artifacts.opensearch.org" ,
206
+ FAKE_SNAPSHOT_IVY_GROUP ,
207
+ SNAPSHOT_PATTERN_LAYOUT
208
+ );
209
+ break ;
210
+ default :
211
+ throw new IllegalArgumentException ("Unsupported property argument: " + distributionDownloadType );
191
212
}
192
213
}
193
214
0 commit comments