Skip to content

Commit 9d846b3

Browse files
[SELC-6600] feat: delegation-cdc setup (#70)
1 parent 2e746f4 commit 9d846b3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1567
-31
lines changed

.github/workflows/call_code_review.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,13 @@ on:
2020
jobs:
2121
code_review:
2222
name: 'Build & Analysis'
23-
runs-on: ubuntu-20.04
23+
runs-on: ubuntu-24.04
2424

2525
steps:
26+
- name: Set missing library
27+
run: |
28+
wget http://nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb
29+
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb
2630
2731
- name: Setup Maven Action
2832
uses: s4u/setup-maven-action@fa2c7e4517ed008b1f73e7e0195a9eecf5582cd4

.github/workflows/create_release_branch.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
jobs:
1717
create_branch:
1818
name: 'Create Release Branch'
19-
runs-on: ubuntu-20.04
19+
runs-on: ubuntu-24.04
2020
permissions:
2121
contents: write
2222
actions: write
@@ -46,4 +46,8 @@ jobs:
4646
run: |
4747
gh workflow run release_scheduler.yml \
4848
--ref ${{ steps.create_branch.outputs.new_branch_name }}
49-
49+
50+
- name: Trigger release Delegation-cdc UAT Release
51+
run: |
52+
gh workflow run release_delegation_cdc.yml \
53+
--ref ${{ steps.create_branch.outputs.new_branch_name }}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Code Review delegation-cdc
2+
3+
on:
4+
workflow_dispatch:
5+
6+
pull_request:
7+
branches:
8+
- main
9+
- releases/**
10+
types:
11+
- opened
12+
- edited
13+
- synchronize
14+
- reopened
15+
- ready_for_review
16+
paths:
17+
- 'apps/delegation-cdc/**'
18+
- '.github/workflows/pr_delegation_cdc.yml'
19+
- '.github/workflows/call_code_review.yml'
20+
21+
jobs:
22+
code_review:
23+
uses: ./.github/workflows/call_code_review.yml
24+
name: delegation-cdc Code Review
25+
secrets: inherit
26+
with:
27+
pr_number: ${{ github.event.pull_request.number }}
28+
source_branch: ${{ github.head_ref }}
29+
target_branch: ${{ github.base_ref }}
30+
sonar_key: 'pagopa_selfcare-institution'
31+
module: 'delegation-cdc'

.github/workflows/pr_labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ permissions:
1818
jobs:
1919
labeler:
2020
name: PR Labeler
21-
runs-on: ubuntu-20.04
21+
runs-on: ubuntu-24.04
2222

2323
steps:
2424
- uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5

.github/workflows/pr_validation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
validate_pr_size:
1717
name: Ensure PR is small
18-
runs-on: ubuntu-20.04
18+
runs-on: ubuntu-24.04
1919
steps:
2020
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # 4.1.1
2121
name: Checkout
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Deploy SELC - delegation-cdc
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- releases/*
8+
paths:
9+
- "apps/delegation-cdc/**"
10+
- "infra/container_apps/delegation-cdc/**"
11+
- "apps/pom.xml"
12+
- "pom.xml"
13+
14+
workflow_dispatch:
15+
inputs:
16+
env:
17+
type: choice
18+
description: Environment
19+
options:
20+
- dev
21+
- uat
22+
- prod
23+
24+
jobs:
25+
26+
release_dev:
27+
uses: pagopa/selfcare-commons/.github/workflows/call_release_docker.yml@main
28+
name: '[Dev] Delegation cdc Release'
29+
if: ${{ (startsWith(github.ref_name, 'releases/') != true && inputs.env == null) || inputs.env == 'dev' }}
30+
secrets: inherit
31+
with:
32+
environment: dev
33+
tf_environment: dev
34+
dir: 'infra/container_apps/delegation-cdc'
35+
dockerfile_path: ./apps/delegation-cdc/Dockerfile
36+
docker_image_name: pagopa/selfcare-delegation-cdc
37+
upload_openapi_enabled: false
38+
39+
release_uat:
40+
uses: pagopa/selfcare-commons/.github/workflows/call_release_docker.yml@main
41+
name: '[UAT] Delegation cdc Release'
42+
if: ${{ (startsWith(github.ref_name, 'releases/') == true && inputs.env == null) || inputs.env == 'uat' }}
43+
secrets: inherit
44+
with:
45+
environment: uat
46+
tf_environment: uat
47+
dir: 'infra/container_apps/delegation-cdc'
48+
dockerfile_path: ./apps/delegation-cdc/Dockerfile
49+
docker_image_name: pagopa/selfcare-delegation-cdc
50+
upload_openapi_enabled: false
51+
52+
release_prod:
53+
uses: pagopa/selfcare-commons/.github/workflows/call_release_docker.yml@main
54+
name: '[Prod] Delegation cdc Release'
55+
if: ${{ inputs.env == 'prod' }}
56+
secrets: inherit
57+
with:
58+
environment: prod
59+
tf_environment: prod
60+
dir: 'infra/container_apps/delegation-cdc'
61+
dockerfile_path: ./apps/delegation-cdc/Dockerfile
62+
docker_image_name: pagopa/selfcare-delegation-cdc
63+
upload_openapi_enabled: false

.github/workflows/release_institution_ms.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838

3939
release_uat:
4040
uses: pagopa/selfcare-commons/.github/workflows/call_release_docker.yml@main
41-
name: '[UAT] Core ms Release'
41+
name: '[UAT] Institution Ms Release'
4242
if: ${{ (startsWith(github.ref_name, 'releases/') == true && inputs.env == null) || inputs.env == 'uat' }}
4343
secrets: inherit
4444
with:
@@ -51,7 +51,7 @@ jobs:
5151

5252
release_prod:
5353
uses: pagopa/selfcare-commons/.github/workflows/call_release_docker.yml@main
54-
name: '[Prod] Core ms Release'
54+
name: '[Prod] Institution Ms Release'
5555
if: ${{ inputs.env == 'prod' }}
5656
secrets: inherit
5757
with:
@@ -64,7 +64,7 @@ jobs:
6464

6565
promote_release:
6666
name: 'Promote prerelase release'
67-
runs-on: ubuntu-20.04
67+
runs-on: ubuntu-24.04
6868
needs: [release_prod]
6969
steps:
7070
- uses: pagopa/selfcare-commons/github-actions-template/promote-release@main

.github/workflows/release_open_api.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ permissions:
1414

1515
jobs:
1616
swagger_conflict_update:
17-
runs-on: ubuntu-20.04
17+
runs-on: ubuntu-24.04
1818
permissions: write-all
1919
name: Swagger Detect Rules and Conflict
2020
steps:

apps/delegation-cdc/Dockerfile

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# syntax=docker/dockerfile:1.6@sha256:ac85f380a63b13dfcefa89046420e1781752bab202122f8f50032edf31be0021
2+
FROM maven:3-eclipse-temurin-17@sha256:0d328fa6843bb26b60cf44d69833f241ffe96218fb29fa19df7a6603863eaae7 AS builder
3+
4+
WORKDIR /src
5+
COPY --link pom.xml .
6+
7+
WORKDIR /src/test-coverage
8+
COPY --link ./test-coverage/pom.xml .
9+
10+
WORKDIR /src/apps
11+
COPY --link ./apps/pom.xml .
12+
13+
WORKDIR /src/apps/delegation-cdc
14+
COPY --link ./apps/delegation-cdc/pom.xml .
15+
COPY ./apps/delegation-cdc/src/main/ ./src/main/
16+
17+
RUN echo "<settings>\n" \
18+
"<servers>\n" \
19+
"<server>\n" \
20+
"<id>\${repositoryId}</id>\n" \
21+
"<username>\${repoLogin}</username>\n" \
22+
"<password>\${repoPwd}</password>\n" \
23+
"</server>\n" \
24+
"</servers>\n" \
25+
"</settings>\n" > settings.xml
26+
27+
ARG REPO_ONBOARDING
28+
ARG REPO_USERNAME
29+
ARG REPO_PASSWORD
30+
31+
RUN mvn --global-settings settings.xml --projects :delegation-cdc -DrepositoryId=${REPO_ONBOARDING} -DrepoLogin=${REPO_USERNAME} -DrepoPwd=${REPO_PASSWORD} --also-make clean package -DskipTests
32+
33+
FROM openjdk:17-jdk@sha256:528707081fdb9562eb819128a9f85ae7fe000e2fbaeaf9f87662e7b3f38cb7d8 AS runtime
34+
35+
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'
36+
ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
37+
38+
WORKDIR /app
39+
40+
COPY --from=builder /src/apps/delegation-cdc/target/quarkus-app/*.jar ./
41+
COPY --from=builder /src/apps/delegation-cdc/target/quarkus-app/app/ ./app/
42+
COPY --from=builder /src/apps/delegation-cdc/target/quarkus-app/quarkus/ ./quarkus/
43+
44+
ADD https://github.com/microsoft/ApplicationInsights-Java/releases/download/3.2.11/applicationinsights-agent-3.2.11.jar ./applicationinsights-agent.jar
45+
RUN chmod 755 ./applicationinsights-agent.jar
46+
47+
EXPOSE 8080
48+
USER 1001
49+
50+
ENTRYPOINT ["sh", "-c", "java $JAVA_OPTIONS -jar /app/quarkus-run.jar"]

apps/delegation-cdc/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Microservice Institution
2+
3+
Our dedicated microservice is crafted to expertly manage all events related to operations, such as insertion, update, and deletion,
4+
within the MongoDB collections residing in the delegations domain, to align delegations collection properly.
5+
This specialized solution has been meticulously designed to mitigate potential concurrency issues arising from the presence of multiple active instances
6+
on the main microservices.
7+
8+
## Configuration Properties
9+
10+
Before running you have to set these properties as environment variables.
11+
12+
| **Property** | **Environment Variable** | **Default** | **Required** |
13+
|-----------------------------------------------|----------------------------------------------|-------------|:------------:|
14+
| quarkus.mongodb.connection-string | MONGODB-CONNECTION-STRING | | yes |
15+
| delegation-cdc.app-insights.connection-string | DELEGATION-CDC-APPINSIGHTS-CONNECTION-STRING | | yes |
16+
| delegation-cdc.storage.connection-string | STORAGE_CONNECTION_STRING | | yes |
17+
18+
19+
> **_NOTE:_** properties that contains secret must have the same name of its secret as uppercase.
20+

0 commit comments

Comments
 (0)