-
Notifications
You must be signed in to change notification settings - Fork 37
752 lines (734 loc) · 34.7 KB
/
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
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
name: ACS Packaging CI
on:
pull_request:
branches:
- feature/**
- fix/**
- master
- release/**
push:
branches:
- feature/**
- fix/**
workflow_call:
workflow_dispatch:
env:
AZURE_AUTHENTICATION_MODE: sharedKey
AZURE_STORAGE_ACCOUNT_NAME: acspackagingci
AZURE_STORAGE_ACCOUNT_KEY: ${{ secrets.AZURE_PACKAGING_STORAGE_ACCOUNT_KEY }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }}
GITHUB_ACTIONS_DEPLOY_TIMEOUT: 60
GIT_USERNAME: ${{ secrets.BOT_GITHUB_USERNAME }}
GIT_EMAIL: ${{ secrets.BOT_GITHUB_EMAIL }}
GIT_PASSWORD: ${{ secrets.BOT_GITHUB_TOKEN }}
MAVEN_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }}
QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }}
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }}
CI_WORKSPACE: ${{ github.workspace }}
AWS_REGION: eu-west-1
TAS_ENVIRONMENT: ./tests/environment
TAS_SCRIPTS: ../alfresco-community-repo/packaging/tests/scripts
ALF_LICENCE_S3_PATH: s3://acs-license/acs/alf23-allenabled.lic
ALF_LICENCE_LOCAL_PATH: /tmp/licence.lic
PYTHON_VERSION: 3.7.15
DTAS_VERSION: v1.5.5
jobs:
veracode_sca:
name: "Source Clear Scan (SCA)"
runs-on: ubuntu-latest
if: >
(github.ref_name == 'master' || startsWith(github.ref_name, 'release/') || github.event_name == 'pull_request') &&
!contains(github.event.head_commit.message, '[skip tests]')
steps:
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- name: "Init"
run: bash ./scripts/ci/init.sh
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
continue-on-error: true
with:
srcclr-api-token: ${{ secrets.SRCCLR_API_TOKEN }}
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh
veracode_sast_acs:
name: "Pipeline SAST Scan - ACS"
runs-on: ubuntu-latest
if: >
(github.ref_name == 'master' || startsWith(github.ref_name, 'release/') || github.event_name == 'pull_request') &&
github.actor != 'dependabot[bot]' &&
!contains(github.event.head_commit.message, '[skip tests]')
steps:
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- uses: actions/checkout@v4
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
with:
token: ${{ secrets.BOT_GITHUB_TOKEN }}
repository: "Alfresco/veracode-baseline-archive"
file-path: "acs-packaging/acs-packaging-acs-baseline.json"
target: "baseline.json"
- name: "Build"
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: |
bash ./scripts/ci/init.sh
bash ./scripts/ci/build.sh
- name: "Run SAST Scan"
uses: veracode/[email protected]
with:
vid: '${{ secrets.VERACODE_API_ID }}'
vkey: '${{ secrets.VERACODE_API_KEY }}'
file: "distribution/target/alfresco.war"
fail_build: true
project_name: acs-packaging-acs
issue_details: true
veracode_policy_name: Alfresco Default
summary_output: true
summary_output_file: results.json
summary_display: true
baseline_file: baseline.json
- name: Upload scan result
if: success() || failure()
run: zip readable_output.zip results.json
- name: Upload Artifact
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: Veracode Pipeline-Scan Results - ACS (Human Readable)
path: readable_output.zip
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh
### TODO: Implement SAST scan for Share when it starts working, since currently scanning Share crashes the Veracode engine
pmd_scan:
name: "PMD Scan"
runs-on: ubuntu-latest
if: >
github.event_name == 'pull_request' &&
!contains(github.event.head_commit.message, '[skip pmd]') &&
!contains(github.event.head_commit.message, '[skip tests]')
steps:
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- uses: Alfresco/[email protected]
with:
classpath-build-command: "bash ./scripts/ci/init.sh && bash ./scripts/ci/build.sh"
tas_tests:
name: ${{ matrix.testSuite }} TAS tests
runs-on: ubuntu-latest
if: >
contains(github.event.head_commit.message, '[tas]') &&
!contains(github.event.head_commit.message, '[skip tests]')
strategy:
fail-fast: false
matrix:
include:
- testSuite: REST API part1
pom-dir: tests/tas-restapi
profiles: all-tas-tests,run-restapi-part1
compose-file: docker-compose-rest-api-tests.yml
deploy-timeout: 60
- testSuite: REST API part2
pom-dir: tests/tas-restapi
profiles: all-tas-tests,run-restapi-part2
compose-file: docker-compose-rest-api-tests.yml
deploy-timeout: 60
- testSuite: REST API part3
pom-dir: tests/tas-restapi
profiles: all-tas-tests,run-restapi-part3
compose-file: docker-compose-rest-api-tests.yml
deploy-timeout: 60
- testSuite: CMIS (BROWSER binding)
pom-dir: tests/tas-cmis
profiles: all-tas-tests,run-cmis-browser
compose-file: docker-compose-cmis-tests.yml
deploy-timeout: 60
- testSuite: CMIS (ATOM binding)
pom-dir: tests/tas-cmis
profiles: all-tas-tests,run-cmis-atom
compose-file: docker-compose-cmis-tests.yml
deploy-timeout: 60
- testSuite: CMIS (WEBSERVICES binding)
pom-dir: tests/tas-cmis
profiles: all-tas-tests,run-cmis-webservices
compose-file: docker-compose-cmis-tests.yml
deploy-timeout: 60
- testSuite: Email
pom-dir: tests/tas-email
profiles: all-tas-tests
compose-file: docker-compose-email-tests.yml
deploy-timeout: 30
- testSuite: WebDAV
pom-dir: tests/tas-webdav
profiles: all-tas-tests
compose-file: docker-compose-minimal.yml
deploy-timeout: 20
- testSuite: Integration
pom-dir: tests/tas-integration
profiles: all-tas-tests
compose-file: docker-compose-integration-tests.yml
deploy-timeout: 30
- testSuite: LDAP
pom-dir: tests/tas-integration
profiles: run-ldap
compose-file: docker-compose-with-ldap.yml
deploy-timeout: 10
steps:
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- name: "Build"
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: |
bash ./scripts/ci/init.sh
bash ./scripts/ci/build.sh
- name: "Set up the environment"
run: |
${{ env.TAS_SCRIPTS }}/start-compose.sh ${{ env.TAS_ENVIRONMENT }}/${{ matrix.compose-file }}
${{ env.TAS_SCRIPTS }}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
- name: "Run tests"
id: tests
timeout-minutes: ${{ matrix.deploy-timeout }}
run: mvn -B install -ntp -f ${{ matrix.pom-dir }}/pom.xml -P${{ matrix.profiles }} -Denvironment=default -DrunBugs=false
- name: "Print output after failure"
if: ${{ always() && steps.tests.outcome == 'failure' }}
run: ${TAS_SCRIPTS}/output_logs_for_failures.sh "${{ matrix.pom-dir }}"
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh
tas_tests_with_aims:
name: ${{ matrix.testSuite }} TAS tests with AIMS
runs-on: ubuntu-latest
if: >
!contains(github.event.head_commit.message, '[skip tas]') &&
!contains(github.event.head_commit.message, '[skip tests]')
strategy:
fail-fast: false
matrix:
include:
- testSuite: REST API
pom: tests/tas-restapi/pom.xml
profiles: all-tas-tests,run-restapi-aims
log-folder: tests/tas-restapi
deploy-timeout: 60
- testSuite: CMIS - BROWSER binding
pom: tests/tas-cmis/pom.xml
profiles: all-tas-tests,run-cmis-browser-with-aims
log-folder: tests/tas-cmis
deploy-timeout: 40
- testSuite: CMIS - ATOM binding
pom: tests/tas-cmis/pom.xml
profiles: all-tas-tests,run-cmis-atom-with-aims
log-folder: tests/tas-cmis
deploy-timeout: 40
steps:
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- name: "Build"
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: |
bash ./scripts/ci/init.sh
bash ./scripts/ci/build.sh
- name: "Set up the environment"
id: env
run: |
${{ env.TAS_SCRIPTS }}/start-compose.sh ${{ env.TAS_ENVIRONMENT }}/docker-compose-aims.yml
${{ env.TAS_SCRIPTS }}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco" 180
- name: "Run tests"
id: tests
timeout-minutes: ${{ matrix.deploy-timeout }}
run: |
HOST_IP=$(hostname -I | cut -f1 -d' ')
mvn -B install -ntp -f ${{ matrix.pom }} -P${{ matrix.profiles }} -Denvironment=aims-environment -DrunBugs=false "-Didentity-service.auth-server-url=http://${HOST_IP}:8999/auth"
- name: "Print output after failure"
if: ${{ always() && steps.tests.outcome == 'failure' }}
run: ${TAS_SCRIPTS}/output_logs_for_failures.sh ${{ matrix.log-folder }}
- name: "Dump all Docker containers logs"
uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
if: failure() && (steps.tests.outcome == 'failure' || steps.env.outcome == 'failure')
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh
cmis_tas_tests_elasticsearch:
name: CMIS TAS tests - Elastic Search | ${{ matrix.testSuite }} (CMIS API)
runs-on: ubuntu-latest
if: >
!contains(github.event.head_commit.message, '[skip search]') &&
!contains(github.event.head_commit.message, '[skip tests]')
strategy:
fail-fast: false
matrix:
include:
- testSuite: postgreSQL
db-properties: -Ddb.driver=org.postgresql.Driver -Ddb.username=alfresco -Ddb.password=alfresco -Ddb.url=jdbc:postgresql://database:5432/alfresco
compose-file: docker-compose-postgres.yml
- testSuite: MySQL
db-properties: -Ddb.driver=com.mysql.cj.jdbc.Driver -Ddb.username=alfresco -Ddb.password=alfresco -Ddb.url=jdbc:mysql://database:3306/alfresco
compose-file: docker-compose-mysql.yml
- testSuite: MariaDB 10.6
db-properties: -Ddb.driver=org.mariadb.jdbc.Driver -Ddb.username=alfresco -Ddb.password=alfresco -Ddb.url=jdbc:mariadb://database:3306/alfresco
compose-file: docker-compose-mariadb.yml
- testSuite: MS SQL
db-properties: -Ddb.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver -Ddb.username=sa -Ddb.password=Alfresco1 -Ddb.url=jdbc:sqlserver://database:1433 -Ddb.txn.isolation=4096 -Ddb.pool.max=275
compose-file: docker-compose-mssql.yml
- testSuite: Oracle 19.3.0-ee
db-properties: -Ddb.driver=oracle.jdbc.OracleDriver -Ddb.name=alfresco -Ddb.url=jdbc:oracle:thin:@database:1521/PDB1 -Ddb.username=alfresco -Ddb.password=alfresco
compose-file: docker-compose-oracle.yml
steps:
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
with:
merge-disk-volumes: true
root-reserve-mb: 16384
remove-android: 'true'
remove-codeql: 'true'
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- name: "Build"
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: |
bash ./scripts/ci/init.sh
bash ./scripts/ci/build.sh
- name: "Set up the environment configuration"
run: |
echo "CMIS_ALFRESCO_IMAGE=alfresco-repository-databases:latest" >> $GITHUB_ENV
echo "DATABASE_ENV_PROPERTIES=${{matrix.db-properties}}" >> $GITHUB_ENV
- name: "Run the environment"
id: env
run: |
${{ env.TAS_SCRIPTS }}/start-compose.sh ${{ env.TAS_ENVIRONMENT }}/docker-compose-cmis-elastic-tests.yml ${{ env.TAS_ENVIRONMENT }}/${{matrix.compose-file}}
${{ env.TAS_SCRIPTS }}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
- name: "Run tests"
id: tests
timeout-minutes: 40
run: mvn -B install -ntp -f tests/tas-cmis/pom.xml -Pall-tas-tests,run-cmis-with-elastic -Denvironment=default -DrunBugs=false
- name: "Print output after failure"
if: failure() && (steps.tests.outcome == 'failure' || steps.env.outcome == 'failure')
run: ${TAS_SCRIPTS}/output_logs_for_failures.sh "tests/tas-cmis"
- name: "Dump all Docker containers logs"
uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
if: failure() && (steps.tests.outcome == 'failure' || steps.env.outcome == 'failure')
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh
cmis_tas_tests_opensearch:
name: "CMIS TAS tests - Open Search (CMIS API)"
runs-on: ubuntu-latest
if: >
!contains(github.event.head_commit.message, '[skip search]') &&
!contains(github.event.head_commit.message, '[skip tests]')
steps:
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- name: "Build"
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: |
bash ./scripts/ci/init.sh
bash ./scripts/ci/build.sh
- name: "Set up the environment"
run: |
${{ env.TAS_SCRIPTS }}/start-compose.sh ${{ env.TAS_ENVIRONMENT }}/docker-compose-cmis-opensearch-tests.yml
${{ env.TAS_SCRIPTS }}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
- name: "Run tests"
id: tests
timeout-minutes: 40
run: mvn -B install -ntp -f tests/tas-cmis/pom.xml -Pall-tas-tests,run-cmis-with-elastic -Denvironment=default -DrunBugs=false
- name: "Print output after failure"
if: ${{ always() && steps.tests.outcome == 'failure' }}
run: ${TAS_SCRIPTS}/output_logs_for_failures.sh "tests/tas-cmis"
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh
tas_tests_search_api:
name: ${{ matrix.testSuite }} | TAS tests (Search API)
runs-on: alfrescoPub-ubuntu2204-16G-4CPU
if: >
(github.ref_name == 'master' || startsWith(github.ref_name, 'release/') || github.event_name == 'pull_request') &&
!contains(github.event.head_commit.message, '[skip search]') &&
!contains(github.event.head_commit.message, '[skip tests]')
strategy:
fail-fast: false
matrix:
include:
- testSuite: Elasticsearch postgreSQL
profiles: all-tas-tests,elastic
search-engine-type: elasticsearch
db-type: postgresql
- testSuite: Elasticsearch MySQL
profiles: all-tas-tests,elastic
search-engine-type: elasticsearch
db-type: mysql
- testSuite: Elasticsearch Maria DB 10.6
profiles: all-tas-tests,elastic
search-engine-type: elasticsearch
db-type: mariadb
- testSuite: Elasticsearch MS SQL
profiles: all-tas-tests,elastic
search-engine-type: elasticsearch
db-type: mssql
- testSuite: Elasticsearch Oracle 19.3.0-ee
profiles: all-tas-tests,elastic
search-engine-type: elasticsearch
db-type: oracle
- testSuite: Opensearch
profiles: all-tas-tests,elastic
search-engine-type: opensearch
db-type: postgresql
- testSuite: Elasticsearch Basic Auth postgreSQL
profiles: all-tas-tests,elastic-basic-auth
search-engine-type: elasticsearch
db-type: postgresql
- testSuite: Elasticsearch Basic Auth MySQL
profiles: all-tas-tests,elastic-basic-auth
search-engine-type: elasticsearch
db-type: mysql
- testSuite: Elasticsearch Basic Auth MariaDB 10.6
profiles: all-tas-tests,elastic-basic-auth
search-engine-type: elasticsearch
db-type: mariadb
- testSuite: Elasticsearch Basic Auth MS SQL
profiles: all-tas-tests,elastic-basic-auth
search-engine-type: elasticsearch
db-type: mssql
- testSuite: Elasticsearch Basic Auth Oracle 19.3.0-ee
profiles: all-tas-tests,elastic-basic-auth
search-engine-type: elasticsearch
db-type: oracle
- testSuite: Opensearch Basic Auth
profiles: all-tas-tests,elastic-basic-auth
search-engine-type: opensearch
db-type: postgresql
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- name: "Build"
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: |
bash ./scripts/ci/init.sh
bash ./scripts/ci/build.sh
- name: "Run tests"
id: tests
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: mvn -B install -ntp -pl ":content-repository-elasticsearch-test" -am -P${{ matrix.profiles }} -Denvironment=default -DrunBugs=false "-Dsearch.engine.type=${{ matrix.search-engine-type }}" "-Ddatabase.type=${{ matrix.db-type }}" -Dindeximage="alfresco-es-indexing-jdbc:latest" -Dreindeximage="alfresco-es-reindexing-jdbc:latest" -Drepoimage="alfresco-repository-databases:latest"
- name: "Dump all Docker containers logs"
uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
if: failure() && steps.tests.outcome == 'failure'
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh
upgrade_tas_tests:
name: ${{ matrix.testSuite }} Upgrade TAS tests
runs-on: alfrescoPub-ubuntu2204-16G-4CPU
if: >
(github.ref_name == 'master' || startsWith(github.ref_name, 'release/') || github.event_name == 'pull_request') &&
!contains(github.event.head_commit.message, '[skip search]') &&
!contains(github.event.head_commit.message, '[skip tests]')
strategy:
fail-fast: false
matrix:
include:
- testSuite: Elasticsearch
search-engine-type: elasticsearch
- testSuite: Opensearch
search-engine-type: opensearch
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- name: "Build"
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: |
bash ./scripts/ci/init.sh
bash ./scripts/ci/build.sh
- name: "Configure AWS credentials"
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_S3_ACSLICENSE_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_S3_ACSLICENSE_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: "Copy Licence"
run: aws s3 cp ${ALF_LICENCE_S3_PATH} ${ALF_LICENCE_LOCAL_PATH}
- name: "Run tests"
id: tests
timeout-minutes: 30
run: mvn -B install -ntp -pl ":content-repository-elasticsearch-test" -am -Pall-tas-tests,elastic-upgrade -Denvironment=default -DrunBugs=false "-Dsearch.engine.type=${{ matrix.search-engine-type }}" "-Ddatabase.type=postgresql" "-Dindeximage=alfresco-es-indexing-jdbc:latest" "-Dreindeximage=alfresco-es-reindexing-jdbc:latest" "-Drepoimage=alfresco-repository-databases:latest"
- name: "Dump all Docker containers logs"
uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
if: failure() && steps.tests.outcome == 'failure'
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh
all_amps_tests:
name: "All AMPs tests"
runs-on: ubuntu-latest
if: >
!contains(github.event.head_commit.message, '[skip tests]')
steps:
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- name: "Build"
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: |
bash ./scripts/ci/init.sh
bash ./scripts/ci/build.sh
- name: "Set up the environment"
run: mvn -B -q install -ntp -f tests/tas-all-amps/pom.xml -DskipTests -Pall-tas-tests,prepare-wars-with-amps
- name: "Check duplicate libraries"
run: ./tests/scripts/checkLibraryDuplicates.sh ./tests/tas-all-amps/target/war/alfresco/WEB-INF/lib
- name: "Run the environment"
id: env
env:
AWS_ACCESS_KEY: ${{ secrets.AWS_S3_PIPELINE_AMPS_ACCESS_KEY_ID }}
AWS_SECRET_KEY: ${{ secrets.AWS_S3_PIPELINE_AMPS_SECRET_ACCESS_KEY }}
run: |
${{ env.TAS_SCRIPTS }}/start-compose.sh ${{ env.TAS_ENVIRONMENT }}/docker-compose-all-amps-test.yml
${{ env.TAS_SCRIPTS }}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
- name: "Run tests"
id: tests
timeout-minutes: 20
run: mvn -B install -ntp -f tests/tas-all-amps/pom.xml -Pall-tas-tests -Denvironment=default -DrunBugs=false
- name: "Print output after failure"
if: failure() && steps.tests.outcome == 'failure'
run: ${TAS_SCRIPTS}/output_logs_for_failures.sh "tests/tas-all-amps"
- name: "Dump all Docker containers logs"
uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
if: failure() && (steps.tests.outcome == 'failure' || steps.env.outcome == 'failure')
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh
tas_test_with_mtls:
name: ${{ matrix.testSuite }} TAS tests with mutal TLS
runs-on: ubuntu-latest
if: >
!contains(github.event.head_commit.message, '[skip mtls]') &&
!contains(github.event.head_commit.message, '[skip tests]')
strategy:
fail-fast: false
matrix:
include:
- testSuite: Transform Service Mutal TLS
pom-dir: tests/tas-mtls
profiles: run-mtls
compose-file: docker-compose-mtls.yml
mtls: true
disabledHostnameVerification: false
deploy-timeout: 10
- testSuite: Transform Service Mutal TLS Disabled Hostname Verification
pom-dir: tests/tas-mtls
profiles: run-mtls
compose-file: docker-compose-mtls.yml
mtls: true
disabledHostnameVerification: true
deploy-timeout: 10
steps:
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- name: "Generate Keystores and Truststores for Mutual TLS configuration"
if: ${{ matrix.mtls }}
run: |
git clone -b "master" --depth=1 "https://${{ secrets.BOT_GITHUB_USERNAME }}:${{ secrets.BOT_GITHUB_TOKEN }}@github.com/Alfresco/alfresco-ssl-generator.git"
if ${{ matrix.disabledHostnameVerification }} ; then
bash ${{ env.CI_WORKSPACE }}/alfresco-ssl-generator/scripts/ci/generate_keystores_wrong_hostnames.sh
echo "HOSTNAME_VERIFICATION_DISABLED=true" >> "$GITHUB_ENV"
else
bash ${{ env.CI_WORKSPACE }}/alfresco-ssl-generator/scripts/ci/generate_keystores.sh
echo "HOSTNAME_VERIFICATION_DISABLED=false" >> "$GITHUB_ENV"
fi
bash ${{ env.CI_WORKSPACE }}/alfresco-ssl-generator/scripts/ci/convert_testclient_keystore_to_pem.sh "${{ env.CI_WORKSPACE }}"
- name: "Build"
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: |
bash ./scripts/ci/init.sh
bash ./scripts/ci/build.sh
- name: "Set up the environment"
run: |
${{ env.TAS_SCRIPTS }}/start-compose.sh ${{ env.TAS_ENVIRONMENT }}/${{ matrix.compose-file }}
${{ env.TAS_SCRIPTS }}/wait-for-alfresco-start.sh "https://localhost:8443/alfresco"
- name: "Run tests"
id: tests
timeout-minutes: ${{ matrix.deploy-timeout }}
run: mvn -B install -ntp -f ${{ matrix.pom-dir }}/pom.xml -P${{ matrix.profiles }} -Denvironment=default -DrunBugs=false
- name: "Print output after failure"
if: ${{ always() && steps.tests.outcome == 'failure' }}
run: ${TAS_SCRIPTS}/output_logs_for_failures.sh "${{ matrix.pom-dir }}"
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh
distribution_zip_content_tests:
name: "Distribution Zip content tests (Java ${{ matrix.java-version }})"
runs-on: ubuntu-latest
if: >
!contains(github.event.head_commit.message, '[skip tests]')
strategy:
fail-fast: false
matrix:
java-version: [17, 21]
steps:
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- name: "Build"
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: |
bash ./scripts/ci/init.sh
bash ./scripts/ci/build.sh
- name: "Set up the environment"
run: mvn -B -V clean install -ntp -Pags -DskipTests -Dmaven.javadoc.skip=true
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
with:
java-version: ${{ matrix.java-version }}
- name: "Run tests"
id: tests
timeout-minutes: 20
run: mvn -B install -ntp -f tests/tas-distribution-zip/pom.xml -Prun-distribution-zip-contents-check -DrunBugs=false
- name: "Print output after failure"
if: ${{ always() && steps.tests.outcome == 'failure' }}
run: ${TAS_SCRIPTS}/output_logs_for_failures.sh "tests/tas-distribution-zip"
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh
single_pipeline_image_tests:
name: "Single Pipeline image tests (Java ${{ matrix.java-version }})"
runs-on: ubuntu-latest
if: >
github.event_name != 'pull_request' &&
!contains(github.event.head_commit.message, '[skip tests]')
strategy:
fail-fast: false
matrix:
java-version: [DEFAULT, 21]
steps:
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: "Build"
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: |
bash ./scripts/ci/init.sh
bash ./scripts/ci/build.sh
- name: "Set up the environment"
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
env:
AWS_ACCESS_KEY: ${{ secrets.AWS_S3_PIPELINE_AMPS_ACCESS_KEY_ID }}
AWS_SECRET_KEY: ${{ secrets.AWS_S3_PIPELINE_AMPS_SECRET_ACCESS_KEY }}
run: |
mvn -B clean install -ntp -Ppipeline,build-docker-images \
$(mvn -B -q help:evaluate "-Dexpression=dependency.alfresco-enterprise-repo.version" -DforceStdout | grep -q '\-SNAPSHOT$' && echo '-Drepo.image.tag=latest') $(mvn -B -q help:evaluate "-Dexpression=dependency.alfresco-enterprise-share.version" -DforceStdout | grep -q '\-SNAPSHOT$' && echo '-Dshare.image.tag=latest') \
-Dimage.java.version=${{ matrix.java-version }}
cat tests/pipeline-all-amps/repo/target/dtas/dtas-config.json
pip install requests pytest==6.2.4 pytest-testinfra==6.3.0 jmespath==0.10.0
git clone --depth 1 --branch $DTAS_VERSION https://${GIT_USERNAME}:${GIT_PASSWORD}@github.com/Alfresco/alfresco-deployment-test-automation-scripts.git dtas
docker images | grep pipeline
${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-pipeline-all-amps.yml
${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8080/alfresco/" 180
docker ps
curl -v --user [email protected]:admin http://localhost:8080/alfresco/api/discovery
- name: "Run tests"
run: |
cd dtas
pytest --configuration ../tests/pipeline-all-amps/repo/target/dtas/dtas-config.json tests/ -s
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh
test_tomcat_deployment:
name: "Test Tomcat deployment"
runs-on: ubuntu-latest
if: >
!contains(github.event.head_commit.message, '[skip tests]')
steps:
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- name: "Build"
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: |
bash ./scripts/ci/init.sh
bash ./scripts/ci/build.sh
- name: "Set up the environment"
run: |
${{ env.TAS_SCRIPTS }}/start-compose.sh ./dev/docker-compose.yml
${{ env.TAS_SCRIPTS }}/wait-for-alfresco-start.sh "http://localhost:8983/solr"
- name: "Run tomcat, verify it starts"
id: tests
run: |
(mvn -B clean install -Prun -rf dev &)
curl --retry 60 --retry-max-time 300 --retry-delay 5 --retry-all-errors --fail "http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/probes/-ready-"
echo "Test Alfresco Repository availability"
curl -Ls -o /dev/null --fail "http://localhost:8080/alfresco"
echo "Test Share availability"
curl -Ls -o /dev/null --fail "http://localhost:8080/share"
pipeline_test_docker_release:
name: "Upload docker images needed for pipeline tests: <acs.version>-<PIPELINE_TAG_TEXT_INSERT>-<build>"
runs-on: ubuntu-latest
if: >
contains(github.event.head_commit.message, '[pipeline_docker]')
services:
registry:
image: registry:2
ports:
- 5000:5000
steps:
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: linux/amd64,linux/arm64
- name: Pipeline Tag text insert (modify for your needs)
run: |
echo "PIPELINE_TAG_TEXT_INSERT=INSERT-TEXT" >> $GITHUB_ENV
- name: Compute final build number
run: |
echo "COMPUTED_BUILD_NUMBER=$(( $BASE_BUILD_NUMBER + $BUILD_NUMBER ))" >> $GITHUB_ENV
- name: Determine ACS Image Tag
run: |
ACS_VERSION=23.1.0
echo "IMAGE_TAG=${ACS_VERSION}-${PIPELINE_TAG_TEXT_INSERT}-${COMPUTED_BUILD_NUMBER}" >> $GITHUB_ENV
- name: "Build: uses IMAGE_TAG variable, requires Repo and Share snapshot versions in main pom.xml"
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: |
bash ./scripts/ci/init.sh
bash ./scripts/ci/build.sh -m
- name: "Update images"
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: mvn -B -V clean install -ntp -DskipTests -Dmaven.javadoc.skip=true -Ppush-docker-images,pipeline,release-branch -Drepo.image.tag=latest -Dshare.image.tag=latest -Dimage.tag=${IMAGE_TAG} -Ddocker.quay-expires.value=1w -Drepo.skipDockerImage=false -Dshare.skipDockerImage=false
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh