Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
6a41de9
feat: json schema check
johzchen Oct 11, 2020
5f9afcc
fix: don't need to define struct for each resource, because that may …
johzchen Oct 11, 2020
a516f72
test: add handler test cases
johzchen Oct 11, 2020
5f5bb3f
test: complete consumer test cases
johzchen Oct 11, 2020
0421b23
test: add test cases for schema check
johzchen Oct 11, 2020
59e0ec0
fix code style and license
johzchen Oct 11, 2020
18561f5
feat: add schema check for plugins
johzchen Oct 12, 2020
4eab359
test: add ssl handler test cases
johzchen Oct 12, 2020
d2fb4d7
test: add test cases for upstream and service
johzchen Oct 12, 2020
ca638b6
test: add test cases for route
johzchen Oct 12, 2020
97d89b4
test: add note for route create
johzchen Oct 12, 2020
cc3bc8e
test: update CI
johzchen Oct 12, 2020
a5e5d6c
fix: remove useless file
johzchen Oct 12, 2020
f2446ce
test: fix CI
johzchen Oct 12, 2020
6072d34
fix: ci fail
johzchen Oct 12, 2020
4624313
test: fix lib `dag-to-lua`'s path in CI
johzchen Oct 12, 2020
5d907f4
fix: URI for route may be empty
johzchen Oct 12, 2020
75d2f13
fix: remove empty lines
johzchen Oct 12, 2020
254bab3
fix: refactor validator of json schema
johzchen Oct 12, 2020
8232451
fix code style
johzchen Oct 12, 2020
81ffa4b
fix cicd
johzchen Oct 12, 2020
7a122c0
chore: update docker file
johzchen Oct 12, 2020
24c0c0f
fix: should check schema after id generated
johzchen Oct 12, 2020
0ddd134
fix code style
johzchen Oct 13, 2020
5b4eed2
chore: page_number -> page
johzchen Oct 13, 2020
a661dc2
fix: schema sync script
johzchen Oct 13, 2020
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
14 changes: 12 additions & 2 deletions .github/workflows/api_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ jobs:
- name: get lua lib
run: |
wget https://github.com/api7/dag-to-lua/archive/v1.1.tar.gz
sudo mkdir -p /go/api7-manager-api/dag-to-lua/
sudo mkdir -p /go/manager-api/dag-to-lua/
tar -zxvf v1.1.tar.gz
sudo mv ./dag-to-lua-1.1/lib/* /go/api7-manager-api/dag-to-lua/
sudo mv ./dag-to-lua-1.1/lib/* /go/manager-api/dag-to-lua/

- name: install runtime
run: |
Expand All @@ -49,6 +49,16 @@ jobs:
export GO111MOUDULE=on
sudo apt install golang-1.14-go

- name: generate json schema
working-directory: ./api
run: |
wget https://github.com/apache/apisix/archive/master.zip
mkdir ./build-tools/apisix/
unzip master.zip
sudo mv ./apisix-master/apisix/* ./build-tools/apisix/
rm -rf ./apisix-master
cd ./build-tools/ && lua schema-sync.lua > ../conf/schema.json

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to check if the conf/schema.json is the correct

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


- name: run test
working-directory: ./api
run: |
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/api_cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ jobs:
- name: get lua lib
run: |
wget https://github.com/api7/dag-to-lua/archive/v1.1.tar.gz
sudo mkdir -p /go/api7-manager-api/dag-to-lua/
sudo mkdir -p /go/manager-api/dag-to-lua/
tar -zxvf v1.1.tar.gz
sudo mv ./dag-to-lua-1.1/lib/* /go/api7-manager-api/dag-to-lua/
sudo mv ./dag-to-lua-1.1/lib/* /go/manager-api/dag-to-lua/

- name: install runtime
run: |
Expand All @@ -64,6 +64,16 @@ jobs:
export GO111MOUDULE=on
sudo apt install golang-1.14-go

- name: generate json schema
working-directory: ./api
run: |
wget https://github.com/apache/apisix/archive/master.zip
mkdir ./build-tools/apisix/
unzip master.zip
sudo mv ./apisix-master/apisix/* ./build-tools/apisix/
rm -rf ./apisix-master
cd ./build-tools/ && lua schema-sync.lua > ../conf/schema.json

- uses: Azure/docker-login@v1
with:
login-server: apisixacr.azurecr.cn
Expand Down
14 changes: 14 additions & 0 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ FROM golang:1.13.8 AS build-env
WORKDIR /go/src/github.com/apisix/manager-api
COPY . .
RUN mkdir /go/manager-api \
&& mkdir /go/manager-api/build-tools \
&& go env -w GOPROXY=https://goproxy.io,direct \
&& export GOPROXY=https://goproxy.io \
&& go build -o /go/manager-api/manager-api \
&& mv /go/src/github.com/apisix/manager-api/build.sh /go/manager-api/ \
&& mv /go/src/github.com/apisix/manager-api/build-tools/* /go/manager-api/build-tools/ \
&& mv /go/src/github.com/apisix/manager-api/conf/conf_preview.json /go/manager-api/conf.json \
&& rm -rf /go/src/github.com/apisix/manager-api \
&& rm -rf /etc/localtime \
Expand All @@ -35,6 +37,12 @@ RUN wget https://github.com/api7/dag-to-lua/archive/v1.1.tar.gz \
&& mkdir /go/manager-api/dag-to-lua \
&& mv ./dag-to-lua-1.1/lib/* /go/manager-api/dag-to-lua/

RUN wget https://github.com/apache/apisix/archive/master.zip \
&& mkdir /go/manager-api/build-tools/apisix \
&& apt-get update && apt-get install zip -y \
&& unzip master.zip \
&& mv ./apisix-master/apisix/* /go/manager-api/build-tools/apisix/

FROM alpine:3.11

RUN mkdir -p /go/manager-api \
Expand All @@ -50,6 +58,12 @@ RUN apk add lua5.1
WORKDIR /go/manager-api
COPY --from=build-env /go/manager-api/ /go/manager-api/
COPY --from=build-env /usr/share/zoneinfo/Hongkong /etc/localtime

RUN cd /go/manager-api/build-tools \
&& lua schema-sync.lua > /go/manager-api/schema.json \
&& cd /go/manager-api/ \
&& rm -rf /go/manager-api/build-tools/

EXPOSE 8080
RUN chmod +x ./build.sh
CMD ["/bin/ash", "-c", "/go/manager-api/build.sh"]
Loading