Skip to content

Commit

Permalink
Keep version upgrade test working past v2 (#2106)
Browse files Browse the repository at this point in the history
  • Loading branch information
peternied authored Sep 28, 2022
1 parent 00f152b commit aeb7ab5
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,16 @@ jobs:

- run: ./gradlew clean assemble -Dbuild.version_qualifier=${{ env.TEST_QUALIFIER }} && test -s ./build/distributions/opensearch-security-${{ env.SECURITY_PLUGIN_VERSION_ONLY_NUMBER }}-${{ env.TEST_QUALIFIER }}-SNAPSHOT.zip

- run: |
## EXISTING_OS_VERSION outputs the major version, example as 2
EXISTING_OS_VERSION=$(./gradlew properties | grep opensearch.version | cut -d':' -f2- | awk '{$1=$1};1' | cut -d '-' -f1 | cut -d '.' -f1)
## INCREMENT_OS_VERSION in an increment of 1, example if EXISTING_OS_VERSION is 2, INCREMENT_OS_VERSION is 3
INCREMENT_OS_VERSION=$((++EXISTING_OS_VERSION))
./gradlew clean updateVersion -DnewVersion=$INCREMENT_OS_VERSION.0.0-SNAPSHOT
test `./gradlew properties | grep opensearch.version | cut -d':' -f2- | awk '{$1=$1};1'` = $INCREMENT_OS_VERSION.0.0-SNAPSHOT
- name: Verify updateVersion gradle tasks works
env:
ExpectedVersionString: "opensearch_version: 2.1.0-SNAPSHOT"
run: |
## Make sure the current doesn't match the test version
test "$(./gradlew properties | grep opensearch.version)" != "$ExpectedVersionString"
## Update the new version to 2.1.0
./gradlew clean updateVersion -DnewVersion=2.1.0-SNAPSHOT
## Make sure the version matches expectation
test "$(./gradlew properties | grep opensearch.version)" = "$ExpectedVersionString"
- name: List files in the build directory if there was an error
run: ls -al ./build/distributions/
Expand Down

0 comments on commit aeb7ab5

Please sign in to comment.