-
Notifications
You must be signed in to change notification settings - Fork 38
/
pull-requests-mergify.yml
812 lines (801 loc) · 28 KB
/
pull-requests-mergify.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
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
# This configuration has been automatically generated by the CircleCI Config SDK.
# For more information, see https://github.com/CircleCI-Public/circleci-config-sdk-ts
# SDK Version: 0.0.0-development
version: 2.1
setup: false
parameters:
gio_action:
type: string
default: pull_requests
description: ""
dry_run:
type: boolean
default: true
description: Run in dry run mode?
docker_tag_as_latest:
type: boolean
default: false
description: Is this version the latest version available?
graviteeio_version:
type: string
default: ""
description: Version of APIM to be used in docker images
apim_version_path:
type: string
default: /home/circleci/project/pom.xml
description: Path to pom.xml with APIM version
commands:
cmd-restore-maven-job-cache:
parameters:
jobName:
type: string
default: ""
description: The job name
steps:
- restore_cache:
keys:
- gravitee-api-management-v9-<< parameters.jobName >>-{{ .Branch }}-{{ checksum "pom.xml" }}
- gravitee-api-management-v9-<< parameters.jobName >>-{{ .Branch }}
- gravitee-api-management-v9-<< parameters.jobName >>
description: Restore Maven cache for a dedicated job
cmd-save-maven-job-cache:
parameters:
jobName:
type: string
default: ""
description: The job name
steps:
- run:
name: Exclude all APIM artefacts from cache.
command: rm -rf ~/.m2/repository/io/gravitee/apim
- save_cache:
key: gravitee-api-management-v9-<< parameters.jobName >>-{{ .Branch }}-{{ checksum "pom.xml" }}
paths:
- ~/.m2
when: always
description: Save Maven cache for a dedicated job
cmd-notify-on-failure:
steps:
- keeper/env-export:
secret-url: keeper://ZOz4db245GNaETVwmPBk8w/field/password
var-name: SLACK_ACCESS_TOKEN
- slack/notify:
channel: C02JENTV2AX
branch_pattern: master,[0-9]+\.[0-9]+\.x
event: fail
template: basic_fail_1
cmd-webui-install:
parameters:
apim-ui-project:
type: string
default: ""
description: the name of the UI project to build
steps:
- restore_cache:
name: Restore NPM cache
keys:
- << parameters.apim-ui-project >>-cache-v1-{{ .Branch }}-{{ checksum "<< parameters.apim-ui-project >>/package-lock.json" }}
- << parameters.apim-ui-project >>-cache-v1-{{ .Branch }}
- run:
name: Install dependencies
command: npm install
working_directory: << parameters.apim-ui-project >>
- save_cache:
name: Save NPM cache
key: << parameters.apim-ui-project >>-cache-v1-{{ .Branch }}-{{ checksum "<< parameters.apim-ui-project >>/package-lock.json" }}
paths:
- ./<< parameters.apim-ui-project >>/node_modules
cmd-create-docker-context:
steps:
- run:
name: Create docker context for buildx
command: |-
docker context create tls-env
docker buildx create tls-env --use
cmd-docker-azure-login:
steps:
- keeper/env-export:
secret-url: keeper://Q721P2LSOPJ9qiXLuf5AHQ/field/login
var-name: AZURE_DOCKER_REGISTRY_USERNAME
- keeper/env-export:
secret-url: keeper://Q721P2LSOPJ9qiXLuf5AHQ/field/password
var-name: AZURE_DOCKER_REGISTRY_PASSWORD
- run:
name: Login to Azure Container Registry
command: echo $AZURE_DOCKER_REGISTRY_PASSWORD | docker login --username $AZURE_DOCKER_REGISTRY_USERNAME --password-stdin graviteeio.azurecr.io
description: Login to Azure Container Registry
cmd-docker-azure-logout:
steps:
- run:
name: Logout from Azure Container Registry
command: docker logout graviteeio.azurecr.io
description: Logout from Azure Container Registry
cmd-build-ui-image:
parameters:
docker-image-name:
type: string
default: ""
description: the name of the image
apim-ui-project:
type: string
default: ""
description: the name of the UI project to build
steps:
- cmd-create-docker-context
- cmd-docker-azure-login
- run:
name: Build UI docker image
command: |-
docker buildx build --push --platform=linux/arm64,linux/amd64 -f docker/Dockerfile \
-t graviteeio.azurecr.io/<< parameters.docker-image-name >>:mergify-bp-4.0.x-pr-1234-latest \
.
working_directory: << parameters.apim-ui-project >>
- cmd-docker-azure-logout
jobs:
job-test-apim-charts:
docker:
- image: cimg/base:stable
resource_class: small
steps:
- checkout
- helm/install_helm_client:
version: v3.12.3
- run:
name: Install helm-unittest plugin
command: helm plugin install https://github.com/quintush/helm-unittest --version 0.2.11
- run:
name: Lint the helm charts available in helm/
command: helm lint helm/
- run:
name: Execute the units tests in helm/
command: helm unittest -3 -f 'tests/**/*.yaml' helm/ -t JUnit -o apim-result.xml
- store_test_results:
path: apim-result.xml
job-setup:
docker:
- image: cimg/base:stable
resource_class: small
steps:
- checkout
- keeper/env-export:
secret-url: keeper://7CgijuGiFDSLynRJt1Dm9w/custom_field/xml
var-name: MAVEN_SETTINGS
- run:
command: "echo $MAVEN_SETTINGS > .gravitee.settings.xml "
- persist_to_workspace:
root: .
paths:
- .gravitee.settings.xml
job-validate:
docker:
- image: cimg/openjdk:17.0.8
resource_class: small
steps:
- checkout
- attach_workspace:
at: .
- cmd-restore-maven-job-cache:
jobName: job-validate
- run:
name: Validate project
command: mvn -s .gravitee.settings.xml validate --no-transfer-progress -Pall-modules,integration-tests-modules -T 2C
- cmd-notify-on-failure
- cmd-save-maven-job-cache:
jobName: job-validate
job-danger-js:
docker:
- image: cimg/node:16.13
resource_class: small
steps:
- checkout
- keeper/env-export:
secret-url: keeper://TIlcGPFq4rN5GvgnZb9hng/field/password
var-name: DANGER_GITHUB_API_TOKEN
- run:
name: Run Danger JS
command: cd .circleci/danger && yarn run danger
job-build:
docker:
- image: cimg/openjdk:17.0.8
resource_class: large
steps:
- checkout
- attach_workspace:
at: .
- cmd-restore-maven-job-cache:
jobName: job-build
- run:
name: Build project
command: |-
mvn -s .gravitee.settings.xml clean install --no-transfer-progress --update-snapshots -DskipTests -Dskip.validation=true -T 2C -Dbundle=dev
mkdir -p ./rest-api-docker-context/distribution && cp -r ./gravitee-apim-rest-api/gravitee-apim-rest-api-standalone/gravitee-apim-rest-api-standalone-distribution/target/distribution ./rest-api-docker-context/.
mkdir -p ./gateway-docker-context/distribution && cp -r ./gravitee-apim-gateway/gravitee-apim-gateway-standalone/gravitee-apim-gateway-standalone-distribution/target/distribution ./gateway-docker-context/.
environment:
BUILD_ID: "1234"
BUILD_NUMBER: "1234"
GIT_COMMIT: 784ff35ca
- cmd-notify-on-failure
- save_cache:
paths:
- ~/.m2/repository/io/gravitee/apim
key: gravitee-api-management-v9-build-apim-{{ .Environment.CIRCLE_WORKFLOW_WORKSPACE_ID }}
when: on_success
- cmd-save-maven-job-cache:
jobName: job-build
- persist_to_workspace:
root: ./
paths:
- ./gravitee-apim-rest-api/gravitee-apim-rest-api-management/gravitee-apim-rest-api-management-rest/target/classes/console-openapi.*
- ./rest-api-docker-context
- ./gateway-docker-context
job-test-definition:
docker:
- image: cimg/openjdk:17.0.8
resource_class: small
steps:
- checkout
- attach_workspace:
at: .
- cmd-restore-maven-job-cache:
jobName: job-test-definition
- restore_cache:
keys:
- gravitee-api-management-v9-build-apim-{{ .Environment.CIRCLE_WORKFLOW_WORKSPACE_ID }}
- run:
name: Run definition tests
command: mvn --fail-fast -s .gravitee.settings.xml test --no-transfer-progress -Ddefinition-modules -Dskip.validation=true -T 2C
- run:
name: Save test results
command: |-
mkdir -p ~/test-results/junit/
find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} ~/test-results/junit/ \;
when: always
- cmd-notify-on-failure
- cmd-save-maven-job-cache:
jobName: job-test-definition
- store_test_results:
path: ~/test-results
- persist_to_workspace:
root: .
paths:
- gravitee-apim-definition/gravitee-apim-definition-coverage/target/site/jacoco-aggregate/
job-test-gateway:
docker:
- image: cimg/openjdk:17.0.8
resource_class: medium
steps:
- checkout
- attach_workspace:
at: .
- cmd-restore-maven-job-cache:
jobName: job-test-gateway
- restore_cache:
keys:
- gravitee-api-management-v9-build-apim-{{ .Environment.CIRCLE_WORKFLOW_WORKSPACE_ID }}
- run:
name: Run gateway tests
command: mvn --fail-fast -s .gravitee.settings.xml test --no-transfer-progress -Dgateway-modules -Dskip.validation=true -T 2C
- run:
name: Save test results
command: |-
mkdir -p ~/test-results/junit/
find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} ~/test-results/junit/ \;
when: always
- cmd-notify-on-failure
- cmd-save-maven-job-cache:
jobName: job-test-gateway
- store_test_results:
path: ~/test-results
- persist_to_workspace:
root: .
paths:
- gravitee-apim-gateway/gravitee-apim-gateway-coverage/target/site/jacoco-aggregate/
job-test-rest-api:
docker:
- image: cimg/openjdk:17.0.8
resource_class: medium
steps:
- checkout
- attach_workspace:
at: .
- cmd-restore-maven-job-cache:
jobName: job-test-rest-api
- restore_cache:
keys:
- gravitee-api-management-v9-build-apim-{{ .Environment.CIRCLE_WORKFLOW_WORKSPACE_ID }}
- run:
name: Run Rest API tests
command: mvn --fail-fast -s .gravitee.settings.xml test --no-transfer-progress -Drest-api-modules -Dskip.validation=true -T 2C
- run:
name: Save test results
command: |-
mkdir -p ~/test-results/junit/
find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} ~/test-results/junit/ \;
when: always
- cmd-notify-on-failure
- cmd-save-maven-job-cache:
jobName: job-test-rest-api
- store_test_results:
path: ~/test-results
- persist_to_workspace:
root: .
paths:
- gravitee-apim-rest-api/gravitee-apim-rest-api-coverage/target/site/jacoco-aggregate/
job-test-integration:
machine:
image: ubuntu-2204:current
docker_layer_caching: false
resource_class: medium
steps:
- checkout
- attach_workspace:
at: .
- cmd-restore-maven-job-cache:
jobName: job-test-integration
- restore_cache:
keys:
- gravitee-api-management-v9-build-apim-{{ .Environment.CIRCLE_WORKFLOW_WORKSPACE_ID }}
- run:
name: Run tests
command: |-
cd gravitee-apim-integration-tests
# List all tests
circleci tests glob "src/test/java/**/*Test.java" | sed -e 's#^src/test/java/\(.*\)\.java#\1#' | tr "/" "." > all-tests
# List all tests to run on this executor
cat all-tests | circleci tests split --split-by=timings --timings-type=classname --time-default=10s > tests-to-run
# Compute exclusion list (use grep to invert the include list to an exclude list)
cat all-tests | grep -xvf tests-to-run > /tmp/ignore_list
# Add * add the end of each line of ignore_list to also exclude all inner classes
sed -i 's/$/*/' /tmp/ignore_list
# Display tests to run on this executor
echo "Following test files will run on this executor:"
cat tests-to-run
# Run tests with rerunFailingTestsCount=2 because some integration tests related to RabbitMQ or Websocket are randomly failing on the CI
mvn --fail-fast -s ../.gravitee.settings.xml test --no-transfer-progress -Dskip.validation=true -Dsurefire.excludesFile=/tmp/ignore_list -Dsurefire.rerunFailingTestsCount=2
- run:
name: Save test results
command: |-
mkdir -p ~/test-results/junit/
find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} ~/test-results/junit/ \;
when: always
- cmd-notify-on-failure
- cmd-save-maven-job-cache:
jobName: job-test-integration
- store_test_results:
path: ~/test-results
parallelism: 4
job-test-plugin:
machine:
image: ubuntu-2204:current
docker_layer_caching: false
resource_class: medium
steps:
- checkout
- attach_workspace:
at: .
- cmd-restore-maven-job-cache:
jobName: job-test-plugin
- restore_cache:
keys:
- gravitee-api-management-v9-build-apim-{{ .Environment.CIRCLE_WORKFLOW_WORKSPACE_ID }}
- run:
name: Run plugin tests
command: mvn --fail-fast -s .gravitee.settings.xml test --no-transfer-progress -Dplugin-modules -Dskip.validation=true -T 2C
- run:
name: Save test results
command: |-
mkdir -p ~/test-results/junit/
find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} ~/test-results/junit/ \;
when: always
- cmd-notify-on-failure
- cmd-save-maven-job-cache:
jobName: job-test-plugin
- store_test_results:
path: ~/test-results
- persist_to_workspace:
root: .
paths:
- gravitee-apim-plugin/gravitee-apim-plugin-coverage/target/site/jacoco-aggregate/
job-test-repository:
machine:
image: ubuntu-2204:current
docker_layer_caching: false
resource_class: large
steps:
- checkout
- attach_workspace:
at: .
- cmd-restore-maven-job-cache:
jobName: job-test-repository
- restore_cache:
keys:
- gravitee-api-management-v9-build-apim-{{ .Environment.CIRCLE_WORKFLOW_WORKSPACE_ID }}
- run:
name: Run repository tests
command: mvn --fail-fast -s .gravitee.settings.xml verify --no-transfer-progress -Drepository-modules -Dskip.validation=true -T 2C
- run:
name: Save test results
command: |-
mkdir -p ~/test-results/junit/
find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} ~/test-results/junit/ \;
when: always
- cmd-notify-on-failure
- cmd-save-maven-job-cache:
jobName: job-test-repository
- store_test_results:
path: ~/test-results
- persist_to_workspace:
root: .
paths:
- gravitee-apim-repository/gravitee-apim-repository-coverage/target/site/jacoco-aggregate/
job-sonarcloud-analysis:
parameters:
working_directory:
type: string
default: gravitee-apim-rest-api
description: Directory where the Sonarcloud analysis will be run
docker:
- image: sonarsource/sonar-scanner-cli:5.0.1
resource_class: large
steps:
- run:
name: Add SSH tool
command: apk add --no-cache openssh
- checkout
- attach_workspace:
at: .
- restore_cache:
keys:
- gravitee-api-management-v9-sonarcloud-analysis-<< parameters.working_directory >>-{{ .Branch }}-{{ checksum "pom.xml" }}
- gravitee-api-management-v9-sonarcloud-analysis-<< parameters.working_directory >>-{{ .Branch }}
- gravitee-api-management-v9-sonarcloud-analysis-<< parameters.working_directory >>
- keeper/env-export:
secret-url: keeper://9x9YgyU6DWzux4DPoHAzDQ/field/password
var-name: SONAR_TOKEN
- run:
name: Run Sonarcloud Analysis
command: sonar-scanner -Dsonar.projectVersion=4.2.0
working_directory: << parameters.working_directory >>
- cmd-notify-on-failure
- save_cache:
paths:
- /opt/sonar-scanner/.sonar/cache
key: gravitee-api-management-v9-sonarcloud-analysis-<< parameters.working_directory >>-{{ .Branch }}-{{ checksum "pom.xml" }}
when: always
job-webui-lint-test:
parameters:
apim-ui-project:
type: string
default: ""
description: the name of the UI project to build
resource_class:
type: string
default: medium
description: Resource class to use for executor
node_version:
type: string
default: "20.11"
description: Node version to use for executor
docker:
- image: cimg/node:<< parameters.node_version >>
resource_class: << parameters.resource_class >>
steps:
- checkout
- cmd-webui-install:
apim-ui-project: << parameters.apim-ui-project >>
- attach_workspace:
at: .
- run:
name: Check License
command: npm run lint:license
working_directory: << parameters.apim-ui-project >>
- run:
name: Run Prettier and ESLint
command: npm run lint
working_directory: << parameters.apim-ui-project >>
- run:
name: Run unit tests
command: npm run test:coverage
working_directory: << parameters.apim-ui-project >>
- cmd-notify-on-failure
- persist_to_workspace:
root: .
paths:
- << parameters.apim-ui-project >>/coverage/lcov.info
- store_artifacts:
path: << parameters.apim-ui-project >>/coverage/lcov.info
- store_test_results:
path: << parameters.apim-ui-project >>/coverage/junit.xml
job-webui-build:
parameters:
apim-ui-project:
type: string
default: ""
description: the name of the UI project to build
docker-image-name:
type: string
default: ""
description: the name of the image
node_version:
type: string
default: "20.11"
description: Node version to use for executor
docker:
- image: cimg/node:<< parameters.node_version >>
resource_class: large
steps:
- checkout
- attach_workspace:
at: .
- setup_remote_docker:
version: default
- cmd-webui-install:
apim-ui-project: << parameters.apim-ui-project >>
- run:
name: Update Build version
command: "sed -i 's/\"version\": \".*\"/\"version\": \"4.2.0\"/' << parameters.apim-ui-project >>/build.json"
- run:
name: Build
command: npm run build:prod
environment:
NODE_OPTIONS: --max_old_space_size=4086
working_directory: << parameters.apim-ui-project >>
- cmd-build-ui-image:
docker-image-name: << parameters.docker-image-name >>
apim-ui-project: << parameters.apim-ui-project >>
- cmd-notify-on-failure
- persist_to_workspace:
root: .
paths:
- << parameters.apim-ui-project >>/dist
job-console-webui-build-storybook:
parameters:
node_version:
type: string
default: "20.11"
description: Node version to use for executor
docker:
- image: cimg/node:<< parameters.node_version >>
resource_class: large
steps:
- checkout
- cmd-webui-install:
apim-ui-project: gravitee-apim-console-webui
- run:
name: Build
command: npm run build-storybook
working_directory: gravitee-apim-console-webui
environment:
NODE_OPTIONS: --max_old_space_size=8192
- cmd-notify-on-failure
- persist_to_workspace:
root: .
paths:
- gravitee-apim-console-webui/storybook-static
job-console-webui-chromatic-deployment:
parameters:
node_version:
type: string
default: "20.11"
description: Node version to use for executor
docker:
- image: cimg/node:<< parameters.node_version >>
resource_class: small
steps:
- checkout
- attach_workspace:
at: .
- cmd-webui-install:
apim-ui-project: gravitee-apim-console-webui
- keeper/env-export:
secret-url: keeper://TIlcGPFq4rN5GvgnZb9hng/field/password
var-name: GITHUB_TOKEN
- keeper/env-export:
secret-url: keeper://Hp1bFl5s0doxnQgqkMdCdg/field/password
var-name: CHROMATIC_PROJECT_TOKEN
- run:
name: Running Chromatic
command: |-
SB_URL=$(cd gravitee-apim-console-webui && npx chromatic --project-token=$CHROMATIC_PROJECT_TOKEN --exit-once-uploaded -d=storybook-static | grep -o "View your Storybook at https:\/\/[0-9a-z-]*\.chromatic\.com" | grep -o "https:.*")
echo "export SB_URL=$SB_URL" >> $BASH_ENV
- gh/setup
- run:
name: Edit Pull Request Description
command: |-
# First check there is an associated pull request, otherwise just stop the job here
if ! gh pr view --json title;
then
echo "No PR found for this branch, stopping the job here."
exit 0
fi
# If PR state is different from OPEN
if [ "$(gh pr view --json state --jq .state)" != "OPEN" ];
then
echo "PR is not opened, stopping the job here."
exit 0
fi
export PR_BODY_STORYBOOK_SECTION="
<!-- Storybook placeholder -->
---
📚 View the storybook of this branch [here](${SB_URL})
<!-- Storybook placeholder end -->
"
export CLEAN_BODY=$(gh pr view --json body --jq .body | sed '/Storybook placeholder -->/,/Storybook placeholder end -->/d')
gh pr edit --body "$CLEAN_BODY$PR_BODY_STORYBOOK_SECTION"
- cmd-notify-on-failure
job-validate-workflow-status:
docker:
- image: cimg/base:stable
resource_class: small
steps:
- run:
name: Check workflow jobs
command: echo "Congratulations! If you can read this, everything is OK"
workflows:
pull_requests:
jobs:
- job-test-apim-charts:
name: Helm Chart - Lint & Test
- job-setup:
name: Setup
context:
- cicd-orchestrator
- job-validate:
name: Validate backend
context:
- cicd-orchestrator
requires:
- Setup
- job-danger-js:
name: Run Danger JS
context:
- cicd-orchestrator
requires:
- Validate backend
- job-build:
name: Build backend
context:
- cicd-orchestrator
requires:
- Validate backend
- job-test-definition:
name: Test definition
context:
- cicd-orchestrator
requires:
- Build backend
- job-test-gateway:
name: Test gateway
context:
- cicd-orchestrator
requires:
- Build backend
- job-test-rest-api:
name: Test rest-api
context:
- cicd-orchestrator
requires:
- Build backend
- job-test-integration:
name: Integration tests
context:
- cicd-orchestrator
requires:
- Build backend
- job-test-plugin:
name: Test plugins
context:
- cicd-orchestrator
requires:
- Build backend
- job-test-repository:
name: Test repository
context:
- cicd-orchestrator
requires:
- Build backend
- job-sonarcloud-analysis:
name: Sonar - gravitee-apim-definition
context:
- cicd-orchestrator
requires:
- Test definition
working_directory: gravitee-apim-definition
- job-sonarcloud-analysis:
name: Sonar - gravitee-apim-gateway
context:
- cicd-orchestrator
requires:
- Test gateway
working_directory: gravitee-apim-gateway
- job-sonarcloud-analysis:
name: Sonar - gravitee-apim-rest-api
context:
- cicd-orchestrator
requires:
- Test rest-api
working_directory: gravitee-apim-rest-api
- job-sonarcloud-analysis:
name: Sonar - gravitee-apim-plugin
context:
- cicd-orchestrator
requires:
- Test plugins
working_directory: gravitee-apim-plugin
- job-sonarcloud-analysis:
name: Sonar - gravitee-apim-repository
context:
- cicd-orchestrator
requires:
- Test repository
working_directory: gravitee-apim-repository
- job-webui-lint-test:
name: Lint & test APIM Console
context:
- cicd-orchestrator
apim-ui-project: gravitee-apim-console-webui
resource_class: xlarge
- job-webui-build:
name: Build APIM Console and publish image
context:
- cicd-orchestrator
apim-ui-project: gravitee-apim-console-webui
docker-image-name: apim-management-ui
- job-console-webui-build-storybook:
name: Build Console Storybook
context:
- cicd-orchestrator
node_version: "20.11"
- job-console-webui-chromatic-deployment:
name: Deploy console in chromatic
context:
- cicd-orchestrator
requires:
- Build Console Storybook
node_version: "20.11"
- job-sonarcloud-analysis:
name: Sonar - gravitee-apim-console-webui
context:
- cicd-orchestrator
requires:
- Lint & test APIM Console
working_directory: gravitee-apim-console-webui
- job-webui-lint-test:
name: Lint & test APIM Portal
context:
- cicd-orchestrator
apim-ui-project: gravitee-apim-portal-webui
resource_class: large
node_version: "20.9"
- job-webui-build:
name: Build APIM Portal and publish image
context:
- cicd-orchestrator
apim-ui-project: gravitee-apim-portal-webui
docker-image-name: apim-portal-ui
node_version: "20.9"
- job-sonarcloud-analysis:
name: Sonar - gravitee-apim-portal-webui
context:
- cicd-orchestrator
requires:
- Lint & test APIM Portal
working_directory: gravitee-apim-portal-webui
- job-validate-workflow-status:
name: Validate workflow status
requires:
- Helm Chart - Lint & Test
- Test definition
- Test gateway
- Test plugins
- Test repository
- Test rest-api
- Lint & test APIM Console
- Build APIM Console and publish image
- Lint & test APIM Portal
- Build APIM Portal and publish image
orbs:
helm: circleci/helm@3.0.0
keeper: gravitee-io/keeper@0.6.3
slack: circleci/slack@4.12.5
gh: circleci/github-cli@1.0.5