-
Notifications
You must be signed in to change notification settings - Fork 0
650 lines (557 loc) · 20.3 KB
/
main.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
name: Build Spring boot microservice project
run-name: ${{ github.actor }} is running
on:
schedule:
- cron: '0 0 * * *'
jobs:
build-jar:
runs-on: ubuntu-latest
steps:
- name: checkout codebase
uses: actions/checkout@v4
- name: Set up JDK 21 for x64
uses: actions/[email protected]
with:
java-version: '21'
architecture: x64
distribution: 'oracle'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v3
- name: Setup gradle
uses: gradle/actions/setup-gradle@v3
- name: Run the Gradle package task
run: ./gradlew build
- name: Upload private_table_per_service@customer_service
uses: actions/upload-artifact@v4
with:
name: private_table_per_service@customer_service
path: |
./database_per_services/private_table_per_service/customer_service/build/libs/*.jar
./database_per_services/private_table_per_service/customer_service/*.env
./database_per_services/private_table_per_service/customer_service/*.sh
./database_per_services/private_table_per_service/customer_service/Dockerfile
- name: Upload private_table_per_service@order_service
uses: actions/upload-artifact@v4
with:
name: private_table_per_service@order_service
path: |
./database_per_services/private_table_per_service/order_service/build/libs/*.jar
./database_per_services/private_table_per_service/order_service/*.env
./database_per_services/private_table_per_service/order_service/*.sh
./database_per_services/private_table_per_service/order_service/Dockerfile
- name: Upload private_table_per_service@db
uses: actions/upload-artifact@v4
with:
name: private_table_per_service@db
path: |
./database_per_services/private_table_per_service/db/*.env
./database_per_services/private_table_per_service/db/*.sh
./database_per_services/private_table_per_service/db/Dockerfile
- name: Upload shared_databases@customer_service
uses: actions/upload-artifact@v4
with:
name: shared_databases@customer_service
path: |
./shared_database/customer_service/build/libs/*.jar
./shared_database/customer_service/*.env
./shared_database/customer_service/*.sh
./shared_database/customer_service/Dockerfile
- name: Upload shared_databases@order_service
uses: actions/upload-artifact@v4
with:
name: shared_databases@order_service
path: |
./shared_database/order_service/build/libs/*.jar
./shared_database/order_service/*.env
./shared_database/order_service/*.sh
./shared_database/order_service/Dockerfile
- name: Upload shared_databases@db
uses: actions/upload-artifact@v4
with:
name: shared_databases@db
path: |
./shared_database/db/*.env
./shared_database/db/*.sh
./shared_database/db/Dockerfile
- name: Upload rest@sender
uses: actions/upload-artifact@v4
with:
name: rest@sender
path: |
./messaging/rest/sender/build/libs/*.jar
./messaging/rest/sender/*.env
./messaging/rest/sender/*.sh
./messaging/rest/sender/Dockerfile
- name: Upload rest@receiver
uses: actions/upload-artifact@v4
with:
name: rest@receiver
path: |
./messaging/rest/receiver/build/libs/*.jar
./messaging/rest/receiver/*.env
./messaging/rest/receiver/*.sh
./messaging/rest/receiver/Dockerfile
- name: Upload event_sourcing@consumer
uses: actions/upload-artifact@v4
with:
name: event_sourcing@consumer
path: |
./messaging/event_sourcing/consumer/build/libs/*.jar
./messaging/event_sourcing/consumer/*.env
./messaging/event_sourcing/consumer/*.sh
./messaging/event_sourcing/consumer/Dockerfile
- name: Upload event_sourcing@producer
uses: actions/upload-artifact@v4
with:
name: event_sourcing@producer
path: |
./messaging/event_sourcing/producer/build/libs/*.jar
./messaging/event_sourcing/producer/*.env
./messaging/event_sourcing/producer/*.sh
./messaging/event_sourcing/producer/Dockerfile
- name: Upload graphql@gateway
uses: actions/upload-artifact@v4
with:
name: graphql@gateway
path: |
./messaging/graphql/gateway/build/libs/*.jar
./messaging/graphql/gateway/*.env
./messaging/graphql/gateway/*.sh
./messaging/graphql/gateway/Dockerfile
- name: Upload circuit_breaker@proxy
uses: actions/upload-artifact@v4
with:
name: circuit_breaker@proxy
path: |
./circuit_breaker/proxy/build/libs/*.jar
./circuit_breaker/proxy/*.env
./circuit_breaker/proxy/*.sh
./circuit_breaker/proxy/Dockerfile
- name: Upload circuit_breaker@real_service
uses: actions/upload-artifact@v4
with:
name: circuit_breaker@real_service
path: |
./circuit_breaker/real_service/build/libs/*.jar
./circuit_breaker/real_service/*.env
./circuit_breaker/real_service/*.sh
./circuit_breaker/real_service/Dockerfile
- name: Upload service_registry@self_registration
uses: actions/upload-artifact@v4
with:
name: service_registry@self_registration
path: |
./self_registration/services_registry/*.env
./self_registration/services_registry/*.sh
./self_registration/services_registry/Dockerfile
./self_registration/services_registry/build/libs/*.jar
- name: Upload serviceA@self_registration
uses: actions/upload-artifact@v4
with:
name: serviceA@self_registration
path: |
./self_registration/serviceA/*.env
./self_registration/serviceA/*.sh
./self_registration/serviceA/Dockerfile
./self_registration/serviceA/build/libs/*.jar
- name: Upload serviceA@client_side_discovery
uses: actions/upload-artifact@v4
with:
name: serviceA@client_side_discovery
path: |
./client_side_discovery/serviceA/*.env
./client_side_discovery/serviceA/*.sh
./client_side_discovery/serviceA/Dockerfile
./client_side_discovery/serviceA/build/libs/*.jar
- name: Upload service_registry@client_side_discovery
uses: actions/upload-artifact@v4
with:
name: service_registry@client_side_discovery
path: |
./client_side_discovery/services_registry/*.env
./client_side_discovery/services_registry/*.sh
./client_side_discovery/services_registry/Dockerfile
./client_side_discovery/services_registry/build/libs/*.jar
- name: Upload client@client_side_discovery
uses: actions/upload-artifact@v4
with:
name: client@client_side_discovery
path: |
./client_side_discovery/client/*.env
./client_side_discovery/client/*.sh
./client_side_discovery/client/Dockerfile
./client_side_discovery/client/build/libs/*.jar
push-image-private_table_per_service-customer_service:
needs: build-jar
runs-on: ubuntu-latest
steps:
- name: Download private_table_per_service@customer_service
uses: actions/download-artifact@v4
with:
name: private_table_per_service@customer_service
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_SECRET }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: push image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/microservices-lab:private-table-per-service.customer-service
push-image-private_table_per_service-order-service:
needs: build-jar
runs-on: ubuntu-latest
steps:
- name: Download private_table_per_service@order-service
uses: actions/download-artifact@v4
with:
name: private_table_per_service@order_service
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_SECRET }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: push image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/microservices-lab:private-table-per-service.order-service
push-image-shared_databases-customer_service:
needs: build-jar
runs-on: ubuntu-latest
steps:
- name: Download shared_database@customer_service
uses: actions/download-artifact@v4
with:
name: shared_databases@customer_service
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_SECRET }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: push image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/microservices-lab:shared-database.customer-service
push-image-shared_databases-order_service:
needs: build-jar
runs-on: ubuntu-latest
steps:
- name: Download shared_database@order_service
uses: actions/download-artifact@v4
with:
name: shared_databases@order_service
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_SECRET }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: push image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/microservices-lab:shared-database.order-service
push-image-shared_databases-database:
needs: build-jar
runs-on: ubuntu-latest
steps:
- name: Download shared_database@db
uses: actions/download-artifact@v4
with:
name: shared_databases@db
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_SECRET }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: push image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/microservices-lab:shared_database
push-image-rest-sender:
needs: build-jar
runs-on: ubuntu-latest
steps:
- name: Download rest@sender
uses: actions/download-artifact@v4
with:
name: rest@sender
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_SECRET }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: push image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/microservices-lab:messaging.rest.sender
push-image-rest-receiver:
needs: build-jar
runs-on: ubuntu-latest
steps:
- name: Download rest@receiver
uses: actions/download-artifact@v4
with:
name: rest@receiver
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_SECRET }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: push image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/microservices-lab:messaging.rest.receiver
push-image-event_sourcing-consumer:
needs: build-jar
runs-on: ubuntu-latest
steps:
- name: Download event_sourcing@consumer
uses: actions/download-artifact@v4
with:
name: event_sourcing@consumer
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_SECRET }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: push image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/microservices-lab:messaging.consumer
push-image-event_sourcing-producer:
needs: build-jar
runs-on: ubuntu-latest
steps:
- name: Download event_sourcing@producer
uses: actions/download-artifact@v4
with:
name: event_sourcing@producer
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_SECRET }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: push image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/microservices-lab:messaging.event_sourcing.producer
push-image-graphql-gateway:
needs: build-jar
runs-on: ubuntu-latest
steps:
- name: Download graphql@gateway
uses: actions/download-artifact@v4
with:
name: graphql@gateway
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_SECRET }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: push image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/microservices-lab:messaging.graphql.gateway
push-image-circuit_breaker-proxy:
needs: build-jar
runs-on: ubuntu-latest
steps:
- name: Download circuit_breaker@proxy
uses: actions/download-artifact@v4
with:
name: circuit_breaker@proxy
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_SECRET }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: push image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/microservices-lab:circuit-breaker.proxy
push-image-circuit_breaker-real_service:
needs: build-jar
runs-on: ubuntu-latest
steps:
- name: Download circuit_breaker@real_service
uses: actions/download-artifact@v4
with:
name: circuit_breaker@real_service
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_SECRET }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: push image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/microservices-lab:circuit-breaker.real-service
push-image-service-discovery-self-registration:
needs: build-jar
runs-on: ubuntu-latest
steps:
- name: Download service_registry@self_registration
uses: actions/download-artifact@v4
with:
name: service_registry@self_registration
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_SECRET }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: push image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/microservices-lab:self-registration.services-registry
push-image-service-A-self-registration:
needs: build-jar
runs-on: ubuntu-latest
steps:
- name: Download serviceA@self_registration
uses: actions/download-artifact@v4
with:
name: serviceA@self_registration
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_SECRET }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: push image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/microservices-lab:self-registration.services-a
push-image-service-A-client-side-discovery:
needs: build-jar
runs-on: ubuntu-latest
steps:
- name: Download serviceA@client_side_discovery
uses: actions/download-artifact@v4
with:
name: serviceA@client_side_discovery
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_SECRET }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: push image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/microservices-lab:client-side-discovery.serviceA
push-image-client-client-side-discovery:
needs: build-jar
runs-on: ubuntu-latest
steps:
- name: Download client@client_side_discovery
uses: actions/download-artifact@v4
with:
name: client@client_side_discovery
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_SECRET }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: push image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/microservices-lab:client-side-discovery.client
push-image-service-discovery-client-side-discovery:
needs: build-jar
runs-on: ubuntu-latest
steps:
- name: Download service_registry@client_side_discovery
uses: actions/download-artifact@v4
with:
name: service_registry@client_side_discovery
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_SECRET }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: push image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/microservices-lab:client-side-discovery.services-registry