Skip to content

Commit

Permalink
Fix snapshot build and increment to 1.1.0. (opensearch-project#142)
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock authored Aug 17, 2021
1 parent ff57c54 commit 751aabd
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 27 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/multi-node-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ jobs:
with:
repository: 'opensearch-project/OpenSearch'
path: OpenSearch
ref: '1.0'
ref: '1.x'
- name: Build OpenSearch
working-directory: ./OpenSearch
run: ./gradlew publishToMavenLocal -Dbuild.snapshot=false
run: ./gradlew publishToMavenLocal
# This step adds dependency, common-utils
- name: Checkout common-utils
uses: actions/checkout@v2
with:
repository: 'opensearch-project/common-utils'
path: common-utils
ref: '1.0'
ref: 'main'
- name: Build common-utils
working-directory: ./common-utils
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.0.0
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.1.0-SNAPSHOT
# This step uses the checkout Github action: https://github.com/actions/checkout
- name: Checkout Branch
uses: actions/checkout@v2
Expand All @@ -52,7 +52,7 @@ jobs:
with:
java-version: 14
- name: Run integration tests with multi node config
run: ./gradlew integTest -PnumNodes=3 -Dopensearch.version=1.0.0 -Dbuild.snapshot=false
run: ./gradlew integTest -PnumNodes=3 -Dopensearch.version=1.1.0-SNAPSHOT
- name: Pull and Run Docker
run: |
plugin=`ls alerting/build/distributions/*.zip`
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,24 @@ jobs:
with:
repository: 'opensearch-project/OpenSearch'
path: OpenSearch
ref: '1.0'
ref: '1.x'
- name: Build OpenSearch
working-directory: ./OpenSearch
run: ./gradlew publishToMavenLocal -Dbuild.snapshot=false
run: ./gradlew publishToMavenLocal

# dependencies: common-utils
- name: Checkout common-utils
uses: actions/checkout@v2
with:
repository: 'opensearch-project/common-utils'
path: common-utils
ref: '1.0'
ref: 'main'
- name: Build common-utils
working-directory: ./common-utils
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.0.0
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.1.0-SNAPSHOT

- name: Build and run with Gradle
run: ./gradlew build -Dopensearch.version=1.0.0
run: ./gradlew build -Dopensearch.version=1.1.0-SNAPSHOT

# - name: Create Artifact Path
# run: |
Expand All @@ -71,4 +71,4 @@ jobs:
# path: alerting-artifacts
# Publish to local maven
- name: Publish to Maven Local
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.0.0
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.1.0-SNAPSHOT
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ build/
.DS_Store
*.log
out/
.project
.settings
.vscode
5 changes: 0 additions & 5 deletions alerting/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,12 @@ apply plugin: 'jacoco'
def usingRemoteCluster = System.properties.containsKey('tests.rest.cluster') || System.properties.containsKey('tests.cluster')
def usingMultiNode = project.properties.containsKey('numNodes')


ext {
projectSubstitutions = [:]
licenseFile = rootProject.file('LICENSE.txt')
noticeFile = rootProject.file('NOTICE.txt')
}

if (isSnapshot) {
version += "-SNAPSHOT"
}

opensearchplugin {
name 'opensearch-alerting'
description 'Amazon OpenSearch alerting plugin'
Expand Down
22 changes: 11 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ buildscript {
apply from: 'build-tools/repositories.gradle'

ext {
opensearch_version = System.getProperty("opensearch.version", "1.0.0")
common_utils_version = '1.0.0.0'
opensearch_version = System.getProperty("opensearch.version", "1.1.0-SNAPSHOT")
// 1.0.0 -> 1.0.0.0, and 1.0.0-SNAPSHOT -> 1.0.0.0-SNAPSHOT
opensearch_build = opensearch_version.replaceAll(/(\.\d)([^\d]*)$/, '$1.0$2')
common_utils_version = System.getProperty("common_utils.version", opensearch_build)
kotlin_version = '1.3.72'
}

Expand All @@ -45,7 +47,6 @@ buildscript {
}
}


plugins {
id 'nebula.ospackage' version "8.3.0" apply false
id "com.dorongold.task-tree" version "1.5"
Expand All @@ -55,11 +56,6 @@ apply plugin: 'base'
apply plugin: 'jacoco'
apply from: 'build-tools/merged-coverage.gradle'

ext {
opendistroVersion = "${version}"
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
}

configurations {
ktlint
}
Expand Down Expand Up @@ -88,12 +84,16 @@ task ktlintFormat(type: JavaExec, group: "formatting") {

check.dependsOn ktlint

ext {
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
}

allprojects {
group = "org.opensearch"
// Increment the final digit when there's a new plugin versions for the same opendistro version
// Reset the final digit to 0 when upgrading to a new opendistro version
version = "${opendistroVersion}.0"
version = "${opensearch_version}" - "-SNAPSHOT" + ".0"
if (isSnapshot) {
version += "-SNAPSHOT"
}

apply from: "$rootDir/build-tools/repositories.gradle"

Expand Down

0 comments on commit 751aabd

Please sign in to comment.