Skip to content

Commit

Permalink
Fix snapshot build, build against OpenSearch 1.1.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock committed Aug 17, 2021
1 parent c081669 commit 388d297
Show file tree
Hide file tree
Showing 10 changed files with 125 additions and 45 deletions.
39 changes: 39 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="bin/main" path="src/main/kotlin">
<attributes>
<attribute name="gradle_scope" value="main"/>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin/main" path="src/main/resources">
<attributes>
<attribute name="gradle_scope" value="main"/>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin/test" path="src/main/plugin-metadata">
<attributes>
<attribute name="gradle_scope" value="test"/>
<attribute name="gradle_used_by_scope" value="test"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin/test" path="src/test/kotlin">
<attributes>
<attribute name="gradle_scope" value="test"/>
<attribute name="gradle_used_by_scope" value="test"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin/test" path="src/test/resources">
<attributes>
<attribute name="gradle_scope" value="test"/>
<attribute name="gradle_used_by_scope" value="test"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin/default"/>
</classpath>
48 changes: 31 additions & 17 deletions .github/workflows/multi-node-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ 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
Expand All @@ -39,32 +39,46 @@ jobs:
ref: 'main'
- name: Build common-utils
working-directory: ./common-utils
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.0.0 -Dbuild.snapshot=false
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.1.0-SNAPSHOT
# index-management
- name: Checkout Branch
uses: actions/checkout@v2
# dependencies: job-scheduler
- name: Checkout job-scheduler
uses: actions/checkout@v2
with:
repository: 'opensearch-project/job-scheduler'
path: job-scheduler
ref: '1.0'
ref: 'main'
- name: Build job-scheduler
working-directory: ./job-scheduler
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.0.0 -Dbuild.snapshot=false
# dependencies: alerting-notification
- name: Checkout alerting
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.1.0-SNAPSHOT
- name: Assemble job-scheduler
working-directory: ./job-scheduler
run: |
./gradlew assemble -Dopensearch.version=1.1.0-SNAPSHOT
mkdir -p ../src/test/resources/job-scheduler
cp ./build/distributions/*.zip ../src/test/resources/job-scheduler
ls ../src/test/resources/job-scheduler
# dependencies: notifications
- name: Checkout notifications
uses: actions/checkout@v2
with:
repository: 'opensearch-project/alerting'
path: alerting
ref: '1.0'
- name: Build alerting
working-directory: ./alerting
run: ./gradlew :alerting-notification:publishToMavenLocal -Dopensearch.version=1.0.0 -Dbuild.snapshot=false
# index-management
- name: Checkout Branch
uses: actions/checkout@v2
repository: 'dblock/notifications'
path: notifications
ref: 'fix-snapshot-build'
- name: Build notifications
working-directory: ./notifications/notifications
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.1.0-SNAPSHOT
- name: Assemble notifications
working-directory: ./notifications/notifications
run: |
./gradlew assemble -Dopensearch.version=1.1.0-SNAPSHOT
mkdir -p ../../src/test/resources/notifications
cp ./notifications/build/distributions/*.zip ../../src/test/resources/notifications
ls ../../src/test/resources/notifications
- name: Run integration tests with multi node config
run: ./gradlew integTest -PnumNodes=3
run: ./gradlew integTest -PnumNodes=3 -Dopensearch.version=1.1.0-SNAPSHOT
- name: Upload failed logs
uses: actions/upload-artifact@v2
if: failure()
Expand Down
49 changes: 32 additions & 17 deletions .github/workflows/test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ 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
Expand All @@ -39,32 +39,47 @@ jobs:
ref: 'main'
- name: Build common-utils
working-directory: ./common-utils
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.0.0 -Dbuild.snapshot=false
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.1.0-SNAPSHOT
# check out index-management
- name: Checkout Branch
uses: actions/checkout@v2
# dependencies: job-scheduler
- name: Checkout job-scheduler
uses: actions/checkout@v2
with:
repository: 'opensearch-project/job-scheduler'
path: job-scheduler
ref: '1.0'
ref: 'main'
- name: Build job-scheduler
working-directory: ./job-scheduler
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.0.0 -Dbuild.snapshot=false
# dependencies: alerting-notification
- name: Checkout alerting
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.1.0-SNAPSHOT
- name: Assemble job-scheduler
working-directory: ./job-scheduler
run: |
./gradlew assemble -Dopensearch.version=1.1.0-SNAPSHOT
mkdir -p ../src/test/resources/job-scheduler
cp ./build/distributions/*.zip ../src/test/resources/job-scheduler
ls ../src/test/resources/job-scheduler
# dependencies: notifications
- name: Checkout notifications
uses: actions/checkout@v2
with:
repository: 'opensearch-project/alerting'
path: alerting
ref: '1.0'
- name: Build alerting
working-directory: ./alerting
run: ./gradlew :alerting-notification:publishToMavenLocal -Dopensearch.version=1.0.0 -Dbuild.snapshot=false
# index-management
- name: Checkout Branch
uses: actions/checkout@v2
repository: 'dblock/notifications'
path: notifications
ref: 'fix-snapshot-build'
- name: Build notifications
working-directory: ./notifications/notifications
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.1.0-SNAPSHOT
- name: Assemble notifications
working-directory: ./notifications/notifications
run: |
./gradlew assemble -Dopensearch.version=1.1.0-SNAPSHOT
mkdir -p ../../src/test/resources/notifications
cp ./notifications/build/distributions/*.zip ../../src/test/resources/notifications
ls ../../src/test/resources/notifications
# build index management
- name: Build with Gradle
run: ./gradlew build
run: ./gradlew build -Dopensearch.version=1.1.0-SNAPSHOT
- name: Upload failed logs
uses: actions/upload-artifact@v2
if: failure()
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ out/
*.iws
.DS_Store
*.log
http
http
.project
.settings
24 changes: 14 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ import java.util.function.Predicate

buildscript {
ext {
opensearch_version = System.getProperty("opensearch.version", "1.0.0")
opensearch_version = System.getProperty("opensearch.version", "1.1.0-SNAPSHOT")
// 1.1.0 -> 1.1.0.0, and 1.1.0-SNAPSHOT -> 1.1.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.version", opensearch_build)
kotlin_version = System.getProperty("kotlin.version", "1.4.0")
}

Expand Down Expand Up @@ -139,25 +143,29 @@ configurations.testCompile {

ext {
projectSubstitutions = [:]
opensearchVersion = "${version}"
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
licenseFile = rootProject.file('LICENSE')
noticeFile = rootProject.file('NOTICE')
}

group = "org.opensearch"
version = "${opensearchVersion}.0"
allprojects {
group = "org.opensearch"
version = "${opensearch_version}" - "-SNAPSHOT" + ".0"
if (isSnapshot) {
version += "-SNAPSHOT"
}
}

dependencies {
compileOnly "org.opensearch:opensearch:${opensearch_version}"
compileOnly "org.opensearch:opensearch-job-scheduler-spi:1.0.0.0"
compileOnly "org.opensearch:opensearch-job-scheduler-spi:${job_scheduler_version}"
compile group: 'commons-codec', name: 'commons-codec', version: '1.13'
compile "org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}"
compile "org.jetbrains.kotlin:kotlin-stdlib-common:${kotlin_version}"
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlin_version}"
compile 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9'
compile "org.jetbrains:annotations:13.0"
compile "org.opensearch:common-utils:1.0.0.0"
compile "org.opensearch:common-utils:${common_utils_version}"
compile "com.github.seancfoley:ipaddress:5.3.3"

testCompile "org.opensearch.test:framework:${opensearch_version}"
Expand All @@ -176,10 +184,6 @@ repositories {
mavenLocal()
}

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

plugins.withId('java') {
sourceCompatibility = targetCompatibility = "1.8"
}
Expand Down
3 changes: 3 additions & 0 deletions src/test/resources/job-scheduler/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Build and copy opensearch-job-scheduler-1.x-SNAPSHOT.zip from https://github.com/opensearch-project/job-scheduler here.

*.zip
Binary file not shown.
3 changes: 3 additions & 0 deletions src/test/resources/notifications/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Build and copy opensearch-notifications-1.x-SNAPSHOT.zip from https://github.com/opensearch-project/notifications/notifications here.

*.zip
Binary file not shown.
Binary file not shown.

0 comments on commit 388d297

Please sign in to comment.