Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix snapshot build and upgrade to OpenSearch 1.1. #139

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 23 additions & 14 deletions .github/workflows/reports-scheduler-test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ name: Test and Build Reports Scheduler
on: [push, pull_request]

env:
OPENSEARCH_VERSION: '1.0'
COMMON_UTILS_VERSION: '1.0'
JOB_SCHEDULER_VERSION: '1.0'
OPENSEARCH_VERSION: '1.1.0-SNAPSHOT'
OPENSEARCH_BRANCH: '1.x'
COMMON_UTILS_BRANCH: 'main'
JOB_SCHEDULER_BRANCH: 'main'

jobs:
build:
Expand All @@ -17,47 +18,55 @@ jobs:
with:
java-version: 1.14

# dependencies: OpenSearch
# reports-scheduler
- name: Checkout Reports Scheduler
uses: actions/checkout@v2

# dependencies: OpenSearch
- name: Checkout OpenSearch
uses: actions/checkout@v2
with:
repository: 'opensearch-project/OpenSearch'
path: OpenSearch
ref: ${{ env.OPENSEARCH_VERSION }}
ref: ${{ env.OPENSEARCH_BRANCH }}
- 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'
ref: ${{ env.COMMON_UTILS_VERSION }}
path: common-utils
ref: ${{ env.COMMON_UTILS_BRANCH }}
- name: Build common-utils
working-directory: ./common-utils
run: ./gradlew publishToMavenLocal -Dopensearch.version=${{ env.OPENSEARCH_VERSION }}.0
run: ./gradlew publishToMavenLocal -Dopensearch.version=${{ env.OPENSEARCH_VERSION }}

# dependencies: job-scheduler
- name: Checkout job-scheduler
uses: actions/checkout@v2
with:
repository: 'opensearch-project/job-scheduler'
ref: ${{ env.JOB_SCHEDULER_VERSION }}
ref: ${{ env.JOB_SCHEDULER_BRANCH }}
path: job-scheduler
- name: Build job-scheduler
working-directory: ./job-scheduler
run: ./gradlew publishToMavenLocal -Dopensearch.version=${{ env.OPENSEARCH_VERSION }}.0 -Dbuild.snapshot=false
run: ./gradlew publishToMavenLocal -Dopensearch.version=${{ env.OPENSEARCH_VERSION }}
- name: Assemble job-scheduler
working-directory: ./job-scheduler
run: |
./gradlew assemble -Dopensearch.version=${{ env.OPENSEARCH_VERSION }}
mkdir -p ../reports-scheduler/src/test/resources/job-scheduler
cp ./build/distributions/*.zip ../reports-scheduler/src/test/resources/job-scheduler
ls ../reports-scheduler/src/test/resources/job-scheduler

# reports-scheduler
- name: Checkout Reports Scheduler
uses: actions/checkout@v2

- name: Build with Gradle
run: |
cd reports-scheduler
./gradlew build -Dopensearch.version=${{ env.OPENSEARCH_VERSION }}.0
./gradlew build -Dopensearch.version=${{ env.OPENSEARCH_VERSION }}

- name: Upload coverage
uses: codecov/codecov-action@v1
Expand Down
18 changes: 9 additions & 9 deletions reports-scheduler/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ import java.util.concurrent.Callable
buildscript {
ext {
opensearch_group = "org.opensearch"
opensearch_version = System.getProperty("opensearch.version", "1.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)
job_scheduler_version = System.getProperty("job_scheduler.version", opensearch_build)
kotlin_version = System.getProperty("kotlin.version", "1.4.0")
common_utils_version = "1.0.0.0"
job_scheduler_version = "1.0.0.0"
}

repositories {
Expand Down Expand Up @@ -109,11 +111,6 @@ ext {
licenseFile = rootProject.file('LICENSE.txt')
noticeFile = rootProject.file('NOTICE.txt')
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
opensearchVersion = "${version}.0"
}

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

plugins.withId('java') {
Expand All @@ -126,7 +123,10 @@ plugins.withId('org.jetbrains.kotlin.jvm') {

allprojects {
group = "org.opensearch"
version = "${opensearchVersion}"
version = "${opensearch_version}" - "-SNAPSHOT" + ".0"
if (isSnapshot) {
version += "-SNAPSHOT"
}
plugins.withId('java') {
sourceCompatibility = targetCompatibility = "1.8"
}
Expand Down
28 changes: 0 additions & 28 deletions reports-scheduler/gradle.properties

This file was deleted.

Binary file not shown.