Skip to content

Commit

Permalink
Use the published zip for security plugin (opensearch-project#455)
Browse files Browse the repository at this point in the history
Signed-off-by: Ankit Kala <[email protected]>
  • Loading branch information
ankitkala authored Jul 19, 2022
1 parent 08ad60b commit 27898e2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
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

0 comments on commit 27898e2

Please sign in to comment.