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

Use the published zip for security plugin #455

Merged
merged 1 commit into from
Jul 19, 2022
Merged
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
12 changes: 0 additions & 12 deletions .github/workflows/security-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,6 @@ jobs:
# This step uses the checkout Github action: https://github.com/actions/checkout
- name: Checkout Branch
uses: actions/checkout@v2
# Security plugin dependency
- name: Checkout security
uses: actions/checkout@v2
with:
repository: 'opensearch-project/security'
path: security
ref: 'main'
- name: Build security
working-directory: ./security
run: |
./gradlew clean build -Dbuild.snapshot=false -x test
cp build/distributions/opensearch-security-*.zip ../src/test/resources/security/plugin/opensearch-security.zip
- name: Build and run Replication tests
run: |
ls -al src/test/resources/security/plugin
Expand Down
18 changes: 17 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,22 @@ buildscript {
common_utils_version = System.getProperty("common_utils.version", opensearch_build)
kotlin_version = System.getProperty("kotlin.version", "1.6.0")

// For fetching security zip from Maven.
// https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.1.0/latest/linux/x64/tar/builds/opensearch/plugins/opensearch-security-2.1.0.0.zip
opensearch_no_snapshot = opensearch_version.replace("-SNAPSHOT","")
security_no_snapshot = opensearch_build.replace("-SNAPSHOT","")
security_plugin_path = "build/dependencies/security"
security_plugin_download_url = 'https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/' + opensearch_no_snapshot +
'/latest/linux/x64/tar/builds/opensearch/plugins/opensearch-security-' + security_no_snapshot + '.zip'

}

repositories {
mavenLocal()
mavenCentral()
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://d1nvenhzbhpy0q.cloudfront.net/snapshots/lucene/" }
}

dependencies {
Expand Down Expand Up @@ -209,7 +218,14 @@ def securityPluginFile = new Callable<RegularFile>() {
return new RegularFile() {
@Override
File getAsFile() {
return fileTree("$projectDir/src/test/resources/security/plugin/opensearch-security.zip").getSingleFile()
if (new File("$project.rootDir/$security_plugin_path").exists()) {
project.delete(files("$project.rootDir/$security_plugin_path"))
}
project.mkdir security_plugin_path
ant.get(src: security_plugin_download_url,
dest: security_plugin_path,
httpusecaches: false)
return fileTree(security_plugin_path).getSingleFile()
}
}
}
Expand Down