Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a08ee48
chore: update identity values PIDM-487
FedericoRuzzier May 14, 2025
2800bd7
chore: update helm charts PIDM-487
FedericoRuzzier May 14, 2025
20c0325
chore: update github action PIDM-487
FedericoRuzzier May 14, 2025
f6649aa
chore: fix github action PIDM-487
FedericoRuzzier May 14, 2025
5ff3abd
Bump to version 0.0.2-1-PIDM-487 [skip ci]
pagopa-github-bot May 14, 2025
99dd7c8
Bump to version 0.0.2-2-PIDM-487 [skip ci]
pagopa-github-bot May 14, 2025
285cfd4
chore: update chart lock PIDM-487
FedericoRuzzier May 14, 2025
69ee4cc
Bump to version 0.0.2-3-PIDM-487 [skip ci]
pagopa-github-bot May 14, 2025
e35b3ad
chore: update secret management PIDM-487
FedericoRuzzier May 14, 2025
a223c59
Bump to version 0.0.2-4-PIDM-487 [skip ci]
pagopa-github-bot May 15, 2025
8df58ad
chore: update gh action PIDM-487
FedericoRuzzier May 15, 2025
642d731
chore: removing oracle from helm PIDM-487
FedericoRuzzier May 15, 2025
d2e33ec
Bump to version 0.0.2-5-PIDM-487 [skip ci]
pagopa-github-bot May 15, 2025
dc551d4
disabled nexi
aomegax Jun 3, 2025
2f445a4
Bump to version 0.0.2-1-housekeeping-nexi [skip ci]
pagopa-github-bot Jun 3, 2025
0386ad5
Merge branch 'PIDM-487' into housekeeping-nexi
aomegax Jun 4, 2025
2a370f7
Merge pull request #8 from pagopa/housekeeping-nexi
aomegax Jun 4, 2025
efa5ae6
Bump to version 0.0.2-6-PIDM-487 [skip ci]
pagopa-github-bot Jun 4, 2025
7c42998
fix
aomegax Jun 4, 2025
0e1c2e8
fix uat
aomegax Jun 4, 2025
7562aa9
chore: upgrade code review to 2.2.0 PIDM-487
FedericoRuzzier Jun 4, 2025
73e77f8
chore: upgrade java 17 PIDM-487
FedericoRuzzier Jun 4, 2025
9dc6907
Bump to version 0.0.2-7-PIDM-487 [skip ci]
pagopa-github-bot Jun 4, 2025
b442eac
chore: fix test code review PIDM-487
FedericoRuzzier Jun 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/03_code_review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Code Review
uses: pagopa/github-actions-template/maven-code-review@de4ca1ddefb1461c176cc42259e494158b578fe3 # v1.8.3
uses: pagopa/github-actions-template/maven-code-review@b134fb7af9a4d8b9b933eafb5cf5e12d88ee8ff1 # v2.2.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
sonar_token: ${{ secrets.SONAR_TOKEN }}
project_key: ${{env.PROJECT_KEY}}
coverage_exclusions: "**/config/*,**/*Mock*,**/model/**,**/entity/*"
cpd_exclusions: "**/model/**,**/entity/*"
java_version: '17'
java_version: 17

# smoke-test:
# name: Smoke Test
Expand Down
51 changes: 7 additions & 44 deletions .github/workflows/04h_deploy_with_github_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
required: true
description: The name of the environment where to deploy
type: string
branch:
required: false
default: ${{ github.ref_name }}
type: string
target:
required: true
description: The environment target of the job
Expand All @@ -33,30 +37,8 @@ permissions:
contents: read

jobs:
create_runner:
name: Create Runner
runs-on: ubuntu-22.04
environment:
name: ${{ inputs.environment }}
if: ${{ inputs.target == inputs.environment || inputs.target == 'all' }}
outputs:
runner_name: ${{ steps.create_github_runner.outputs.runner_name }}
steps:
- name: Create GitHub Runner
id: create_github_runner
# from https://github.com/pagopa/eng-github-actions-iac-template/tree/main/azure/github-self-hosted-runner-azure-create-action
uses: pagopa/eng-github-actions-iac-template/azure/github-self-hosted-runner-azure-create-action@main
with:
client_id: ${{ secrets.CLIENT_ID }}
tenant_id: ${{ secrets.TENANT_ID }}
subscription_id: ${{ secrets.SUBSCRIPTION_ID }}
container_app_environment_name: ${{ vars.CONTAINER_APP_ENVIRONMENT_NAME }}
resource_group_name: ${{ vars.CONTAINER_APP_ENVIRONMENT_RESOURCE_GROUP_NAME }} # RG of the runner
pat_token: ${{ secrets.BOT_TOKEN_GITHUB }}

