forked from F5Networks/f5-appsvcs-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
713 lines (683 loc) · 22 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
# AS3 parser is pre-compiled using nodejs and
# requires node 4.8.0 for compatibility with BIG-IP.
image: $DOCKER_URL/node:4.8.0
stages:
- update
- commands
- atg-shared-checks
- schema
- lint
- test
- build
- deploy
- integration test
- teardown
- post build
- docs
variables:
BIGIP_IMAGE:
description: The name of the BIG-IP image to use for integration testing. Names are specific to the deploy environment.
DO_DOWNLOAD_DIR: do_rpm
DOCS_BUILD_DIR: "docs/_build/html"
F5_PERF_TRACING_ENABLED:
description: Send performance traces to Jaeger
value: "false"
options:
- "true"
- "false"
FORCE_INTEGRATION_TEST:
description: Force a run of integration testing. Otherwise, decision is based on pipeline type.
value: "false"
options:
- "true"
- "false"
GIT_DEPTH: "10"
IMAGE_NAME: f5-as3-container
RPM_PACKAGE_URL:
description: URL from which to download the RPM to test. By default use the RPM from the build_rpm job.
TEST_CODE_VERSION:
description: AS3 branch/tag from which to get integration tests.
value: "$CI_COMMIT_REF_NAME"
REGRESSION_SCHEDULE:
description: Type of schedule to run for integration tests.
value: nightly
options:
- nightly
- performance
- remote
- smoke
PARALLEL:
description: Run integration tests in parallel. Deploy 3 BIGIP instances.
value: "false"
options:
- "true"
- "false"
TF_DIRECTORY: test/common/env/terraform
TF_HTTP_LOCK_METHOD: POST
TF_HTTP_UNLOCK_METHOD: DELETE
TF_HTTP_USERNAME: ${CI_REGISTRY_USER}
TF_HTTP_PASSWORD: ${CI_JOB_TOKEN}
TF_CLI_ARGS_apply: "-auto-approve"
TF_CLI_ARGS_destroy: "-auto-approve"
TF_STATE_URL: "$CI_API_V4_URL/projects/$CI_PROJECT_ID/terraform/state"
# terraform will try to update state 5(4+1) times every 3 minutes.
TF_HTTP_RETRY_MAX: 4
TF_HTTP_RETRY_WAIT_MIN: 3
TEST_REPORTER_OPTIONS: "--reporter mocha-multi-reporters --reporter-options configFile=test/mochaReporterConfig.json"
CURL_CONTENT: "Content-Type: application/json"
# This inherits all the jobs defined in the parent template
# Override variables in this project as needed
include:
# adds atg-shared-checks stage and jobs
# adds atg_shared_checks_result job to test stage
- project: automation-toolchain/atg-shared-templates
file: security/base.gitlab-ci.yml
update_autotool_deps:
stage: update
rules:
- if: '$UPDATE_DEPS =~ /true/i'
needs: []
image: $DOCKER_URL/node:14
variables:
UPDATE_BRANCH_NAME: update_autotool_deps
script:
- . ./scripts/dev/update-as3-deps.sh
- >
if [ "$AUTOTOOL_DIFF" = "true" ]; then
git push -f origin ${UPDATE_BRANCH_NAME}
node ./scripts/dev/createMR.js
fi
tags: [cm-official-docker-executor]
schema:
image: $DOCKER_URL/node:10
stage: schema
needs: []
tags:
- cm-official-docker-executor
script:
- npm ci --no-optional
- npm run build-schema
artifacts:
name: f5-appsvcs-extension-$CI_BUILD_REF
paths:
- src/schema/latest/adc-schema.json
- src/schema/latest/as3-schema.json
lint:
image: $DOCKER_URL/node:10
stage: lint
needs:
- schema
tags:
- cm-official-docker-executor
script:
- npm ci
- npm run lint
coverage:
image: $DOCKER_URL/node:16
stage: test
needs:
- schema
tags:
- cm-official-docker-executor
script:
- npm ci
- npm run coverage
artifacts:
paths:
- coverage
coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/
audit:
image: $DOCKER_URL/node:lts
stage: test
needs: []
variables:
NODE_OPTIONS: "--dns-result-order=ipv4first"
allow_failure: true
tags:
- cm-official-docker-executor
script:
- npm audit
node:4.6:
image: $DOCKER_URL/node:4.6.2
stage: test
needs:
- schema
tags:
- cm-official-docker-executor
script:
- npm install [email protected] --save-dev
- npm install --no-optional
- npm run test-no-build
node:6:
image: $DOCKER_URL/node:6
stage: test
needs:
- schema
tags:
- cm-official-docker-executor
script:
- currentDirectory=$(pwd)
- mkdir -p /tmp/npm-install-directory
- cd /tmp/npm-install-directory
- npm install [email protected]
- rm -rf /usr/local/lib/node_modules
- mv node_modules /usr/local/lib/
- ln -s /usr/local/lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx
- cd $currentDirectory
- npm ci --no-optional
- npm install [email protected]
- npm run test-no-build -- $TEST_REPORTER_OPTIONS
artifacts:
when: always
reports:
junit: test_report.xml
node:8:
image: $DOCKER_URL/node:8.11.1
stage: test
needs:
- schema
tags:
- cm-official-docker-executor
script:
- npm install --global [email protected]
- npm ci --no-optional
- npm install mocha@7
- npm run test-no-build -- $TEST_REPORTER_OPTIONS
artifacts:
when: always
reports:
junit: test_report.xml
build_rpm:
image: $DOCKER_URL/node:12
stage: build
needs:
- schema
script:
# setup node environment
- apt-get update && apt-get install -y rpm --no-install-recommends
- npm ci --no-optional
# build installation package
- scripts/build/buildRpm.sh "cloud"
# ensure latest copyrights
- node node_modules/@f5devcentral/atg-shared-utilities-dev/scripts/dev/write-copyright.js -c -p scripts/dev/copyright.txt
tags:
- cm-official-docker-executor
artifacts:
name: f5-appsvcs-extension-$CI_BUILD_REF
paths:
- dist
- src/schema/latest/adc-schema.json
- src/schema/latest/as3-schema.json
create_source:
image: $DOCKER_URL/node:10
stage: post build
needs:
- build_rpm
script:
- scripts/build/source-package.sh
tags:
- cm-official-docker-executor
artifacts:
name: f5-appsvcs-source
paths:
- dist/*-source.tar.gz
- dist/*-examples.tar.gz
build_api_docs:
image: $DOCKER_URL/node:12
stage: build
needs: []
script:
# install packages
- npm install
# generate docs
- npm run make-api-docs
- mkdir apidocs && mv redoc-static.html apidocs/index.html
tags:
- cm-official-docker-executor
artifacts:
name: docs
paths:
- apidocs
.deploy_common: &deploy_common
image: $INTEGRATION_DEPLOY_IMAGE
tags:
- as3-test-docker-executor
stage: deploy
timeout: 2 hours
script:
- apk update
- apk add npm gettext
- cd "$TF_ROOT"
- terraform init
- if [[ "$SKIP_DEPLOYMENT" != "true" ]]; then
# $SKIP_DEPLOYMENT may be undefined so we check for true
- terraform destroy
- terraform apply
- fi
- if [[ "$PARALLEL" = "true" ]]; then
- BIGIPS_ADDRESSES=($(terraform output --json admin_ip | jq -rc .[]))
- else
- AS3_HOST=$(terraform output --json admin_ip | jq -rc .[0]):8443
- if [ "$REGRESSION_SCHEDULE" = "remote" ]; then
- TARGET_HOST=$(terraform output --json admin_ip | jq -rc .[1]):8443
- fi
- fi
- AS3_USERNAME=$(terraform output --json admin_username | jq -rc .)
- AS3_PASSWORD=$(terraform output --json admin_password | jq -rc .)
- cd -
- if [[ -n "$RPM_PACKAGE_URL" ]]; then
- echo using RPM "$RPM_PACKAGE_URL" from RPM_PACKAGE_URL env var
- export RPM_PACKAGE=$(basename "$RPM_PACKAGE_URL")
- curl -o "$RPM_PACKAGE" "$RPM_PACKAGE_URL"
- elif [[ $CI_PIPELINE_SOURCE == "pipeline" ]]; then
- echo using RPM from cross-project pipeline
- RPM_PACKAGE=$(ls ${UPSTREAM_RPM_PATH}/*.rpm)
- else
- echo using RPM from our pipeline
- RPM_PACKAGE=$(ls ${CI_PROJECT_DIR}/dist/*.rpm)
- fi
- if [[ "$SKIP_DEPLOYMENT" != "true" ]]; then
- mkdir -p "$DO_DOWNLOAD_DIR"
- DO_RPM_FILE=$(scripts/dev/download-latest-do.sh "$DO_DOWNLOAD_DIR" "${DO_INTEGRATION_VERSION}")
- npm install --no-optional
- if [[ "$PARALLEL" = "true" ]]; then
- for IP in "${BIGIPS_ADDRESSES[@]}"; do
- echo "Configuring $IP"
- source scripts/dev/instance-config.sh "$IP:8443" "$AS3_USERNAME:$AS3_PASSWORD" "$DO_RPM_FILE" "$TF_ROOT/onboard.json" "$RPM_PACKAGE" &
- done
- wait
- SERVER_SET_JSON=$(source scripts/dev/build-server-set.sh)
- echo "Posting server set to reservation server $RESERVATION_SERVER_HOST:$RESERVATION_SERVER_PORT"
- SERVER_SET=$(curl -s --retry 5 --retry-max-time 300 -H "$CURL_CONTENT" -d "$SERVER_SET_JSON" -X POST http://$RESERVATION_SERVER_HOST:$RESERVATION_SERVER_PORT/reservations/api/server-sets | jq .id | tr -d '"')
- echo "Server set id is $SERVER_SET"
- echo "SERVER_SET=$SERVER_SET" >> deploy.env
- else
- echo "Configuring host $AS3_HOST"
- echo "AS3_HOST=$AS3_HOST" >> deploy.env
- echo "AS3_USERNAME=$AS3_USERNAME" >> deploy.env
- echo "AS3_PASSWORD=$AS3_PASSWORD" >> deploy.env
- source scripts/dev/instance-config.sh "$AS3_HOST" "$AS3_USERNAME:$AS3_PASSWORD" "$DO_RPM_FILE" "$TF_ROOT/onboard.json" "$RPM_PACKAGE" &
- if [ "$REGRESSION_SCHEDULE" = "remote" ]; then
- echo "Configuring target host $TARGET_HOST"
- echo "TARGET_HOST=$TARGET_HOST" >> deploy.env
- source scripts/dev/instance-config.sh "$TARGET_HOST" "$AS3_USERNAME:$AS3_PASSWORD" "$DO_RPM_FILE" "$TF_ROOT/onboard.json" "$RPM_PACKAGE" &
- fi
- wait
- fi
- else
- echo "skipping DO install due to SKIP_DEPLOYMENT"
- fi
artifacts:
when: always
reports:
dotenv: deploy.env
expire_in: 1 day
retry:
max: 1
when: script_failure
deploy_to_azure:
rules:
- if: '$TEST_IN_AZURE =~ /true/i'
needs:
- job: build_rpm
artifacts: true
- job: schema
artifacts: true
variables:
F5_DISABLE_CERT_VERIFY: 'true'
TF_VAR_f5_cidr_blocks: "${F5_CIDR_BLOCKS}"
TF_ROOT: "$TF_DIRECTORY/plans/azure"
REGKEY: "$BIGIP_LICENSE_AZURE"
before_script:
- export TF_VAR_bigip_version="${BIGIP_IMAGE}"
# terraform doesn't support '.' in backend address.
- export TRIM_VERSION="$(echo ${BIGIP_IMAGE} | cut -d '-' -f 2 | tr '.' -)"
- if [[ "$PARALLEL" = "true" ]]; then
- export TF_VAR_bigip_count=3
- export TF_HTTP_ADDRESS="$TF_STATE_URL/parallel-azure-$TRIM_VERSION"
- else
- export TF_HTTP_ADDRESS="$TF_STATE_URL/azure-$TRIM_VERSION"
- fi
- export TF_HTTP_LOCK_ADDRESS="$TF_HTTP_ADDRESS/lock"
- export TF_HTTP_UNLOCK_ADDRESS=$TF_HTTP_LOCK_ADDRESS
<<: *deploy_common
deploy_for_this_project:
rules:
- if: '$TEST_IN_AZURE =~ /true/i'
when: never
- if: '$TRIGGER_INTEGRATION_TEST =~ /true/i'
when: never
- if: '$UPDATE_DEPS =~ /true/i'
when: never
- if: '$CI_PIPELINE_SOURCE == "schedule"'
- if: '$FORCE_INTEGRATION_TEST =~ /true/i'
needs:
- job: build_rpm
artifacts: true
- job: schema
artifacts: true
variables:
TF_ROOT: "$TF_DIRECTORY/plans/openstack"
REGKEY: "$BIGIP_LICENSE"
before_script:
- export TF_VAR_bigip_version="${BIGIP_IMAGE}"
# terraform doesn't support '.' in backend address.
- export TRIM_VERSION="$(echo ${BIGIP_IMAGE} | cut -d '-' -f 2 | tr '.' -)"
- if [[ "$PARALLEL" = "true" ]]; then
- export TF_VAR_bigip_count=3
- export TF_HTTP_ADDRESS="$TF_STATE_URL/parallel-openstack-$TRIM_VERSION"
- elif [ "$REGRESSION_SCHEDULE" = "remote" ]; then
- export TF_VAR_bigip_count=2
- export TF_HTTP_ADDRESS="$TF_STATE_URL/remote-openstack-$TRIM_VERSION"
- elif [ "$REGRESSION_SCHEDULE" = "performance" ]; then
- export TF_VAR_performance_test=true
- export TF_HTTP_ADDRESS="$TF_STATE_URL/performance-openstack-$TRIM_VERSION"
- else
- export TF_HTTP_ADDRESS="$TF_STATE_URL/openstack-$TRIM_VERSION"
- fi
- export TF_HTTP_LOCK_ADDRESS="$TF_HTTP_ADDRESS/lock"
- export TF_HTTP_UNLOCK_ADDRESS=$TF_HTTP_LOCK_ADDRESS
<<: *deploy_common
deploy_for_other_project:
rules:
- if: '$TRIGGER_INTEGRATION_TEST =~ /true/i'
needs:
- project: "$UPSTREAM_PROJECT_PATH"
job: "$UPSTREAM_JOB"
ref: "$UPSTREAM_REF"
artifacts: true
variables:
TF_ROOT: "$TF_DIRECTORY/plans/openstack"
REGKEY: "$BIGIP_LICENSE"
before_script:
- if [ -n "$UPSTREAM_RPM_PATH" ]; then
- export RPM_PACKAGE=$(ls ${UPSTREAM_RPM_PATH}/*.rpm)
- fi
- export BIGIP_IMAGE="${BIGIP_IMAGE_DEFAULT}"
- export TF_VAR_bigip_version="${BIGIP_IMAGE}"
# terraform doesn't support '.' in backend address.
- export TRIM_VERSION="$(echo ${BIGIP_IMAGE} | cut -d '-' -f 2 | tr '.' -)"
- export TF_HTTP_ADDRESS="$TF_STATE_URL/atg-build-openstack-$TRIM_VERSION"
- export TF_HTTP_LOCK_ADDRESS="$TF_HTTP_ADDRESS/lock"
- export TF_HTTP_UNLOCK_ADDRESS=$TF_HTTP_LOCK_ADDRESS
<<: *deploy_common
.test_rpms_common: &test_rpms_common
image: $DOCKER_URL/node:12-buster
stage: integration test
tags:
- as3-test-docker-executor
script:
- apt-get update && apt-get install -y jq --no-install-recommends
- npm ci --no-optional
- npm install --no-optional
- REPO=f5-appsvcs-extension
- if [[ "$TEST_CODE_VERSION" != $"CI_COMMIT_REF_NAME" ]]; then
- echo running test code from "$TEST_CODE_VERSION"
- if [[ "$TEST_CODE_VERSION" =~ ^v ]]; then
- if [[ "$TEST_CODE_VERSION" < v3.42.0 ]]; then
- REPO=f5-appsvcs
- fi
- fi
- TOP_DIR=$(pwd)
- TEST_CODE_DIR=test_code_repo/f5-appsvcs-extension
- git clone --branch "$TEST_CODE_VERSION" --single-branch https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}/automation-toolchain/${REPO}.git "$TEST_CODE_DIR"
- cd "$TEST_CODE_DIR"
- node scripts/build/schema-build.js
- cd "$TOP_DIR"
- else
- echo running test code from current branch
- TEST_CODE_DIR=.
- fi
- MOCHA_OPTS=$TEST_REPORTER_OPTIONS
- if [[ -f ${TEST_CODE_DIR}/test/integration/bigip/property/mochaHooks.js ]]; then
- MOCHA_OPTS="${MOCHA_OPTS} --require ${TEST_CODE_DIR}/test/integration/bigip/property/mochaHooks.js"
- fi
- if [[ "$PARALLEL" = "true" ]]; then
- MOCHA_OPTS="${MOCHA_OPTS} --parallel"
- fi
- echo "TESTING WITH IMAGE ${BIGIP_IMAGE}"
- if [ "$SMOKE_TEST" = "true" ]; then
- export REGRESSION_SCHEDULE="smoke"
- fi
- export FILE_VERBOSITY=verbose
- if [ "$REGRESSION_SCHEDULE" = "nightly" ]; then
- npx mocha ${TEST_CODE_DIR}/test/integration/bigip/property ${TEST_CODE_DIR}/test/integration/bigip/misc $MOCHA_OPTS --exit
- elif [ "$REGRESSION_SCHEDULE" = "remote" ]; then
- npm run property -- $MOCHA_OPTS --exit
- elif [ "$REGRESSION_SCHEDULE" = "smoke" ]; then
- npm run smoke -- $MOCHA_OPTS
- elif [ "$REGRESSION_SCHEDULE" = "performance" ]; then
- ./scripts/dev/enable-perf-tracing.sh "$AS3_HOST" ${AS3_USERNAME}:${AS3_PASSWORD} "$JAEGER_ENDPOINT"
- npx mocha ${TEST_CODE_DIR}/test/integration/bigip/property $MOCHA_OPTS --exit
- else
- npm run misc -- $MOCHA_OPTS --exit
- fi
test_rpms_in_azure:
timeout: 12 hours
rules:
- if: '$SKIP_TEST_IN_AZURE =~ /true/i'
when: never
- if: '$TEST_IN_AZURE =~ /true/i'
variables:
TEST_RESOURCES_URL: "$TEST_RESOURCES_URL_AZURE"
<<: *test_rpms_common
artifacts:
name: f5-appsvcs-extension-$CI_BUILD_REF
when: always
paths:
- test/logs
reports:
junit: test_report.xml
needs:
- job: schema
artifacts: true
- job: build_rpm
artifacts: true
- job: deploy_to_azure
artifacts: true
test_rpms_for_this_project:
timeout: 12 hours
rules:
- if: '$TEST_IN_AZURE =~ /true/i'
when: never
- if: '$UPDATE_DEPS =~ /true/i'
when: never
- if: '$CI_PIPELINE_SOURCE == "schedule"'
- if: '$FORCE_INTEGRATION_TEST =~ /true/i'
<<: *test_rpms_common
artifacts:
name: f5-appsvcs-extension-$CI_BUILD_REF
when: always
paths:
- test/logs
reports:
junit: test_report.xml
needs:
- job: schema
artifacts: true
- job: deploy_for_this_project
artifacts: true
- job: build_rpm
artifacts: true
test_rpms_for_other_project:
timeout: 12 hours
rules:
- if: '$TEST_IN_AZURE =~ /true/i'
when: never
- if: '$TRIGGER_INTEGRATION_TEST =~ /true/i'
<<: *test_rpms_common
artifacts:
name: f5-appsvcs-extension-$CI_BUILD_REF
when: always
paths:
- test/logs
reports:
junit: test_report.xml
needs:
- job: schema
artifacts: true
- job: deploy_for_other_project
artifacts: true
- project: "$UPSTREAM_PROJECT_PATH"
job: "$UPSTREAM_JOB"
ref: "$UPSTREAM_REF"
artifacts: true
.teardown_common: &teardown_common
image: $INTEGRATION_DEPLOY_IMAGE
tags:
- as3-test-docker-executor
stage: teardown
script:
- cd "$TF_ROOT"
- terraform init
- terraform destroy --var bigip_version="${BIGIP_IMAGE}"
- if [[ "$PARALLEL" = "true" ]]; then
- echo "Delete server-set $SERVER_SET from $RESERVATION_SERVER_HOST:$RESERVATION_SERVER_PORT"
- curl -s --retry 5 --retry-max-time 300 -X DELETE http://$RESERVATION_SERVER_HOST:$RESERVATION_SERVER_PORT/reservations/api/server-sets/id/$SERVER_SET
- fi
retry:
max: 1
when: script_failure
teardown_azure:
rules:
- if: '$SKIP_TEARDOWN =~ /true/i'
when: never
- if: '$TEST_IN_AZURE =~ /true/i'
when: always
variables:
F5_DISABLE_CERT_VERIFY: 'true'
TF_VAR_f5_cidr_blocks: "${F5_CIDR_BLOCKS}"
TF_ROOT: "$TF_DIRECTORY/plans/azure"
before_script:
# terraform doesn't support '.' in backend address.
- export TRIM_VERSION="$(echo ${BIGIP_IMAGE} | cut -d '-' -f 2 | tr '.' -)"
- if [[ "$PARALLEL" = "true" ]]; then
- export TF_HTTP_ADDRESS="$TF_STATE_URL/parallel-azure-$TRIM_VERSION"
- else
- export TF_HTTP_ADDRESS="$TF_STATE_URL/azure-$TRIM_VERSION"
- fi
<<: *teardown_common
teardown_openstack:
rules:
- if: '$SKIP_TEARDOWN =~ /true/i'
when: never
- if: '$TEST_IN_AZURE =~ /true/i'
when: never
- if: '$UPDATE_DEPS =~ /true/i'
when: never
- if: '$CI_PIPELINE_SOURCE == "schedule"'
when: always
- if: '$TRIGGER_INTEGRATION_TEST =~ /true/i'
when: always
- if: '$FORCE_INTEGRATION_TEST =~ /true/i'
when: always
variables:
TF_ROOT: "$TF_DIRECTORY/plans/openstack"
before_script:
# terraform doesn't support '.' in backend address.
- export TRIM_VERSION="$(echo ${BIGIP_IMAGE} | cut -d '-' -f 2 | tr '.' -)"
- if [[ "$PARALLEL" = "true" ]]; then
- export TF_HTTP_ADDRESS="$TF_STATE_URL/parallel-openstack-$TRIM_VERSION"
- elif [ "$REGRESSION_SCHEDULE" = "remote" ]; then
- export TF_VAR_bigip_count=2
- export TF_HTTP_ADDRESS="$TF_STATE_URL/remote-openstack-$TRIM_VERSION"
- elif [ "$REGRESSION_SCHEDULE" = "performance" ]; then
- export TF_VAR_performance_test=true
- export TF_HTTP_ADDRESS="$TF_STATE_URL/performance-openstack-$TRIM_VERSION"
- elif [ "$TRIGGER_INTEGRATION_TEST" = "true" ]; then
- export BIGIP_IMAGE="${BIGIP_IMAGE_DEFAULT}"
- export TRIM_VERSION="$(echo ${BIGIP_IMAGE} | cut -d '-' -f 2 | tr '.' -)"
- export TF_HTTP_ADDRESS="$TF_STATE_URL/atg-build-openstack-$TRIM_VERSION"
- else
- export TF_HTTP_ADDRESS="$TF_STATE_URL/openstack-$TRIM_VERSION"
- fi
<<: *teardown_common
# DOCS
create_docs:
image: ${CONTAINTHEDOCS_IMAGE}
stage: post build
allow_failure: true
needs:
- build_api_docs
script:
- npm ci --no-optional
- npm run build-schema
- node scripts/build/schema-to-rst.js
- node scripts/build/create-examples-collection.js
- if [ "$CI_COMMIT_REF_NAME" = "docs-staging" ] || [ "$CI_COMMIT_REF_NAME" = "docs-0.0" ] || [ "$CI_COMMIT_REF_NAME" = "docs-latest" ] || [ "$CI_COMMIT_REF_NAME" = "docs-3.13.1" ] || [ "$CI_COMMIT_REF_NAME" = "docs-3.5.1" ]; then
- rm -rf docs/_templates
- fi
- npm install [email protected]
- make html
- API_DOCS_INDEX=${DOCS_BUILD_DIR}/refguide/apidocs.html
- cp apidocs/index.html ${API_DOCS_INDEX}
- echo "Checking grammar and style"
# Runs the grammar check on everything except the /docs/drafts directory
- vale --glob='*.rst' .
- echo "Checking links"
- make linkcheck
# build developer documentation (optional)
- if [ "$CI_COMMIT_REF_NAME" = "master" ]; then
- npm install --registry $NPM_REGISTRY_URL -g jsdoc
- jsdoc src/nodejs/* -d contributing
- fi
tags:
- cm-official-docker-executor
artifacts:
expire_in: 1 week
name: sphinx-docs_$CI_BUILD_REF
paths:
- docs/_build/html
- contributing
- examples/as3.examples.collection.json
# Deploy docs to Pages for review
pages:
stage: docs
allow_failure: true
environment:
name: staging
url: https://${CI_PROJECT_NAMESPACE}.${PAGES_DOMAIN}/${CI_PROJECT_NAME}/
tags:
- cm-official-docker-executor
needs:
- create_docs
- coverage
script:
- PUBLIC_DIR='./public'
- PUBLIC_DOCS=${PUBLIC_DIR}/public-docs
- COVERAGE_DOCS=${PUBLIC_DIR}/coverage-docs
- mkdir -p ${PUBLIC_DIR}
- mkdir -p ${PUBLIC_DOCS}
- mkdir -p ${COVERAGE_DOCS}
- cp docs/index.html ${PUBLIC_DIR}/index.html
- cp -R docs/_build/html/* ${PUBLIC_DOCS}
- cp -R coverage/* ${COVERAGE_DOCS}
artifacts:
paths:
- public
only:
- develop
- doc-release-branch
- joes-as3-wip
- /^atgs-.*$/i
# Publish docs to clouddocs.f5.com
docs_to_production:
image: ${CONTAINTHEDOCS_IMAGE}
stage: docs
environment:
name: production
url: https://clouddocs.f5.com/products/extensions/f5-appsvcs-extension/latest
only:
# Currently will only deploy to clouddocs.f5.com on commits to docs-latest
# fill in desired release branch name and uncomment to add deployment from a branch
- docs-latest
tags:
- cm-official-docker-executor
needs:
- create_docs
script:
# Uncomment and set to create desired version format
- aws s3 sync docs/_build/html s3://clouddocs.f5.com/products/extensions/f5-appsvcs-extension/latest
- aws s3 cp versions.json s3://clouddocs.f5.com/products/extensions/f5-appsvcs-extension/versions.json
# create invalidation to clear cloudfront cache
# - aws cloudfront create-invalidation --distribution-id $AWS_DIST --paths /products/extensions/f5-appsvcs-extension/latest