Skip to content

Commit

Permalink
[Release 1.3.5] Version increment (#640)
Browse files Browse the repository at this point in the history
Signed-off-by: prudhvigodithi <[email protected]>
  • Loading branch information
prudhvigodithi authored Aug 16, 2022
1 parent a1d4073 commit b6476e0
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 12 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,28 @@ jobs:

- name: Assemble anomaly-detection
run: |
./gradlew assemble -Dopensearch.version=1.3.4-SNAPSHOT
echo "Creating ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/1.3.4.0-SNAPSHOT ..."
mkdir -p ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/1.3.4.0-SNAPSHOT
echo "Copying ./build/distributions/*.zip to ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/1.3.4.0-SNAPSHOT ..."
./gradlew assemble -Dopensearch.version=1.3.5-SNAPSHOT
echo "Creating ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/1.3.5.0-SNAPSHOT ..."
mkdir -p ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/1.3.5.0-SNAPSHOT
echo "Copying ./build/distributions/*.zip to ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/1.3.5.0-SNAPSHOT ..."
ls ./build/distributions/
cp ./build/distributions/*.zip ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/1.3.4.0-SNAPSHOT
echo "Copied ./build/distributions/*.zip to ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/1.3.4.0-SNAPSHOT ..."
ls ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/1.3.4.0-SNAPSHOT
cp ./build/distributions/*.zip ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/1.3.5.0-SNAPSHOT
echo "Copied ./build/distributions/*.zip to ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/1.3.5.0-SNAPSHOT ..."
ls ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/1.3.5.0-SNAPSHOT
- name: Build and Run Tests
run: |
./gradlew build -Dopensearch.version=1.3.4-SNAPSHOT
./gradlew build -Dopensearch.version=1.3.5-SNAPSHOT
- name: Publish to Maven Local
run: |
./gradlew publishToMavenLocal -Dopensearch.version=1.3.4-SNAPSHOT
./gradlew publishToMavenLocal -Dopensearch.version=1.3.5-SNAPSHOT
- name: Multi Nodes Integration Testing
run: |
./gradlew integTest -PnumNodes=3
- name: Pull and Run Docker
run: |
plugin=`ls build/distributions/*.zip`
version=1.3.4
plugin_version=1.3.4.0-SNAPSHOT
version=1.3.5
plugin_version=1.3.5.0-SNAPSHOT
echo Using OpenSearch $version with AD $plugin_version
cd ..
if docker pull opensearchstaging/opensearch:$version
Expand Down
19 changes: 18 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ buildscript {
ext {
opensearch_group = "org.opensearch"
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
opensearch_version = System.getProperty("opensearch.version", "1.3.4-SNAPSHOT")
opensearch_version = System.getProperty("opensearch.version", "1.3.5-SNAPSHOT")
if (isSnapshot) {
plugin_version = opensearch_version.substring(0, opensearch_version.indexOf("-"))
} else {
Expand Down Expand Up @@ -758,3 +758,20 @@ validateNebulaPom.enabled = false
tasks.withType(licenseHeaders.class) {
additionalLicense 'AL ', 'Apache', 'Licensed under the Apache License, Version 2.0 (the "License")'
}

// updateVersion: Task to auto increment to the next development iteration
task updateVersion {
onlyIf { System.getProperty('newVersion') }
doLast {
ext.newVersion = System.getProperty('newVersion')
println "Setting version to ${newVersion}."
// String tokenization to support -SNAPSHOT
ant.replaceregexp(match: opensearch_version.tokenize('-')[0], replace: newVersion.tokenize('-')[0], flags:'g', byline:true) {
fileset(dir: projectDir) {
// Include the required files that needs to be updated with new Version
include(name: ".github/workflows/CI.yml")
}
}
ant.replaceregexp(file:'build.gradle', match: '"opensearch.version", "\\d.*"', replace: '"opensearch.version", "' + newVersion.tokenize('-')[0] + '-SNAPSHOT"', flags:'g', byline:true)
}
}

0 comments on commit b6476e0

Please sign in to comment.