Skip to content

Commit 885510c

Browse files
authored
feat(openresty): add openresty compatibility (#145)
1 parent fef3c5e commit 885510c

29 files changed

+983
-70
lines changed

.circleci/continue_config.yml

+229-3
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,89 @@ jobs:
170170
- store_artifacts:
171171
destination: nginx-configurator
172172
path: ./installer/configurator/nginx-configurator
173+
build_openresty_amd64:
174+
environment:
175+
ARCH: x86_64
176+
MAKE_JOB_COUNT: 8
177+
RESTY_VERSION: << parameters.resty-version >>
178+
WAF: << parameters.waf >>
179+
machine:
180+
image: ubuntu-2204:current
181+
parameters:
182+
resty-version:
183+
type: string
184+
waf:
185+
enum:
186+
- "ON"
187+
- "OFF"
188+
type: enum
189+
resource_class: xlarge
190+
steps:
191+
- checkout
192+
- run: git submodule sync && git submodule update --init --recursive
193+
- run:
194+
command: |
195+
if [[ $CIRCLE_TAG =~ ^v ]]; then
196+
bin/verify_version.sh "$(echo "$CIRCLE_TAG" | tr -d v)"
197+
else
198+
echo "Not a release"
199+
fi
200+
name: Verify versions (release tag only)
201+
- run:
202+
command: make build-openresty
203+
environment:
204+
BUILD_TYPE: RelWithDebInfo
205+
RESTY_VERSION: << parameters.resty-version >>
206+
- persist_to_workspace:
207+
paths:
208+
- .openresty-build/ngx_http_datadog_module.so
209+
- .openresty-build/ngx_http_datadog_module.so.debug
210+
root: .
211+
- store_artifacts:
212+
destination: ngx_http_datadog_module.so
213+
path: .openresty-build/ngx_http_datadog_module.so
214+
- store_artifacts:
215+
destination: ngx_http_datadog_module.so.debug
216+
path: .openresty-build/ngx_http_datadog_module.so.debug
217+
build_openresty_arm64:
218+
environment:
219+
ARCH: aarch64
220+
MAKE_JOB_COUNT: 8
221+
RESTY_VERSION: << parameters.resty-version >>
222+
WAF: << parameters.waf >>
223+
machine:
224+
image: ubuntu-2204:current
225+
parameters:
226+
resty-version:
227+
type: string
228+
waf:
229+
enum:
230+
- "ON"
231+
- "OFF"
232+
type: enum
233+
resource_class: arm.xlarge
234+
steps:
235+
- checkout
236+
- run: git submodule sync && git submodule update --init --recursive
237+
- run:
238+
command: make build-openresty
239+
environment:
240+
BUILD_TYPE: RelWithDebInfo
241+
RESTY_VERSION: << parameters.resty-version >>
242+
- persist_to_workspace:
243+
paths:
244+
- .openresty-build/ngx_http_datadog_module.so
245+
- .openresty-build/ngx_http_datadog_module.so.debug
246+
root: .
247+
- store_artifacts:
248+
destination: ngx_http_datadog_module.so
249+
path: .openresty-build/ngx_http_datadog_module.so
250+
- store_artifacts:
251+
destination: ngx_http_datadog_module.so.debug
252+
path: .openresty-build/ngx_http_datadog_module.so.debug
253+
- store_artifacts:
254+
destination: openresty-version-info
255+
path: openresty-version-info
173256
check-ci-definition:
174257
docker:
175258
- image: circleci/circleci-cli:latest
@@ -190,11 +273,11 @@ jobs:
190273
- run:
191274
command: pip install -r requirements.txt
192275
name: Install Python dependencies
193-
- run: echo -e "ARCH=amd64\nBASE_IMAGE=nginx:1.26.0\n" > nginx-version-info
194276
- run:
195277
command: make coverage
196278
environment:
197279
ARCH: x86_64
280+
BASE_IMAGE: nginx:1.26.0
198281
BUILD_TYPE: RelWithDebInfo
199282
MAKE_JOB_COUNT: 8
200283
NGINX_VERSION: 1.26.0
@@ -282,6 +365,7 @@ jobs:
282365
working_directory: ./system-tests
283366
test:
284367
environment:
368+
BASE_IMAGE: <<parameters.base-image>>
285369
DOCKER_BUILDKIT: 1
286370
RUM: << parameters.rum >>
287371
WAF: << parameters.waf >>
@@ -315,15 +399,50 @@ jobs:
315399
- attach_workspace:
316400
at: /tmp/workspace
317401
- run: mv -v /tmp/workspace/.musl-build/ngx_http_datadog_module.so* test/services/nginx/
318-
- run: printf "ARCH=%s\nBASE_IMAGE=%s\n" << parameters.arch >> << parameters.base-image >> > nginx-version-info
319402
- setup_remote_docker:
320403
docker_layer_caching: true
321404
- run: test/bin/run --verbose --failfast
322405
- store_artifacts:
323406
destination: test.log
324407
path: test/logs/test.log
408+
test-openresty:
409+
environment:
410+
BASE_IMAGE: <<parameters.base-image>>
411+
DOCKER_BUILDKIT: 1
412+
WAF: << parameters.waf >>
413+
executor:
414+
image: cimg/python:3.10.13
415+
name: docker-<< parameters.arch >>
416+
parameters:
417+
arch:
418+
type: string
419+
base-image:
420+
default: ""
421+
type: string
422+
resty-version:
423+
type: string
424+
waf:
425+
enum:
426+
- "ON"
427+
- "OFF"
428+
type: enum
429+
steps:
430+
- checkout
431+
- run:
432+
command: pip install -r requirements.txt
433+
name: Install Python dependencies
434+
- attach_workspace:
435+
at: /tmp/workspace
436+
- run: mv -v /tmp/workspace/.openresty-build/ngx_http_datadog_module.so* test/services/nginx/
437+
- setup_remote_docker:
438+
docker_layer_caching: true
439+
- run: test/bin/run --verbose --failfast
440+
- store_artifacts:
441+
destination: test.log‡
442+
path: test/logs/test.log
325443
test_ingress:
326444
environment:
445+
BASE_IMAGE: <<parameters.base-image>>:<<parameters.nginx-version>>
327446
DOCKER_BUILDKIT: 1
328447
NGINX_FLAVOR: ingress-nginx
329448
executor:
@@ -345,7 +464,6 @@ jobs:
345464
- attach_workspace:
346465
at: /tmp/workspace
347466
- run: mv -v /tmp/workspace/.musl-build/ngx_http_datadog_module.so* test/services/nginx/
348-
- run: printf "ARCH=%s\nBASE_IMAGE=%s\n" << parameters.arch >> << parameters.base-image >>:<< parameters.nginx-version >> > nginx-version-info
349467
- setup_remote_docker:
350468
docker_layer_caching: true
351469
- run: test/bin/run --verbose --failfast
@@ -397,6 +515,28 @@ workflows:
397515
- "ON"
398516
- "OFF"
399517
name: build << matrix.nginx-version >> on arm64 WAF << matrix.waf >>
518+
- build_openresty_amd64:
519+
matrix:
520+
parameters:
521+
resty-version:
522+
- 1.21.4.4
523+
- 1.25.3.2
524+
- 1.27.1.1
525+
waf:
526+
- "ON"
527+
- "OFF"
528+
name: build openresty << matrix.resty-version >> on amd64 WAF << matrix.waf >>
529+
- build_openresty_arm64:
530+
matrix:
531+
parameters:
532+
resty-version:
533+
- 1.21.4.4
534+
- 1.25.3.2
535+
- 1.27.1.1
536+
waf:
537+
- "ON"
538+
- "OFF"
539+
name: build openresty << matrix.resty-version >> on arm64 WAF << matrix.waf >>
400540
- build_ingress_nginx_module:
401541
matrix:
402542
parameters:
@@ -424,6 +564,22 @@ workflows:
424564
name: test << matrix.nginx-version >> on << matrix.base-image >>:<< matrix.arch >> WAF << matrix.waf >>
425565
requires:
426566
- build << matrix.nginx-version >> on << matrix.arch >> WAF << matrix.waf >>
567+
- test-openresty:
568+
matrix:
569+
parameters:
570+
arch:
571+
- amd64
572+
- arm64
573+
base-image:
574+
- openresty/openresty:1.27.1.1-alpine
575+
resty-version:
576+
- 1.27.1.1
577+
waf:
578+
- "ON"
579+
- "OFF"
580+
name: test openresty << matrix.resty-version >> on << matrix.base-image >>:<< matrix.arch >> WAF << matrix.waf >>
581+
requires:
582+
- build openresty << matrix.resty-version >> on << matrix.arch >> WAF << matrix.waf >>
427583
- test:
428584
matrix:
429585
parameters:
@@ -573,6 +729,28 @@ workflows:
573729
- "ON"
574730
- "OFF"
575731
name: build << matrix.nginx-version >> on arm64 WAF << matrix.waf >>
732+
- build_openresty_amd64:
733+
matrix:
734+
parameters:
735+
resty-version:
736+
- 1.25.3.1
737+
- 1.25.3.2
738+
- 1.27.1.1
739+
waf:
740+
- "ON"
741+
- "OFF"
742+
name: build openresty << matrix.resty-version >> on amd64 WAF << matrix.waf >>
743+
- build_openresty_arm64:
744+
matrix:
745+
parameters:
746+
resty-version:
747+
- 1.25.3.1
748+
- 1.25.3.2
749+
- 1.27.1.1
750+
waf:
751+
- "ON"
752+
- "OFF"
753+
name: build openresty << matrix.resty-version >> on arm64 WAF << matrix.waf >>
576754
- test:
577755
filters:
578756
tags:
@@ -854,6 +1032,54 @@ workflows:
8541032
name: test << matrix.nginx-version >> on << matrix.base-image >>:<< matrix.arch >> WAF << matrix.waf >>
8551033
requires:
8561034
- build << matrix.nginx-version >> on << matrix.arch >> WAF << matrix.waf >>
1035+
- test-openresty:
1036+
matrix:
1037+
parameters:
1038+
arch:
1039+
- amd64
1040+
- arm64
1041+
base-image:
1042+
- openresty/openresty:1.27.1.1-alpine
1043+
resty-version:
1044+
- 1.27.1.1
1045+
waf:
1046+
- "ON"
1047+
- "OFF"
1048+
name: test openresty << matrix.resty-version >> on << matrix.base-image >>:<< matrix.arch >> WAF << matrix.waf >>
1049+
requires:
1050+
- build openresty << matrix.resty-version >> on << matrix.arch >> WAF << matrix.waf >>
1051+
- test-openresty:
1052+
matrix:
1053+
parameters:
1054+
arch:
1055+
- amd64
1056+
- arm64
1057+
base-image:
1058+
- openresty/openresty:1.25.3.2-alpine
1059+
resty-version:
1060+
- 1.25.3.2
1061+
waf:
1062+
- "ON"
1063+
- "OFF"
1064+
name: test openresty << matrix.resty-version >> on << matrix.base-image >>:<< matrix.arch >> WAF << matrix.waf >>
1065+
requires:
1066+
- build openresty << matrix.resty-version >> on << matrix.arch >> WAF << matrix.waf >>
1067+
- test-openresty:
1068+
matrix:
1069+
parameters:
1070+
arch:
1071+
- amd64
1072+
- arm64
1073+
base-image:
1074+
- openresty/openresty:1.25.3.1-alpine
1075+
resty-version:
1076+
- 1.25.3.1
1077+
waf:
1078+
- "ON"
1079+
- "OFF"
1080+
name: test openresty << matrix.resty-version >> on << matrix.base-image >>:<< matrix.arch >> WAF << matrix.waf >>
1081+
requires:
1082+
- build openresty << matrix.resty-version >> on << matrix.arch >> WAF << matrix.waf >>
8571083
when:
8581084
or:
8591085
- << pipeline.parameters.build_all >>

0 commit comments

Comments
 (0)