Skip to content

Commit

Permalink
Restore security test to original as it is not good to run dind for d…
Browse files Browse the repository at this point in the history
…ocker

Signed-off-by: Peter Zhu <[email protected]>
  • Loading branch information
peterzhuamazon committed Oct 12, 2023
1 parent b58ec76 commit 6bea0b4
Showing 1 changed file with 8 additions and 19 deletions.
27 changes: 8 additions & 19 deletions .github/workflows/security-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,20 @@ on:
- "*"

jobs:
Get-CI-Image-Tag:
uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml@main
with:
product: opensearch

build-linux:
needs: Get-CI-Image-Tag
build:
strategy:
matrix:
java: [ 11, 17 ]
# Job name
name: Build and test Alerting
# This job runs on Linux
runs-on: ubuntu-latest
container:
# using the same image which is used by opensearch-build team to build the OpenSearch Distribution
# this image tag is subject to change as more dependencies and updates will arrive over time
image: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-version-linux }}
# need to switch to root so that github actions can install runner binary on container without permission issues.
options: --user root

steps:
# This step uses the setup-java Github action: https://github.com/actions/setup-java
- name: Set Up JDK ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
# This step uses the checkout Github action: https://github.com/actions/checkout
- name: Checkout Branch
uses: actions/checkout@v2
Expand All @@ -41,9 +33,7 @@ jobs:
java-version: ${{ matrix.java }}
- name: Build Alerting
# Only assembling since the full build is governed by other workflows
run: |
chown -R opensearch.opensearch `pwd`
su opensearch -c "whoami && java -version && ./gradlew assemble"
run: ./gradlew assemble
- name: Pull and Run Docker
run: |
plugin=`basename $(ls alerting/build/distributions/*.zip)`
Expand Down Expand Up @@ -96,8 +86,7 @@ jobs:
if [ $security -gt 0 ]
then
echo "Security plugin is available"
chown -R opensearch.opensearch `pwd`
su opensearch -c "whoami && java -version && ./gradlew :alerting:integTest -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername=docker-cluster -Dsecurity=true -Dhttps=true -Duser=admin -Dpassword=admin"
./gradlew :alerting:integTest -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername=docker-cluster -Dsecurity=true -Dhttps=true -Duser=admin -Dpassword=admin
else
echo "Security plugin is NOT available skipping this run as tests without security have already been run"
fi

0 comments on commit 6bea0b4

Please sign in to comment.