Skip to content

Commit da61023

Browse files
authored
Get bwc version dynamically (#987)
* get bwc version dynamiclly Signed-off-by: Hailong Cui <ihailong@amazon.com> * fix glibc2.28/2.29 not found Signed-off-by: Hailong Cui <ihailong@amazon.com> --------- Signed-off-by: Hailong Cui <ihailong@amazon.com>
1 parent 20800df commit da61023

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

.github/workflows/notifications-test-and-build-workflow.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ name: Test and Build Notifications
77

88
on: [push, pull_request]
99

10-
env:
11-
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
12-
1310
jobs:
1411
Get-CI-Image-Tag:
1512
uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml@main
@@ -31,12 +28,15 @@ jobs:
3128
# using the same image which is used by opensearch-build team to build the OpenSearch Distribution
3229
# this image tag is subject to change as more dependencies and updates will arrive over time
3330
image: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-version-linux }}
34-
# need to switch to root so that github actions can install runner binary on container without permission issues.
35-
options: --user root
31+
options: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-start-options }}
32+
3633

3734
steps:
35+
- name: Run start commands
36+
run: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-start-command }}
37+
3838
- name: Set up JDK ${{ matrix.java }}
39-
uses: actions/setup-java@v2
39+
uses: actions/setup-java@v4
4040
with:
4141
distribution: temurin # Temurin is a distribution of adoptium
4242
java-version: ${{ matrix.java }}

notifications/notifications/build.gradle

+15-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,21 @@ testClusters.integTest {
266266
}
267267

268268
// Always be minimumCompatibilityVersion of current opensearch version(3.0.0)
269-
def bwcVersionShort = "2.14.0"
269+
// get latest 2.x version from OpenSearch 2.x branch
270+
static def fetchVersionProperties() {
271+
def url = 'https://raw.githubusercontent.com/opensearch-project/OpenSearch/refs/heads/2.x/buildSrc/version.properties'
272+
def content = new URL(url).text
273+
// Use regex to extract the version number
274+
def matcher = content =~ /opensearch\s*=\s*(\d+\.\d+\.\d+)/
275+
if (matcher.find()) {
276+
def version = matcher.group(1)
277+
println("Extracted latest 2.x version: $version")
278+
return version
279+
} else {
280+
return "2.19.0"
281+
}
282+
}
283+
String bwcVersionShort = fetchVersionProperties()
270284
def bwcVersion = bwcVersionShort + ".0"
271285
def bwcOpenSearchVesion= bwcVersionShort + "-SNAPSHOT"
272286
def bwcPluginVersion = bwcVersion + "-SNAPSHOT"

0 commit comments

Comments
 (0)