Skip to content

Commit

Permalink
get bwc version dynamiclly
Browse files Browse the repository at this point in the history
Signed-off-by: Hailong Cui <[email protected]>
  • Loading branch information
Hailong-am committed Dec 2, 2024
1 parent 5af90be commit d94f242
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion notifications/notifications/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,21 @@ testClusters.integTest {
}

// Always be minimumCompatibilityVersion of current opensearch version(3.0.0)
def bwcVersionShort = "2.14.0"
// get latest 2.x version from OpenSearch 2.x branch
static def fetchVersionProperties() {
def url = 'https://raw.githubusercontent.com/opensearch-project/OpenSearch/refs/heads/2.x/buildSrc/version.properties'
def content = new URL(url).text
// Use regex to extract the version number
def matcher = content =~ /opensearch\s*=\s*(\d+\.\d+\.\d+)/
if (matcher.find()) {
def version = matcher.group(1)
println("Extracted latest 2.x version: $version")
return version
} else {
return "2.19.0"
}
}
String bwcVersionShort = fetchVersionProperties()
def bwcVersion = bwcVersionShort + ".0"
def bwcOpenSearchVesion= bwcVersionShort + "-SNAPSHOT"
def bwcPluginVersion = bwcVersion + "-SNAPSHOT"
Expand Down

0 comments on commit d94f242

Please sign in to comment.