Skip to content

Commit

Permalink
Get bwc version dynamically (#987)
Browse files Browse the repository at this point in the history
* get bwc version dynamiclly

Signed-off-by: Hailong Cui <[email protected]>

* fix glibc2.28/2.29 not found

Signed-off-by: Hailong Cui <[email protected]>

---------

Signed-off-by: Hailong Cui <[email protected]>
  • Loading branch information
Hailong-am authored Feb 11, 2025
1 parent 20800df commit da61023
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/notifications-test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ name: Test and Build Notifications

on: [push, pull_request]

env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true

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


steps:
- name: Run start commands
run: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-start-command }}

- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: temurin # Temurin is a distribution of adoptium
java-version: ${{ matrix.java }}
Expand Down
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 da61023

Please sign in to comment.