-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy path.gitlab-ci.yml
647 lines (592 loc) · 21.8 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
---
# yamllint disable rule:line-length
# ------------------------------------------------------------------
# ------------------------------------------------------------------
# Global settings
image: "adorsys/ci-build:latest"
# ------------------------------------------------------------------
# stages
# ------------------------------------------------------------------
stages:
- "Lint"
- "Compile" # build jar and provide as artifact
- "Test" # run tests and code quality checks
- "Version Control" # parse pom.xml and change versions on sandbox project
- "Release" # release
- "Package" # dockerize jar and push to docker registry
- "Clone to github"
# ------------------------------------------------------------------
# variables
# ------------------------------------------------------------------
variables:
GIT_SUBMODULE_STRATEGY: normal
# Online banking
DOCKER_IMAGE_NAME_XS2A_ONLINE_BANKING: "xs2a-online-banking"
DOCKER_IMAGE_NAME_XS2A_ONLINE_BANKING_UI: "xs2a-online-banking-ui"
DOCKER_IMAGE_NAME_XS2A_TPP_UI: "xs2a-bank-tpp-ui"
DOCKER_IMAGE_NAME_XS2A_ADMIN_UI: "xs2a-bank-admin-ui"
DOCKER_IMAGE_NAME_XS2A_DEVPORTAL_UI: "xs2a-bank-devportal"
DOCKER_IMAGE_NAME_XS2A_TPP_REST_SERVER: "xs2a-tpp-rest-server"
DOCKER_IMAGE_NAME_XS2A_ADMIN_REST_SERVER: "xs2a-admin-rest-server"
###########################
# Public Dockerhub Images #
###########################
DOCKERHUB_REGISTRY: "gitlab-registry.adorsys.de"
DOCKERHUB_NAMESPACE: "adorsys/xs2a/psd2-dynamic-sandbox"
###########################
# Build variables #
###########################
# Defaults for Java 11
JAVA_TOOL_OPTIONS: "-XX:+UnlockExperimentalVMOptions -XX:MaxRAM=3G -XX:MaxRAMFraction=3"
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
# ------------------------------------------------------------------
# reusable yaml anchors
# ------------------------------------------------------------------
.build_java: &build_java
script:
- jabba use $BUILD_JAVA_VERSION
- java -XX:+PrintFlagsFinal -version | grep -Ei "maxheapsize|maxram"
- make build-java-services
cache:
key: "Java_${CI_COMMIT_REF_SLUG}"
paths:
- /builds/adorsys/xs2a/psd2-dynamic-sandbox/.m2/repository
.release_java_private: &release_java_private
script:
- jabba use $BUILD_JAVA_VERSION
- java -XX:+PrintFlagsFinal -version | grep -Ei "maxheapsize|maxram"
- mvn -ntp --settings scripts/mvn-release-settings.xml -Pgitlab-maven -DskipTests -U deploy
cache:
key: "Java_${CI_COMMIT_REF_SLUG}"
paths:
- /builds/adorsys/xs2a/psd2-dynamic-sandbox/.m2/repository
# Build docker images and put them to DOCKER HUB repo
.build_and_push_dockerhub_images_private:
&build_and_push_dockerhub_images_private
script:
- docker build -t "${DOCKERHUB_REGISTRY}/${DOCKERHUB_NAMESPACE}/${DOCKER_IMAGE_NAME_XS2A_ONLINE_BANKING}:${DOCKER_TAG}" online-banking/online-banking-app
- docker build -t "${DOCKERHUB_REGISTRY}/${DOCKERHUB_NAMESPACE}/${DOCKER_IMAGE_NAME_XS2A_ONLINE_BANKING_UI}:${DOCKER_TAG}" oba-ui
- docker build -t "${DOCKERHUB_REGISTRY}/${DOCKERHUB_NAMESPACE}/${DOCKER_IMAGE_NAME_XS2A_TPP_REST_SERVER}:${DOCKER_TAG}" tpp-app/tpp-rest-server
- docker build -t "${DOCKERHUB_REGISTRY}/${DOCKERHUB_NAMESPACE}/${DOCKER_IMAGE_NAME_XS2A_ADMIN_REST_SERVER}:${DOCKER_TAG}" admin-app/admin-rest-server
- docker build -t "${DOCKERHUB_REGISTRY}/${DOCKERHUB_NAMESPACE}/${DOCKER_IMAGE_NAME_XS2A_TPP_UI}:${DOCKER_TAG}" tpp-ui
- docker build -t "${DOCKERHUB_REGISTRY}/${DOCKERHUB_NAMESPACE}/${DOCKER_IMAGE_NAME_XS2A_ADMIN_UI}:${DOCKER_TAG}" admin-ui
- docker build -t "${DOCKERHUB_REGISTRY}/${DOCKERHUB_NAMESPACE}/${DOCKER_IMAGE_NAME_XS2A_DEVPORTAL_UI}:${DOCKER_TAG}" developer-portal-ui
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker push "${DOCKERHUB_REGISTRY}/${DOCKERHUB_NAMESPACE}/${DOCKER_IMAGE_NAME_XS2A_ONLINE_BANKING}:${DOCKER_TAG}"
- docker push "${DOCKERHUB_REGISTRY}/${DOCKERHUB_NAMESPACE}/${DOCKER_IMAGE_NAME_XS2A_ONLINE_BANKING_UI}:${DOCKER_TAG}"
- docker push "${DOCKERHUB_REGISTRY}/${DOCKERHUB_NAMESPACE}/${DOCKER_IMAGE_NAME_XS2A_TPP_REST_SERVER}:${DOCKER_TAG}"
- docker push "${DOCKERHUB_REGISTRY}/${DOCKERHUB_NAMESPACE}/${DOCKER_IMAGE_NAME_XS2A_ADMIN_REST_SERVER}:${DOCKER_TAG}"
- docker push "${DOCKERHUB_REGISTRY}/${DOCKERHUB_NAMESPACE}/${DOCKER_IMAGE_NAME_XS2A_TPP_UI}:${DOCKER_TAG}"
- docker push "${DOCKERHUB_REGISTRY}/${DOCKERHUB_NAMESPACE}/${DOCKER_IMAGE_NAME_XS2A_ADMIN_UI}:${DOCKER_TAG}"
- docker push "${DOCKERHUB_REGISTRY}/${DOCKERHUB_NAMESPACE}/${DOCKER_IMAGE_NAME_XS2A_DEVPORTAL_UI}:${DOCKER_TAG}"
- docker logout
.sync_changes_github: &sync_changes_github
# image: alpine/git
dependencies: []
script:
- git config --global user.name "$GITHUB_USERNAME"
- git remote add github https://$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git #Token expires on Sat, 11.05.2024
- for branch in $(git branch -r | grep -E "origin/.*(release-${GITHUB_PROJECT_CLONE_VERSION}.*|support-${GITHUB_PROJECT_CLONE_VERSION}.x).*"); do
branch=${branch#origin/};
git checkout $branch;
git push github $branch --force;
done
# ------------------------------------------------------------------
# jobs
# ------------------------------------------------------------------
#-------------------------------------------------------------------
# Lint
#-------------------------------------------------------------------
Lint (Dockerfiles):
image: docker
stage: "Lint"
services:
- docker:dind
tags:
- aws
except:
- schedules
- support-6.x
- master-6.x
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
DOCKER_DRIVER: overlay2
script:
- apk add make
- echo "Run Dockerfiles lint"
- make lint-dockerfiles
Lint (OBA UI):
image: node:16.13.2-buster-slim
stage: "Lint"
except:
- schedules
- support-6.x
- master-6.x
script:
- apt-get update && apt-get install jsonlint yamllint libxml2-utils make curl -yq && ln -s /usr/bin/jsonlint-php /usr/bin/jsonlint
- echo "Run OBA lint"
- make lint-oba-ui
Lint (TPP UI):
image: node:16.13.2-buster-slim
stage: "Lint"
except:
- schedules
- support-6.x
- master-6.x
script:
- apt-get update && apt-get install jsonlint yamllint libxml2-utils make curl -yq && ln -s /usr/bin/jsonlint-php /usr/bin/jsonlint
- echo "Run TPP lint"
- make lint-tpp-ui
Lint (Admin UI):
image: node:16.13.2-buster-slim
stage: "Lint"
except:
- schedules
- support-6.x
- master-6.x
script:
- apt-get update && apt-get install jsonlint yamllint libxml2-utils make curl -yq && ln -s /usr/bin/jsonlint-php /usr/bin/jsonlint
- echo "Run Admin lint"
- make lint-admin-ui
Lint (DevPortal UI):
image: node:16.13.2-buster-slim
stage: "Lint"
except:
- schedules
- support-6.x
- master-6.x
script:
- apt-get update && apt-get install jsonlint yamllint libxml2-utils make curl -yq && ln -s /usr/bin/jsonlint-php /usr/bin/jsonlint
- echo "Run Devportal UI lint"
- make lint-developer-portal-ui
Lint (OBA Backend):
image: debian:stable-slim
stage: "Lint"
except:
- schedules
- support-6.x
- master-6.x
script:
- apt-get update && apt-get install --no-install-recommends jsonlint yamllint libxml2-utils make curl -yq && ln -s /usr/bin/jsonlint-php /usr/bin/jsonlint
- echo "Run OBA backend lint"
- make lint-online-banking
Lint (TPP Backend):
image: debian:stable-slim
stage: "Lint"
except:
- schedules
- support-6.x
- master-6.x
script:
- apt-get update && apt-get install jsonlint yamllint libxml2-utils make curl -yq && ln -s /usr/bin/jsonlint-php /usr/bin/jsonlint
- echo "Run TPP backend lint"
- make lint-tpp-rest-server
Lint (Admin Backend):
image: debian:stable-slim
stage: "Lint"
except:
- schedules
- support-6.x
- master-6.x
script:
- apt-get update && apt-get install jsonlint yamllint libxml2-utils make curl -yq && ln -s /usr/bin/jsonlint-php /usr/bin/jsonlint
- echo "Run Admin backend lint"
- make lint-admin-rest-server
Lint (Docker Compose):
image: maven:3.6-jdk-11-slim
stage: "Lint"
except:
- schedules
- support-6.x
- master-6.x
script:
- apt update && apt install yamllint docker-compose make -yq
- echo "Run Docker compose lint"
- make lint-docker-compose
Lint (PMD CPD):
image: maven:3.6-jdk-11-slim
stage: "Lint"
except:
- schedules
- support-6.x
- master-6.x
script:
- apt update && apt install make -yq
- echo "Test java code for PMD and CPD"
- make lint-pmd-cpd-report
cache: {}
artifacts:
paths:
- "qa/pmd/pmd-ruleset.xml"
- "**/**/*/pmd.html"
- "**/*/pmd.xml"
name: "${CI_PROJECT_NAME}-${CI_BUILD_REF_NAME#*v}-pmd"
expire_in: "10 day"
#-------------------------------------------------------------------
# Compile
#-------------------------------------------------------------------
Build (OBA UI):
image: node:16.13.2-buster-slim
stage: "Compile"
except:
- schedules
script:
- apt-get update && apt-get install make libxml2-utils jq -yq
- echo "Update info.json"
- VERSION=$(xmllint --xpath "//*[local-name()='project']/*[local-name()='version']/text()" pom.xml)
- jq --arg VERSION "$VERSION" --arg BUILD_ID "$CI_PIPELINE_ID" '.version = $VERSION | .build_number = $BUILD_ID' oba-ui/info.json >> info.json
- mv info.json oba-ui/info.json
- echo "Run OBA UI Build"
- make npm-install-oba-ui
cache: {}
artifacts:
paths:
- "oba-ui/dist"
- "oba-ui/info.json"
name: "$CI_PROJECT_NAME-${CI_BUILD_REF_NAME#*v}"
expire_in: "1 day"
Build (TPP UI):
image: node:16.13.2-buster-slim
stage: "Compile"
except:
- schedules
script:
- apt-get update && apt-get install make jq libxml2-utils -yq
- echo "Update info.json"
- VERSION=$(xmllint --xpath "//*[local-name()='project']/*[local-name()='version']/text()" pom.xml)
- jq --arg VERSION "$VERSION" --arg BUILD_ID "$CI_PIPELINE_ID" '.version = $VERSION | .build_number = $BUILD_ID' tpp-ui/info.json >> info.json
- mv info.json oba-ui/info.json
- echo "Run TPP UI Build"
- make npm-install-tpp-ui
cache: {}
artifacts:
paths:
- "tpp-ui/dist"
- "tpp-ui/info.json"
name: "$CI_PROJECT_NAME-${CI_BUILD_REF_NAME#*v}"
expire_in: "1 day"
Build (Admin UI):
image: node:16.13.2-buster-slim
stage: "Compile"
except:
- schedules
script:
- apt-get update && apt-get install make jq libxml2-utils -yq
- echo "Update info.json"
- VERSION=$(xmllint --xpath "//*[local-name()='project']/*[local-name()='version']/text()" pom.xml)
- jq --arg VERSION "$VERSION" --arg BUILD_ID "$CI_PIPELINE_ID" '.version = $VERSION | .build_number = $BUILD_ID' admin-ui/info.json >> info.json
- mv info.json oba-ui/info.json
- echo "Run Admin UI Build"
- make npm-install-admin-ui
cache: {}
artifacts:
paths:
- "admin-ui/dist"
- "admin-ui/info.json"
name: "$CI_PROJECT_NAME-${CI_BUILD_REF_NAME#*v}"
expire_in: "1 day"
Build (DevPortal UI):
image: node:16.13.2-buster-slim
stage: "Compile"
except:
- schedules
script:
- apt-get update && apt-get install zip make jq libxml2-utils -yq
- echo "Update info.json"
- VERSION=$(xmllint --xpath "//*[local-name()='project']/*[local-name()='version']/text()" pom.xml)
- jq --arg VERSION "$VERSION" --arg BUILD_ID "$CI_PIPELINE_ID" '.version = $VERSION | .build_number = $BUILD_ID' developer-portal-ui/info.json >> info.json
- mv info.json developer-portal-ui/info.json
- echo "Update postman test files"
- scripts/.update-postman-test-files.sh
- echo "Run Devportal UI Build"
- make npm-install-developer-portal-ui
cache: {}
artifacts:
paths:
- "developer-portal-ui/dist"
- "developer-portal-ui/info.json"
name: "$CI_PROJECT_NAME-${CI_BUILD_REF_NAME#*v}"
expire_in: "1 day"
Build (Modelbank):
<<: *build_java
stage: "Compile"
except:
- schedules
cache: {}
variables:
BUILD_JAVA_VERSION: system@1.11
JAVA_TOOL_OPTIONS: "-Djavax.net.ssl.trustStorePassword=changeit -XX:MaxRAM=3G"
artifacts:
paths:
- "online-banking/online-banking-app/target/online-banking-app.jar"
- "certificate-generator/target/certificate-generator.jar"
- "tpp-app/tpp-rest-server/target/tpp-rest-server.jar"
- "admin-app/admin-rest-server/target/admin-rest-server.jar"
name: "$CI_PROJECT_NAME-${CI_BUILD_REF_NAME#*v}"
expire_in: "1 day"
#-------------------------------------------------------------------
# Test
#-------------------------------------------------------------------
Test (Javadoc):
stage: "Test"
except:
- schedules
needs: ["Build (Modelbank)"]
variables:
JAVA_TOOL_OPTIONS: "-Djavax.net.ssl.trustStorePassword=changeit -XX:MaxRAM=3G"
JAVA_VERSION: "system@1.11"
script:
- jabba use ${JAVA_VERSION}
- java -XX:+PrintFlagsFinal -version | grep -Ei "maxheapsize|maxram"
- mvn -ntp --settings scripts/mvn-release-settings.xml -Dmaven.test.skip=true -Pjavadoc verify javadoc:javadoc
Test (Unit Tests):
image: maven:3.6-jdk-11-slim
stage: "Test"
except:
- schedules
needs: ["Build (Modelbank)"]
variables:
JAVA_VERSION: "system@1.11"
JAVA_TOOL_OPTIONS: "-Djavax.net.ssl.trustStorePassword=changeit -XX:MaxRAM=3G"
script:
- apt update && apt install make -yq
- echo "Run unit tests for backend"
- make unit-tests-backend
Test (DevPortal UI Tests):
image: node:16.13.2-buster-slim
stage: "Test"
except:
- schedules
needs: ["Build (DevPortal UI)"]
variables:
CHROME_BIN: "/usr/bin/chromium"
script:
- apt-get update && apt-get install make chromium chromium-l10n -yq
- echo 'Unit tests Devportal UI'
- make unit-tests-developer-portal-ui
Test (TPP UI Tests):
image: node:16.13.2-buster-slim
stage: "Test"
except:
- schedules
needs: ["Build (TPP UI)"]
variables:
CHROME_BIN: "/usr/bin/chromium"
script:
- apt-get update && apt-get install make chromium chromium-l10n -yq
- echo 'Unit tests TPP UI'
- make unit-tests-tpp-ui
Test (Admin UI Tests):
image: node:16.13.2-buster-slim
stage: "Test"
except:
- schedules
needs: ["Build (Admin UI)"]
variables:
CHROME_BIN: "/usr/bin/chromium"
script:
- apt-get update && apt-get install make chromium chromium-l10n -yq
- echo 'Unit tests Admin UI'
- make unit-tests-admin-ui
Test (OBA UI Tests):
image: node:16.13.2-buster-slim
stage: "Test"
except:
- schedules
needs: ["Build (OBA UI)"]
variables:
CHROME_BIN: "/usr/bin/chromium"
script:
- apt-get update && apt-get install make chromium chromium-l10n -yq
- echo 'Unit tests OBA UI'
- make unit-tests-oba-ui
Postman Tests:
stage: "Test"
only:
- schedules
image:
name: postman/newman_alpine33
entrypoint: [""]
script:
- npm config set unsafe-perm true
- npm install -g newman-reporter-html
- cd postman
- newman run postman_collection.json -e postman_environment_dev.json -g postman_global_variable.json --reporters cli,html --reporter-html-template html_report_template.hbs --reporter-html-export postman-tests-report.html --suppress-exit-code
artifacts:
when: always
paths:
- "postman/postman-tests-report.html"
expire_in: "10 day"
#-------------------------------------------------------------------
# Package
#-------------------------------------------------------------------
Build and push to private repo (support-6x):
stage: "Package"
except:
- schedules
only:
- support-6.x
services:
- docker:dind
tags:
- aws
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
DOCKER_DRIVER: overlay2
DOCKER_TAG: support6x
DOCKERHUB_REGISTRY: gitlab-registry.adorsys.de
DOCKERHUB_NAMESPACE: "adorsys/xs2a/psd2-dynamic-sandbox"
<<: *build_and_push_dockerhub_images_private
Build and push to private repo (tags):
stage: "Package"
only:
- tags
services:
- docker:dind
tags:
- aws
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
DOCKER_DRIVER: overlay2
DOCKER_TAG: ${CI_COMMIT_TAG}
DOCKERHUB_REGISTRY: gitlab-registry.adorsys.de
DOCKERHUB_NAMESPACE: "adorsys/xs2a/psd2-dynamic-sandbox"
<<: *build_and_push_dockerhub_images_private
#-------------------------------------------------------------------
# Release
#-------------------------------------------------------------------
Release snapshot artifacts (support-6x):
stage: "Release"
only:
- support-6.x
except:
- schedules
cache: {}
variables:
BUILD_JAVA_VERSION: system@1.11
JAVA_TOOL_OPTIONS: "-Djavax.net.ssl.trustStorePassword=changeit -XX:MaxRAM=3G"
<<: *release_java_private
Release snapshot artifacts (tags):
stage: "Release"
only:
- tags
except:
- schedules
cache: {}
variables:
BUILD_JAVA_VERSION: system@1.11
JAVA_TOOL_OPTIONS: "-Djavax.net.ssl.trustStorePassword=changeit -XX:MaxRAM=3G"
<<: *release_java_private
#-------------------------------------------------------------------
# Version Control
#-------------------------------------------------------------------
Change dependencies versions (support-6.x):
stage: "Version Control"
image: alpine
only:
refs:
- support-6.x
changes:
- pom.xml
except:
- schedules
before_script:
- apk add git openssh-client
- git config --global user.name $GITLAB_USER_NAME
- git config --global user.email $GITLAB_USER_EMAIL
- mkdir -p ~/sandbox
- cd ~/sandbox
- git clone https://push-token:$PUSH_TOKEN@git.adorsys.de/adorsys/xs2a/sandbox-openshift.git
- cd sandbox-openshift
- git branch -a
- git checkout master
script:
- XS2A_VERSION=$(cat $CI_PROJECT_DIR/pom.xml | grep "<xs2a.version>" | awk -F"[<>]" '//{print $3}')
- CONNECTOR_VERSION=$(cat $CI_PROJECT_DIR/pom.xml | grep "<connector.version>" | awk -F"[<>]" '//{print $3}')
- LEDGERS_VERSION=$(cat $CI_PROJECT_DIR/pom.xml | grep "<ledgers.version>" | awk -F"[<>]" '//{print $3}')
- >
if [[ "$XS2A_VERSION" =~ "\d{1,2}\.\d{1,2}-SNAPSHOT" ]]; then
XS2A_VERSION=support14x;
fi
- >
if [[ "$CONNECTOR_VERSION" =~ "\d{1,2}\.\d{1,2}-SNAPSHOT" ]]; then
CONNECTOR_VERSION=support14x;
fi
- >
if [[ "$LEDGERS_VERSION" =~ "\d{1,2}\.\d{1,2}-SNAPSHOT" ]]; then
LEDGERS_VERSION=develop;
fi
- |
sed -i "s/tag: .*$/tag: \"$XS2A_VERSION\"/" env/adorsys-modelbank-support6x-k8s/certificate-generator/env.yaml
sed -i "s/tag: .*$/tag: \"$LEDGERS_VERSION\"/" env/adorsys-modelbank-support6x-k8s/keycloak/env.yaml
sed -i "s/tag: .*$/tag: \"$LEDGERS_VERSION\"/" env/adorsys-modelbank-support6x-k8s/ledgers/env.yaml
sed -i "s/tag: .*$/tag: \"$XS2A_VERSION\"/" env/adorsys-modelbank-support6x-k8s/xs2a-aspsp-profile/env.yaml
sed -i "s/tag: .*$/tag: \"$CONNECTOR_VERSION\"/" env/adorsys-modelbank-support6x-k8s/xs2a-connector/env.yaml
sed -i "s/tag: .*$/tag: \"$XS2A_VERSION\"/" env/adorsys-modelbank-support6x-k8s/xs2a-consent-management/env.yaml
sed -i "s/tag: .*$/tag: \"$XS2A_VERSION\"/" env/adorsys-modelbank-support6x-k8s/xs2a-embedded/env.yaml
after_script:
- cd ~/sandbox/sandbox-openshift
- git status
- git add .
- git commit -m "changed dependencies versions"
- git push origin master
Change dependencies versions (demo):
stage: "Version Control"
image: alpine
rules:
- if: $CI_COMMIT_TAG =~ /6\..*/
# changes:
# - "pom.xml"
- if: $CI_PIPELINE_SOURCE == "schedule"
when: never
before_script:
- apk add git openssh-client
- git config --global user.name $GITLAB_USER_NAME
- git config --global user.email $GITLAB_USER_EMAIL
- mkdir -p ~/sandbox
- cd ~/sandbox
- git clone https://push-token:$PUSH_TOKEN@git.adorsys.de/adorsys/xs2a/sandbox-openshift.git
- cd sandbox-openshift
- git branch -a
- git checkout master
script:
- XS2A_VERSION=$(cat $CI_PROJECT_DIR/pom.xml | grep "<xs2a.version>" | awk -F"[<>]" '//{print $3}')
- CONNECTOR_VERSION=$(cat $CI_PROJECT_DIR/pom.xml | grep "<connector.version>" | awk -F"[<>]" '//{print $3}')
- LEDGERS_VERSION=$(cat $CI_PROJECT_DIR/pom.xml | grep "<ledgers.version>" | awk -F"[<>]" '//{print $3}')
- |
sed -i "s/tag: .*$/tag: \"$XS2A_VERSION\"/" env/adorsys-modelbank-demo-k8s/certificate-generator/env.yaml
sed -i "s/tag: .*$/tag: \"$LEDGERS_VERSION\"/" env/adorsys-modelbank-demo-k8s/keycloak/env.yaml
sed -i "s/tag: .*$/tag: \"$LEDGERS_VERSION\"/" env/adorsys-modelbank-demo-k8s/ledgers/env.yaml
sed -i "s/tag: .*$/tag: \"$XS2A_VERSION\"/" env/adorsys-modelbank-demo-k8s/xs2a-aspsp-profile/env.yaml
sed -i "s/tag: .*$/tag: \"$CONNECTOR_VERSION\"/" env/adorsys-modelbank-demo-k8s/xs2a-connector/env.yaml
sed -i "s/tag: .*$/tag: \"$XS2A_VERSION\"/" env/adorsys-modelbank-demo-k8s/xs2a-consent-management/env.yaml
sed -i "s/tag: .*$/tag: \"$CI_COMMIT_TAG\"/" env/adorsys-modelbank-demo-k8s/modelbank-admin/env.yaml
sed -i "s/tag: .*$/tag: \"$CI_COMMIT_TAG\"/" env/adorsys-modelbank-demo-k8s/modelbank-devportal/env.yaml
sed -i "s/tag: .*$/tag: \"$CI_COMMIT_TAG\"/" env/adorsys-modelbank-demo-k8s/modelbank-oba/env.yaml
sed -i "s/tag: .*$/tag: \"$CI_COMMIT_TAG\"/" env/adorsys-modelbank-demo-k8s/modelbank-tpp/env.yaml
after_script:
- cd ~/sandbox/sandbox-openshift
- git status
- git add .
- git commit -m "changed dependencies versions"
- git push origin master
Clone to github:
stage: "Clone to github"
<<: *sync_changes_github
# image: alpine/git:latest
image:
name: alpine/git:latest
entrypoint: [ "" ]
only:
- /^.*release-${GITHUB_PROJECT_CLONE_VERSION}.*$/
- support-${GITHUB_PROJECT_CLONE_VERSION}.x
- support-6.x
except:
- schedules
variables:
GITHUB_USERNAME: adorsys
GITHUB_REPOSITORY: adorsys/XS2A-Sandbox
GITHUB_PROJECT_CLONE_VERSION: "6"