@@ -11,33 +11,30 @@ jobs:
11
11
image : ubuntu-2004:202101-01
12
12
resource_class : arm.medium
13
13
environment :
14
- - TEST_VERSION : 0-latest
14
+ - PACKAGE_APISIX_VERSION : 0-latest
15
+ - BUILD_APISIX_RUNTIME_VERSION : 1.0.1
15
16
steps :
16
17
- checkout
17
18
- run :
18
19
name : install dependencies
19
20
command : |
20
21
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}
25
22
- run :
26
23
name : package apisix-runtime
27
24
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 }
29
26
- run :
30
27
name : package apisx
31
28
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
33
30
- run :
34
31
name : install apisix deb into container
35
32
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 .
37
34
- run :
38
35
name : start apisix and test
39
36
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
41
38
sleep 20
42
39
curl http://127.0.0.1:9180/apisix/admin/routes/1 \
43
40
-H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
56
53
exit 125
57
54
fi
58
55
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
-
80
56
build-and-push-apisix-runtime-dev-arm :
81
57
machine :
82
58
image : ubuntu-2004:202101-01
98
74
--build-arg VERSION=dev --build-arg BUILD_LATEST=latest \
99
75
-f ./dockerfiles/Dockerfile.apisix-runtime.deb .
100
76
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
-
122
77
build-and-push-apisix-runtime-dev-x86 :
123
78
machine :
124
79
image : ubuntu-2004:202101-01
@@ -140,22 +95,6 @@ jobs:
140
95
--build-arg VERSION=dev --build-arg BUILD_LATEST=latest \
141
96
-f ./dockerfiles/Dockerfile.apisix-runtime.deb .
142
97
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
-
159
98
upload-manifest-apisix-runtime-dev :
160
99
docker :
161
100
- image : cimg/python:3.8.2
@@ -186,7 +125,6 @@ jobs:
186
125
resource_class : arm.medium
187
126
environment :
188
127
- VAR_WORKBENCH_DIR : /tmp/output
189
-
190
128
steps :
191
129
- checkout
192
130
- run :
@@ -219,29 +157,14 @@ jobs:
219
157
command : |
220
158
APISIX_TAG_VERSION=$(echo ${CIRCLE_TAG##*/})
221
159
wget https://raw.githubusercontent.com/apache/apisix/${APISIX_TAG_VERSION}/.requirements && source .requirements
222
-
160
+
223
161
echo "apisix version: $APISIX_TAG_VERSION"
224
162
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 >>
225
163
mv ./output/apisix*.${PACK_TYPE} ${VAR_WORKBENCH_DIR}
226
164
227
165
- store_artifacts :
228
166
path : /tmp/output
229
167
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
-
245
168
- when :
246
169
condition :
247
170
matches : { pattern: "^apisix-runtime/(.*)\\d+$", value: << pipeline.git.tag >> }
@@ -260,27 +183,6 @@ jobs:
260
183
# Invoke jobs via workflows
261
184
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
262
185
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
284
186
build-and-push-apisix-runtime-dev :
285
187
triggers :
286
188
- schedule :
0 commit comments