deploy:
needs: [ create_runner ]
runs-on: [ self-hosted, "${{ needs.create_runner.outputs.runner_name }}" ]
runs-on: [ self-hosted-job, "${{ inputs.environment }}" ]
if: ${{ inputs.target == inputs.environment || inputs.target == 'all' }}
name: Deploy on AKS
environment: ${{ inputs.environment }}
Expand All @@ -65,7 +47,7 @@ jobs:
id: helm_generation
shell: bash
run: |
HELM_ARGS="--debug --wait --timeout 5m0s"
HELM_ARGS="--debug --wait --timeout 15m0s --set microservice-chart.azure.workloadIdentityClientId=${{vars.WORKLOAD_IDENTITY_ID}} --set postgresql.azure.workloadIdentityClientId=${{vars.WORKLOAD_IDENTITY_ID}} --set postgresql-nexi.azure.workloadIdentityClientId=${{vars.WORKLOAD_IDENTITY_ID}} --set oracle.azure.workloadIdentityClientId=${{vars.WORKLOAD_IDENTITY_ID}}"
if ${USE_POSTGRES}; then
HELM_ARGS="$HELM_ARGS --set postgresql.forceRedeploy=true --set postgresql.enabled=true"
fi
Expand All @@ -84,7 +66,7 @@ jobs:
- name: Deploy
uses: pagopa/github-actions-template/aks-deploy@main
with:
branch: ${{ github.ref_name }}
branch: ${{ inputs.branch }}
client_id: ${{ secrets.CLIENT_ID }}
subscription_id: ${{ secrets.SUBSCRIPTION_ID }}
tenant_id: ${{ secrets.TENANT_ID }}
Expand All @@ -94,22 +76,3 @@ jobs:
resource_group: ${{ vars.CLUSTER_RESOURCE_GROUP }}
app_name: ${{ env.APP_NAME }}
helm_upgrade_options: ${{ steps.helm_generation.outputs.helm_args }}

