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

Add CI check for demo script #1690

Merged
merged 5 commits into from
Mar 23, 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
70 changes: 70 additions & 0 deletions .github/workflows/plugin_install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Plugin Install

on: [push, pull_request, workflow_dispatch]

env:
OPENSEARCH_VERSION: "1.4.0"
cliu123 marked this conversation as resolved.
Show resolved Hide resolved

jobs:
plugin_install:
name: Plugin Install
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
jdk: [8, 11, 14]

steps:
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.jdk }}

- name: Checkout security
uses: actions/checkout@v2

- name: Build
run: ./gradlew clean assemble -Dbuild.snapshot=false

- name: Download OpenSearch Core
run: |
wget https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/${{env.OPENSEARCH_VERSION}}/latest/linux/x64/builds/opensearch/dist/opensearch-min-${{env.OPENSEARCH_VERSION}}-linux-x64.tar.gz
tar -xzf opensearch-*.tar.gz
rm -f opensearch-*.tar.gz

- name: Move and rename security plugin for installation
run: mv build/distributions/opensearch-security-*.0.zip opensearch-security.zip

- name: Run OpenSearch with plugin
run: |
cat > os-ep.sh <<EOF
peternied marked this conversation as resolved.
Show resolved Hide resolved
yes | opensearch-plugin install file:///docker-host/security-plugin.zip
chmod +x plugins/opensearch-security/tools/install_demo_configuration.sh
yes | plugins/opensearch-security/tools/install_demo_configuration.sh
chown 1001:1001 -R /opensearch
su -c "/opensearch/bin/opensearch" -s /bin/bash opensearch
EOF
docker build -t opensearch-test:latest -f- . <<EOF
FROM ubuntu:latest
COPY --chown=1001:1001 os-ep.sh /docker-host/
COPY --chown=1001:1001 opensearch-security.zip /docker-host/security-plugin.zip
COPY --chown=1001:1001 opensearch* /opensearch/
RUN chmod +x /docker-host/os-ep.sh
RUN useradd -u 1001 -s /sbin/nologin opensearch
ENV PATH="/opensearch/bin:${PATH}"
WORKDIR /opensearch/
ENTRYPOINT /docker-host/os-ep.sh
EOF
docker run --name ops -d -p 9200:9200 -p 9600:9600 -i opensearch-test:latest

- name: Sleep while OpenSearch finishes starting up
uses: whatnick/wait-action@v0.1.2
with:
time: '30s'

- name: Check OpenSearch Running
run: curl -XGET https://localhost:9200 -u 'admin:admin' -k -v

- name: Get Docker Logs
peternied marked this conversation as resolved.
Show resolved Hide resolved
if: always()
run: docker logs ops
peternied marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ repositories {
}

ext {
opensearch_version = System.getProperty("opensearch.version", "1.3.0-SNAPSHOT")
opensearch_version = System.getProperty("opensearch.version", "1.4.0-SNAPSHOT")
cliu123 marked this conversation as resolved.
Show resolved Hide resolved
}

configurations.all {
Expand Down