@@ -2,72 +2,35 @@ name: API Coverage
2
2
3
3
on : [push, pull_request]
4
4
5
- # git clone [email protected] :dblock/OpenSearch.git
6
- # cd OpenSearch
7
- # git remote add upstream [email protected] :opensearch-project/OpenSearch.git
8
- # git fetch upstream --tags
9
- # git checkout 2.11.1
10
- # git checkout -b 2.11.1-api-plugin
11
- # git cherry-pick ffa9ce9d41ac4d8a15b7041b4c8c60c4d3b1cffc
12
- # git push origin 2.11.1-api-plugin
13
-
14
5
env :
15
6
JAVA_VERSION : 11
16
- OPENSEARCH_VERSION : 2.11.1
7
+ OPENSEARCH_VERSION : 2.12.0
8
+ OPENSEARCH_INITIAL_ADMIN_PASSWORD : BobgG7YrtsdKf9M
17
9
18
10
jobs :
19
11
coverage :
20
12
runs-on : ubuntu-latest
21
13
steps :
22
14
- name : Checkout Repo
23
15
uses : actions/checkout@v2
24
- - name : Setup Java
25
- uses : actions/setup-java@v1
26
- with :
27
- java-version : ${{ env.JAVA_VERSION }}
28
- - name : Checkout OpenSearch
29
- uses : actions/checkout@v2
30
- with :
31
- repository : ' opensearch-project/OpenSearch'
32
- path : OpenSearch
33
- ref : ${{ env.OPENSEARCH_VERSION }}
34
- - name : Build OpenSearch
35
- working-directory : ./OpenSearch
36
- run : |
37
- git fetch origin 2.x
38
- git cherry-pick -n c0581a0a3ca37a97bfdffc90f78a7e1b2afd7029 --strategy-option theirs
39
- ./gradlew :server:assemble -Dbuild.snapshot=false
40
- ./gradlew :libs:opensearch-core:assemble -Dbuild.snapshot=false
41
- ./gradlew publishToMavenLocal -Dbuild.snapshot=false
42
- - name : Checkout OpenSearch API Plugin
43
- uses : actions/checkout@v2
44
- with :
45
- repository : ' dblock/opensearch-api'
46
- path : opensearch-api
47
- ref : 2.x
48
- - name : Build API Plugin
49
- working-directory : ./opensearch-api
50
- run : |
51
- ./gradlew assemble -Dopensearch.version=${{ env.OPENSEARCH_VERSION }} -Dbuild.snapshot=false
52
16
- name : Install API Plugin
53
17
run : |
18
+ wget https://github.com/dblock/opensearch-api/releases/download/v${{ env.OPENSEARCH_VERSION }}/opensearch-api-${{ env.OPENSEARCH_VERSION }}.0.zip
54
19
echo "FROM opensearchproject/opensearch:${{ env.OPENSEARCH_VERSION }}" >> Dockerfile
55
- echo "COPY ./OpenSearch/server/build/distributions/opensearch-${{ env.OPENSEARCH_VERSION }}.jar /usr/share/opensearch/lib/" >> Dockerfile
56
- echo "COPY ./OpenSearch/libs/core/build/distributions/opensearch-core-${{ env.OPENSEARCH_VERSION }}.jar /usr/share/opensearch/lib/" >> Dockerfile
57
- echo "ADD ./opensearch-api/build/distributions/opensearch-api-${{ env.OPENSEARCH_VERSION }}.0.zip /tmp/" >> Dockerfile
20
+ echo "ADD ./opensearch-api-${{ env.OPENSEARCH_VERSION }}.0.zip /tmp/" >> Dockerfile
58
21
echo "RUN /usr/share/opensearch/bin/opensearch-plugin install --batch file:/tmp/opensearch-api-${{ env.OPENSEARCH_VERSION }}.0.zip" >> Dockerfile
59
22
cat Dockerfile
60
23
- name : Build and Run Docker Container
61
24
run : |
62
25
docker build . --tag opensearch-with-api-plugin
63
- docker run --detach -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" opensearch-with-api-plugin
26
+ docker run -d -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" -e OPENSEARCH_INITIAL_ADMIN_PASSWORD="${{ env.OPENSEARCH_INITIAL_ADMIN_PASSWORD }} " opensearch-with-api-plugin
64
27
sleep 30
65
28
- name : Display OpenSearch Info
66
29
run : |
67
- curl -u admin:admin --insecure https://localhost:9200/ | jq
30
+ curl -u admin:${{ env.OPENSEARCH_INITIAL_ADMIN_PASSWORD }} --insecure https://localhost:9200/ | jq
68
31
- name : Dump and Compare API
69
32
run : |
70
- curl -u admin:admin --insecure https://localhost:9200/_plugins/api | jq > OpenSearch.auto.openapi.json
33
+ curl -u admin:${{ env.OPENSEARCH_INITIAL_ADMIN_PASSWORD }} --insecure https://localhost:9200/_plugins/api | jq > OpenSearch.auto.openapi.json
71
34
docker run --mount type=bind,source=.,target=/specs openapitools/openapi-diff:latest /specs/OpenSearch.openapi.json /specs/OpenSearch.auto.openapi.json --json /specs/diff.json
72
35
- name : Show Diff
73
36
run : |
0 commit comments