Skip to content

Commit 74052cd

Browse files
authored
opt: runtime and APISIX combined (api7#356)
1 parent bdc8471 commit 74052cd

27 files changed

+139
-478
lines changed

.circleci/config.yml

Lines changed: 7 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,30 @@ jobs:
1111
image: ubuntu-2004:202101-01
1212
resource_class: arm.medium
1313
environment:
14-
- TEST_VERSION: 0-latest
14+
- PACKAGE_APISIX_VERSION: 0-latest
15+
- BUILD_APISIX_RUNTIME_VERSION: 1.0.1
1516
steps:
1617
- checkout
1718
- run:
1819
name: install dependencies
1920
command: |
2021
sudo apt-get install -y make
21-
- run:
22-
name: package apisix-base
23-
command: |
24-
make package type=deb app=apisix-base version=${TEST_VERSION}
2522
- run:
2623
name: package apisix-runtime
2724
command: |
28-
make package type=deb app=apisix-runtime version=${TEST_VERSION}
25+
make package type=deb app=apisix-runtime runtime_version=${BUILD_APISIX_RUNTIME_VERSION}
2926
- run:
3027
name: package apisx
3128
command: |
32-
make package type=deb app=apisix version=${TEST_VERSION} checkout=master image_base=ubuntu image_tag=20.04
29+
make package type=deb app=apisix version=${PACKAGE_APISIX_VERSION} runtime_version=${BUILD_APISIX_RUNTIME_VERSION} checkout=master image_base=ubuntu image_tag=20.04
3330
- run:
3431
name: install apisix deb into container
3532
command: |
36-
docker build -t apache/apisix:${TEST_VERSION}-deb-test --build-arg APISIX_VERSION=${TEST_VERSION} -f test/apisix/Dockerfile.test.apisix.arm64.ubuntu20.04 .
33+
docker build -t apache/apisix:${PACKAGE_APISIX_VERSION}-deb-test --build-arg APISIX_VERSION=${PACKAGE_APISIX_VERSION} -f test/apisix/Dockerfile.test.apisix.arm64.ubuntu20.04 .
3734
- run:
3835
name: start apisix and test
3936
command: |
40-
docker run -d --rm --name apisix-${TEST_VERSION}-deb-test -v $(pwd)/test/apisix/config.yaml:/usr/local/apisix/conf/config.yaml -p 9180:9180 -p 9080:9080 -p 9443:9443 apache/apisix:${TEST_VERSION}-deb-test
37+
docker run -d --rm --name apisix-${PACKAGE_APISIX_VERSION}-deb-test -v $(pwd)/test/apisix/config.yaml:/usr/local/apisix/conf/config.yaml -p 9180:9180 -p 9080:9080 -p 9443:9443 apache/apisix:${PACKAGE_APISIX_VERSION}-deb-test
4138
sleep 20
4239
curl http://127.0.0.1:9180/apisix/admin/routes/1 \
4340
-H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
@@ -56,27 +53,6 @@ jobs:
5653
exit 125
5754
fi
5855
59-
build-and-push-apisix-base-dev-arm:
60-
machine:
61-
image: ubuntu-2004:202101-01
62-
resource_class: arm.medium
63-
64-
steps:
65-
- checkout
66-
- run:
67-
name: submodule
68-
command: |
69-
git submodule sync
70-
git submodule update --init
71-
72-
- run:
73-
name: Build and Push Docker Image
74-
command: |
75-
echo "$DOCKERHUB_TOKEN" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
76-
docker buildx build -t api7/apisix-base:dev-arm64 --push \
77-
--build-arg VERSION=dev --build-arg BUILD_LATEST=latest \
78-
-f ./dockerfiles/Dockerfile.apisix-base.deb .
79-
8056
build-and-push-apisix-runtime-dev-arm:
8157
machine:
8258
image: ubuntu-2004:202101-01
@@ -98,27 +74,6 @@ jobs:
9874
--build-arg VERSION=dev --build-arg BUILD_LATEST=latest \
9975
-f ./dockerfiles/Dockerfile.apisix-runtime.deb .
10076
101-
build-and-push-apisix-base-dev-x86:
102-
machine:
103-
image: ubuntu-2004:202101-01
104-
resource_class: medium
105-
106-
steps:
107-
- checkout
108-
- run:
109-
name: submodule
110-
command: |
111-
git submodule sync
112-
git submodule update --init
113-
114-
- run:
115-
name: Build and Push Docker Image
116-
command: |
117-
echo "$DOCKERHUB_TOKEN" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
118-
docker buildx build -t api7/apisix-base:dev-x86_64 --push \
119-
--build-arg VERSION=dev --build-arg BUILD_LATEST=latest \
120-
-f ./dockerfiles/Dockerfile.apisix-base.deb .
121-
12277
build-and-push-apisix-runtime-dev-x86:
12378
machine:
12479
image: ubuntu-2004:202101-01
@@ -140,22 +95,6 @@ jobs:
14095
--build-arg VERSION=dev --build-arg BUILD_LATEST=latest \
14196
-f ./dockerfiles/Dockerfile.apisix-runtime.deb .
14297
143-
upload-manifest-apisix-base-dev:
144-
docker:
145-
- image: cimg/python:3.8.2
146-
steps:
147-
- checkout
148-
- deploy:
149-
name: "Upload apisix-base manifest to registry"
150-
command: |
151-
set -eu
152-
export DOCKER_CLI_EXPERIMENTAL=enabled
153-
echo "$DOCKERHUB_TOKEN" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
154-
docker manifest create api7/apisix-base:dev \
155-
api7/apisix-base:dev-arm64 \
156-
api7/apisix-base:dev-x86_64
157-
docker manifest push api7/apisix-base:dev
158-
15998
upload-manifest-apisix-runtime-dev:
16099
docker:
161100
- image: cimg/python:3.8.2
@@ -186,7 +125,6 @@ jobs:
186125
resource_class: arm.medium
187126
environment:
188127
- VAR_WORKBENCH_DIR: /tmp/output
189-
190128
steps:
191129
- checkout
192130
- run:
@@ -219,29 +157,14 @@ jobs:
219157
command: |
220158
APISIX_TAG_VERSION=$(echo ${CIRCLE_TAG##*/})
221159
wget https://raw.githubusercontent.com/apache/apisix/${APISIX_TAG_VERSION}/.requirements && source .requirements
222-
160+
223161
echo "apisix version: $APISIX_TAG_VERSION"
224162
make package type=${PACK_TYPE} app=apisix openresty=apisix-runtime runtime_version=${APISIX_RUNTIME} checkout=${APISIX_TAG_VERSION} version=${APISIX_TAG_VERSION} image_base=<< parameters.var_os >> image_tag=<< parameters.var_os_release >>
225163
mv ./output/apisix*.${PACK_TYPE} ${VAR_WORKBENCH_DIR}
226164
227165
- store_artifacts:
228166
path: /tmp/output
229167

230-
- when:
231-
condition:
232-
matches: { pattern: "^apisix-base/(.*)\\d+$", value: << pipeline.git.tag >> }
233-
steps:
234-
- run:
235-
name: build apisix-base package
236-
command: |
237-
APISIX_BASE_TAG_VERSION=$(echo ${CIRCLE_TAG##*/})
238-
echo "apisix-base version: $APISIX_BASE_TAG_VERSION"
239-
make package type=${PACK_TYPE} app=apisix-base checkout=${APISIX_BASE_TAG_VERSION} version=${APISIX_BASE_TAG_VERSION} image_base=<< parameters.var_os >> image_tag=<< parameters.var_os_release >>
240-
mv ./output/apisix-base*.${PACK_TYPE} ${VAR_WORKBENCH_DIR}
241-
242-
- store_artifacts:
243-
path: /tmp/output
244-
245168
- when:
246169
condition:
247170
matches: { pattern: "^apisix-runtime/(.*)\\d+$", value: << pipeline.git.tag >> }
@@ -260,27 +183,6 @@ jobs:
260183
# Invoke jobs via workflows
261184
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
262185
workflows:
263-
build-apisix-base:
264-
jobs:
265-
- build:
266-
filters:
267-
branches:
268-
only: master
269-
build-and-push-apisix-base-dev:
270-
triggers:
271-
- schedule:
272-
cron: "0 0 * * *"
273-
filters:
274-
branches:
275-
only:
276-
- master
277-
jobs:
278-
- build-and-push-apisix-base-dev-arm
279-
- build-and-push-apisix-base-dev-x86
280-
- upload-manifest-apisix-base-dev:
281-
requires:
282-
- build-and-push-apisix-base-dev-arm
283-
- build-and-push-apisix-base-dev-x86
284186
build-and-push-apisix-runtime-dev:
285187
triggers:
286188
- schedule:

.github/workflows/package-apisix-base-deb-ubuntu20.04.yml

Lines changed: 0 additions & 64 deletions
This file was deleted.

.github/workflows/package-apisix-base-rpm-el7.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

.github/workflows/package-apisix-base-rpm-el8.yml

Lines changed: 0 additions & 66 deletions
This file was deleted.

0 commit comments

Comments
 (0)