Skip to content

Commit

Permalink
Replace checked-in ZIP with a dynamic dependency
Browse files Browse the repository at this point in the history
Signed-off-by: Subhobrata Dey <[email protected]>
  • Loading branch information
sbcd90 committed Apr 20, 2022
1 parent 5e41297 commit 23f667c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
26 changes: 12 additions & 14 deletions alerting/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,12 @@ integTest.getClusters().forEach{c -> c.plugin(project.getObjects().fileProperty(

def _numNodes = findProperty('numNodes') as Integer ?: 1

String notificationsVersion = "2.0.0"
String notificationsQualifier = "rc1"
String notificationsFilePath = "src/test/resources/notifications"
String notificationsCoreFilePath = "src/test/resources/notifications-core"
String notificationsOpenDistroPlugin = "opensearch-notifications-" + notificationsVersion + ".0-" + notificationsQualifier + ".zip"
String notificationsCoreOpenDistroPlugin = "opensearch-notifications-core-" + notificationsVersion + ".0-" + notificationsQualifier + ".zip"
String notificationsRemoteFile = "https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/" + notificationsVersion + "-" + notificationsQualifier + "/latest/linux/x64/tar/builds/opensearch/plugins/" + notificationsOpenDistroPlugin
String notificationsCoreRemoteFile = "https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/" + notificationsVersion + "-" + notificationsQualifier + "/latest/linux/x64/tar/builds/opensearch/plugins/" + notificationsCoreOpenDistroPlugin
String notificationsPlugin = "opensearch-notifications-" + plugin_no_snapshot + ".zip"
String notificationsCorePlugin = "opensearch-notifications-core-" + plugin_no_snapshot + ".zip"
String notificationsRemoteFile = "https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/" + opensearch_no_snapshot + "/latest/linux/x64/tar/builds/opensearch/plugins/" + notificationsPlugin
String notificationsCoreRemoteFile = "https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/" + opensearch_no_snapshot + "/latest/linux/x64/tar/builds/opensearch/plugins/" + notificationsCorePlugin
testClusters.integTest {
testDistribution = "ARCHIVE"
// Cluster shrink exception thrown if we try to set numberOfNodes to 1, so only apply if > 1
Expand All @@ -132,11 +130,11 @@ testClusters.integTest {
dir.mkdirs()
}

File f = new File(dir, notificationsCoreOpenDistroPlugin)
File f = new File(dir, notificationsCorePlugin)
if (!f.exists()) {
new URL(notificationsCoreRemoteFile).withInputStream{ ins -> f.withOutputStream{ it << ins }}
}
fileTree("src/test/resources/notifications-core").getSingleFile()
fileTree(notificationsCoreFilePath).getSingleFile()
}
}
}))
Expand All @@ -151,11 +149,11 @@ testClusters.integTest {
dir.mkdirs()
}

File f = new File(dir, notificationsOpenDistroPlugin)
File f = new File(dir, notificationsPlugin)
if (!f.exists()) {
new URL(notificationsRemoteFile).withInputStream{ ins -> f.withOutputStream{ it << ins }}
}
fileTree("src/test/resources/notifications").getSingleFile()
fileTree(notificationsFilePath).getSingleFile()
}
}
}))
Expand Down Expand Up @@ -257,11 +255,11 @@ task prepareBwcTests {
dir.mkdirs()
}

File f = new File(dir, notificationsCoreOpenDistroPlugin)
File f = new File(dir, notificationsCorePlugin)
if (!f.exists()) {
new URL(notificationsCoreRemoteFile).withInputStream{ ins -> f.withOutputStream{ it << ins }}
}
fileTree("src/test/resources/notifications-core").getSingleFile()
fileTree(notificationsCoreFilePath).getSingleFile()
}
}
}),
Expand All @@ -275,11 +273,11 @@ task prepareBwcTests {
dir.mkdirs()
}

File f = new File(dir, notificationsOpenDistroPlugin)
File f = new File(dir, notificationsPlugin)
if (!f.exists()) {
new URL(notificationsRemoteFile).withInputStream{ ins -> f.withOutputStream{ it << ins }}
}
fileTree("src/test/resources/notifications").getSingleFile()
fileTree(notificationsFilePath).getSingleFile()
}
}
})
Expand Down
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ buildscript {
// 2.0.0-rc1-SNAPSHOT -> 2.0.0.0-rc1-SNAPSHOT
version_tokens = opensearch_version.tokenize('-')
opensearch_build = version_tokens[0] + '.0'
plugin_no_snapshot = opensearch_build
if (buildVersionQualifier) {
opensearch_build += "-${buildVersionQualifier}"
plugin_no_snapshot += "-${buildVersionQualifier}"
}
if (isSnapshot) {
opensearch_build += "-SNAPSHOT"
}
opensearch_no_snapshot = opensearch_version.replace("-SNAPSHOT","")
common_utils_version = System.getProperty("common_utils.version", opensearch_build)
kotlin_version = '1.6.10'
}
Expand Down

0 comments on commit 23f667c

Please sign in to comment.