Skip to content

Commit

Permalink
Revert "Fix snapshot build and upgrade to OpenSearch 1.1. (opensearch…
Browse files Browse the repository at this point in the history
…-project#140)"

This reverts commit edc55c0.
  • Loading branch information
zhongnansu committed Nov 11, 2021
1 parent 11e9751 commit ca49eb8
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 21 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/reports-scheduler-test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ name: Test and Build Reports Scheduler
on: [push, pull_request]

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

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

# dependencies: OpenSearch
# dependencies: OpenSearch
- name: Checkout OpenSearch
uses: actions/checkout@v2
with:
repository: 'opensearch-project/OpenSearch'
path: OpenSearch
ref: ${{ env.OPENSEARCH_BRANCH }}
ref: ${{ env.OPENSEARCH_VERSION }}
- name: Build OpenSearch
working-directory: ./OpenSearch
run: ./gradlew publishToMavenLocal
run: ./gradlew publishToMavenLocal -Dbuild.snapshot=false

# 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 }}
run: ./gradlew publishToMavenLocal -Dopensearch.version=${{ env.OPENSEARCH_VERSION }}.0

# dependencies: job-scheduler
- name: Checkout job-scheduler
uses: actions/checkout@v2
with:
repository: 'opensearch-project/job-scheduler'
ref: ${{ env.JOB_SCHEDULER_BRANCH }}
ref: ${{ env.JOB_SCHEDULER_VERSION }}
path: job-scheduler
- name: Build job-scheduler
working-directory: ./job-scheduler
run: ./gradlew publishToMavenLocal -Dopensearch.version=${{ env.OPENSEARCH_VERSION }}
run: ./gradlew publishToMavenLocal -Dopensearch.version=${{ env.OPENSEARCH_VERSION }}.0 -Dbuild.snapshot=false

# reports-scheduler
- name: Checkout Reports Scheduler
Expand All @@ -58,7 +57,7 @@ jobs:
- name: Build with Gradle
run: |
cd reports-scheduler
./gradlew build -Dopensearch.version=${{ env.OPENSEARCH_VERSION }}
./gradlew build -Dopensearch.version=${{ env.OPENSEARCH_VERSION }}.0
- 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,12 +30,10 @@ import java.util.concurrent.Callable
buildscript {
ext {
opensearch_group = "org.opensearch"
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)
opensearch_version = System.getProperty("opensearch.version", "1.0.0")
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 @@ -111,6 +109,11 @@ 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 @@ -123,10 +126,7 @@ plugins.withId('org.jetbrains.kotlin.jvm') {

allprojects {
group = "org.opensearch"
version = "${opensearch_version}" - "-SNAPSHOT" + ".0"
if (isSnapshot) {
version += "-SNAPSHOT"
}
version = "${opensearchVersion}"
plugins.withId('java') {
sourceCompatibility = targetCompatibility = "1.8"
}
Expand Down
28 changes: 28 additions & 0 deletions reports-scheduler/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
##
# SPDX-License-Identifier: Apache-2.0
#
# The OpenSearch Contributors require contributions made to
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.
#
# Modifications Copyright OpenSearch Contributors. See
# GitHub history for details.
##

##
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license" file accompanying this file. This file is distributed
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
#
##

version = 1.0.0
Binary file not shown.
Binary file not shown.

0 comments on commit ca49eb8

Please sign in to comment.