cleanup_runner:
name: Cleanup Runner
needs: [ create_runner, deploy ]
if: ${{ success() || failure() && inputs.target == inputs.environment || inputs.target == 'all' }}
runs-on: ubuntu-22.04
environment: ${{ inputs.environment }}
steps:
- name: Cleanup GitHub Runner
id: cleanup_github_runner
# from https://github.com/pagopa/eng-github-actions-iac-template/tree/main/azure/github-self-hosted-runner-azure-cleanup-action
uses: pagopa/eng-github-actions-iac-template/azure/github-self-hosted-runner-azure-cleanup-action@0ee2f58fd46d10ac7f00bce4304b98db3dbdbe9a
with:
client_id: ${{ secrets.CLIENT_ID }}
tenant_id: ${{ secrets.TENANT_ID }}
subscription_id: ${{ secrets.SUBSCRIPTION_ID }}
resource_group_name: ${{ vars.CONTAINER_APP_ENVIRONMENT_RESOURCE_GROUP_NAME }}
runner_name: ${{ needs.create_runner.outputs.runner_name }}
pat_token: ${{ secrets.BOT_TOKEN_GITHUB }}
10 changes: 10 additions & 0 deletions .identity/00_data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,13 @@ data "azurerm_key_vault_secret" "key_vault_slack_webhook_url" {
data "azurerm_resource_group" "app_rg" {
name = "pagopa-${var.env_short}-api-config-rg"
}

data "azurerm_user_assigned_identity" "workload_identity_clientid" {
name = "apiconfig-workload-identity"
resource_group_name = "pagopa-${var.env_short}-${local.location_short}-${var.env}-aks-rg"
}

data "azurerm_user_assigned_identity" "identity_cd_01" {
resource_group_name = "${local.product}-identity-rg"
name = "${local.product}-${local.domain}-job-01-github-cd-identity"
}
3 changes: 2 additions & 1 deletion .identity/03_github_environment.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ resource "github_repository_environment" "github_repository_environment" {

locals {
env_secrets = {
"CLIENT_ID" : module.github_runner_app.application_id,
"CLIENT_ID" : data.azurerm_user_assigned_identity.identity_cd_01.client_id,
"TENANT_ID" : data.azurerm_client_config.current.tenant_id,
"SUBSCRIPTION_ID" : data.azurerm_subscription.current.subscription_id,
}
Expand All @@ -32,6 +32,7 @@ locals {
"CLUSTER_RESOURCE_GROUP" : local.aks_cluster.resource_group_name,
"DOMAIN" : local.domain,
"NAMESPACE" : local.domain,
"WORKLOAD_IDENTITY_ID": data.azurerm_user_assigned_identity.workload_identity_clientid.client_id
}
repo_secrets = {
"SONAR_TOKEN" : data.azurerm_key_vault_secret.key_vault_sonar.value,
Expand Down
4 changes: 2 additions & 2 deletions .identity/99_main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ terraform {
required_providers {
azuread = {
source = "hashicorp/azuread"
version = "2.30.0"
version = "~> 2.53"
}
azurerm = {
source = "hashicorp/azurerm"
version = "3.45.0"
version = "~> 3.117"
}
github = {
source = "integrations/github"
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#
# Build
#
FROM maven:3.8.4-jdk-11-slim@sha256:04f8e5ba4a6a74fb7f97940bc75ac7340520728d2fb051ecc5c9ecbb9ba28b48 as buildtime
FROM maven:3.9.6-amazoncorretto-17-al2023@sha256:4c8bd9ec72b372f587f7b9d92564a307e4f5180b7ec08455fb346617bae1757e AS buildtime
WORKDIR /build
COPY . .
RUN mvn clean package
RUN mvn clean package -Dmaven.test.skip=true


FROM adoptopenjdk/openjdk11:alpine-jre@sha256:6223307985cce9180b0cf059ae9adbf81e57c529622210843d133804c7b9dbff as builder
FROM amazoncorretto:17.0.10-alpine3.19@sha256:180e9c91bdbaad3599fedd2f492bf0d0335a9382835aa64669b2c2a8de7c9a22 AS builder
COPY --from=buildtime /build/target/*.jar application.jar
RUN java -Djarmode=layertools -jar application.jar extract


FROM ghcr.io/pagopa/docker-base-springboot-openjdk11:v1.0.1@sha256:bbbe948e91efa0a3e66d8f308047ec255f64898e7f9250bdb63985efd3a95dbf
FROM ghcr.io/pagopa/docker-base-springboot-openjdk17:v2.2.7@sha256:ea58bccaed00c346eea5ed0ad221d8763feb34c8cce620d86cd4370d7df35125
ADD --chown=spring:spring https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.25.1/opentelemetry-javaagent.jar .

COPY --chown=spring:spring --from=builder dependencies/ ./
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the [OpenApi 3 here.](https://editor.swagger.io/?url=https://raw.githubuserc

## Technology Stack

- Java 11
- Java 17
- Spring Boot
- Spring Web
- Hibernate
Expand Down Expand Up @@ -46,7 +46,7 @@ from `./docker` directory

- git
- maven
- jdk-11
- jdk-17

### Run the project

Expand Down
10 changes: 5 additions & 5 deletions helm/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
dependencies:
- name: microservice-chart
repository: https://pagopa.github.io/aks-microservice-chart-blueprint
version: 3.0.0
version: 7.5.0
- name: microservice-chart
repository: https://pagopa.github.io/aks-microservice-chart-blueprint
version: 3.0.0
version: 7.5.0
- name: microservice-chart
repository: https://pagopa.github.io/aks-microservice-chart-blueprint
version: 3.0.0
digest: sha256:ee7bbc6340aff59d4886edd5f41d1f65f20659969359927a6151001b263c3512
generated: "2024-03-14T11:50:54.060245+01:00"
version: 7.5.0
digest: sha256:0ba2d3153400e4efc93c37fa7d978b51d6cee38f36523325eee3b173cceb3667
generated: "2025-05-14T14:42:56.754755+02:00"
10 changes: 5 additions & 5 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ apiVersion: v2
name: apiconfig-testing-support
description: Microservice that handles tests about Nodo dei Pagamenti
type: application
version: 0.16.0
appVersion: 0.0.2
version: 0.23.0
appVersion: 0.0.2-7-PIDM-487
dependencies:
- name: microservice-chart
version: 3.0.0
version: 7.5.0
repository: "https://pagopa.github.io/aks-microservice-chart-blueprint"
alias: postgresql
condition: postgresql.enabled
- name: microservice-chart
version: 3.0.0
version: 7.5.0
repository: "https://pagopa.github.io/aks-microservice-chart-blueprint"
alias: postgresql-nexi
condition: postgresql-nexi.enabled
- name: microservice-chart
version: 3.0.0
version: 7.5.0
repository: "https://pagopa.github.io/aks-microservice-chart-blueprint"
alias: oracle
condition: oracle.enabled
Loading
Loading