diff --git a/.github/workflows/05h_deploy_with_github_runner.yml b/.github/workflows/05h_deploy_with_github_runner.yml index c9a1fa6..f5d6569 100644 --- a/.github/workflows/05h_deploy_with_github_runner.yml +++ b/.github/workflows/05h_deploy_with_github_runner.yml @@ -114,7 +114,7 @@ jobs: shell: bash run: | cd ./infra - export ARM_CLIENT_ID="${{ secrets.CLIENT_ID }}" + export ARM_CLIENT_ID="${{ secrets.CD_CLIENT_ID }}" export ARM_SUBSCRIPTION_ID=$(az account show --query id --output tsv) export ARM_TENANT_ID=$(az account show --query tenantId --output tsv) export ARM_USE_OIDC=true diff --git a/Dockerfile b/Dockerfile index 7f048f7..6a66b78 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,24 +6,26 @@ WORKDIR /build COPY . . RUN mvn clean package -DskipTests - FROM amazoncorretto:17.0.10-alpine3.19@sha256:180e9c91bdbaad3599fedd2f492bf0d0335a9382835aa64669b2c2a8de7c9a22 as builder -WORKDIR /app -COPY --from=buildtime /build/target/*.jar /app/application.jar -RUN java -Djarmode=layertools -jar application.jar extract - +#WORKDIR /app +#COPY --from=buildtime /build/target/*.jar /app/application.jar +#RUN java -Djarmode=layertools -jar application.jar extract +COPY --from=buildtime /build/target/*.jar application.jar -FROM ghcr.io/pagopa/docker-base-springboot-openjdk17:v1.1.3@sha256:a4e970ef05ecf2081424a64707e7c20856bbc40ddb3e99b32a24cd74591817c4 -WORKDIR /app -#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 /app/dependencies/ ./ -COPY --chown=spring:spring --from=builder /app/snapshot-dependencies/ ./ +#FROM ghcr.io/pagopa/docker-base-springboot-openjdk17:v1.1.3@sha256:a4e970ef05ecf2081424a64707e7c20856bbc40ddb3e99b32a24cd74591817c4 +#COPY --chown=spring:spring --from=builder /app/dependencies/ ./ +#COPY --chown=spring:spring --from=builder /app/snapshot-dependencies/ ./ # https://github.com/moby/moby/issues/37965#issuecomment-426853382 -COPY --chown=spring:spring --from=builder /app/spring-boot-loader/ ./ -COPY --chown=spring:spring --from=builder /app/application/ ./ +#RUN true +#COPY --chown=spring:spring --from=builder /app/spring-boot-loader/ ./ +#COPY --chown=spring:spring --from=builder /app/application/ ./ + +## https://github.com/microsoft/ApplicationInsights-Java/releases +ADD --chown=spring:spring https://github.com/microsoft/ApplicationInsights-Java/releases/download/3.4.19/applicationinsights-agent-3.4.19.jar applicationinsights-agent.jar +COPY --chown=spring:spring docker/applicationinsights.json applicationinsights.json +COPY --chown=spring:spring docker/run.sh run.sh +RUN chmod +x ./run.sh EXPOSE 8080 -#ENTRYPOINT ["java","-javaagent:opentelemetry-javaagent.jar","--enable-preview","org.springframework.boot.loader.JarLauncher"] -ENTRYPOINT ["java", "--enable-preview","org.springframework.boot.loader.JarLauncher"] +ENTRYPOINT ["./run.sh"] diff --git a/docker/applicationinsights.json b/docker/applicationinsights.json new file mode 100644 index 0000000..67df876 --- /dev/null +++ b/docker/applicationinsights.json @@ -0,0 +1,6 @@ +{ + "selfDiagnostics": { + "destination": "console", + "level": "INFO" + } +} \ No newline at end of file diff --git a/docker/run.sh b/docker/run.sh new file mode 100644 index 0000000..8fb165d --- /dev/null +++ b/docker/run.sh @@ -0,0 +1,3 @@ +#!/bin/sh +#exec java -javaagent:/applicationinsights-agent.jar ${JAVA_OPTS} org.springframework.boot.loader.JarLauncher "$@" +exec java -javaagent:/applicationinsights-agent.jar ${JAVA_OPTS} -jar application.jar \ No newline at end of file diff --git a/helm/Chart.yaml b/helm/Chart.yaml index bc5be75..c4587f3 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: pagopa-node-cfg-sync description: Microservice that sync api-config-cache and standin configuration type: application -version: 0.52.0 -appVersion: 0.0.3 +version: 0.75.0 +appVersion: 0.0.3-23-NOD-744-deploy-uat dependencies: - name: microservice-chart version: 2.8.0 diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index af2f464..993c357 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -4,20 +4,20 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.3" + tag: "0.0.3-23-NOD-744-deploy-uat" pullPolicy: Always livenessProbe: httpGet: path: /actuator/health/liveness port: 8080 - initialDelaySeconds: 30 + initialDelaySeconds: 180 failureThreshold: 6 periodSeconds: 10 readinessProbe: httpGet: path: /actuator/health/readiness port: 8080 - initialDelaySeconds: 30 + initialDelaySeconds: 180 failureThreshold: 6 periodSeconds: 10 deployment: @@ -97,14 +97,14 @@ microservice-chart: OTEL_TRACES_SAMPLER: "always_on" envSecret: # required - APPLICATIONINSIGHTS_CONNECTION_STRING: 'ai-d-connection-string' + APPLICATIONINSIGHTS_CONNECTION_STRING: 'azure-insight-connection-string' DB_PAGOPA_POSTGRES_PASSWORD: "db-cfg-password" DB_NEXI_POSTGRES_PASSWORD: "db-nexi-cfg-password" DB_NEXI_ORACLE_PASSWORD: "oracle-db-cfg-password" API_CONFIG_CACHE_RX_CONNECTION_STRING: "nodo-dei-pagamenti-cache-sync-rx-connection-string-key" - API_CONFIG_CACHE_SA_CONNECTION_STRING: "nodo-dei-pagamenti-cache-sync-sa-connection-string-key" + API_CONFIG_CACHE_SA_CONNECTION_STRING: "node-cfg-sync-re-sa-connection-string-key" STAND_IN_MANAGER_RX_CONNECTION_STRING: "nodo-dei-pagamenti-stand-in-sync-rx-connection-string-key" - STAND_IN_MANAGER_SA_CONNECTION_STRING: "nodo-dei-pagamenti-stand-in-sync-sa-connection-string-key" + STAND_IN_MANAGER_SA_CONNECTION_STRING: "node-cfg-sync-re-sa-connection-string-key" API_CONFIG_CACHE_SUBSCRIPTION_KEY: "cfg-for-node-subscription-key" STAND_IN_MANAGER_SUBSCRIPTION_KEY: "cfg-for-node-subscription-key" OTEL_EXPORTER_OTLP_HEADERS: "elastic-apm-secret-token" diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index 427ae02..805d2b6 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.3" + tag: "0.0.3-23-NOD-744-deploy-uat" pullPolicy: Always livenessProbe: httpGet: @@ -74,20 +74,20 @@ microservice-chart: DB_NEXI_POSTGRES_SERVICE_IDENTIFIER: "NDP004DEV" DB_NEXI_POSTGRES_CONNECTION_TIMEOUT: "15000" DB_NEXI_POSTGRES_MAX_LIFETIME: "30000" - DB_CONFIG_URL: "jdbc:oracle:thin:@(DESCRIPTION=(ENABLE=BROKEN)(ADDRESS=(PROTOCOL=tcp)(PORT=1521)(HOST=db-nodo-pagamenti.p.db-nodo-pagamenti.com))(CONNECT_DATA=(SERVICE_NAME=NDPSPCP_NODO4_CFG))(SO_KEEPALIVE=true)(TCP_KEEPIDLE=60)(TCP_KEEPINTVL=30)(TCP_KEEPCNT=15))" + DB_NEXI_ORACLE_URL: "jdbc:oracle:thin:@(DESCRIPTION=(ENABLE=BROKEN)(ADDRESS=(PROTOCOL=tcp)(PORT=1521)(HOST=db-nodo-pagamenti.p.db-nodo-pagamenti.com))(CONNECT_DATA=(SERVICE_NAME=NDPSPCP_NODO4_CFG))(SO_KEEPALIVE=true)(TCP_KEEPIDLE=60)(TCP_KEEPINTVL=30)(TCP_KEEPCNT=15))" DB_NEXI_ORACLE_USER: "NODO4_CFG" DB_NEXI_ORACLE_ENABLED: "true" DB_NEXI_ORACLE_SERVICE_IDENTIFIER: "NDP003DEV" DB_NEXI_ORACLE_CONNECTION_TIMEOUT: "15000" DB_NEXI_ORACLE_MAX_LIFETIME: "30000" - DB_PAGOPA_POSTGRES_URL: "jdbc:postgresql://ndp.p.db-nodo-pagamenti.com:6432/nodo?sslmode=require&prepareThreshold=0¤tSchema=cfg" + DB_PAGOPA_POSTGRES_URL: "jdbc:postgresql://nodo-db.p.internal.postgresql.pagopa.it:6432/nodo?sslmode=require&prepareThreshold=0¤tSchema=cfg" DB_PAGOPA_POSTGRES_USER: "cfg" DB_PAGOPA_POSTGRES_ENABLED: "true" DB_PAGOPA_POSTGRES_SERVICE_IDENTIFIER: "NDP001DEV" DB_PAGOPA_POSTGRES_CONNECTION_TIMEOUT: "15000" DB_PAGOPA_POSTGRES_MAX_LIFETIME: "30000" - API_CONFIG_CACHE_URL: "https://api.uat.platform.pagopa.it/api-config-cache/o/v1/stakeholders/node/cache/schemas/v1" - STAND_IN_MANAGER_URL: "https://api.uat.platform.pagopa.it/stand-in-manager/api/v1" + API_CONFIG_CACHE_URL: "https://api.platform.pagopa.it/api-config-cache/o/v1/stakeholders/node/cache/schemas/v1" + STAND_IN_MANAGER_URL: "https://api.platform.pagopa.it/stand-in-manager/api/v1" OTEL_SERVICE_NAME: "pagopanodecfgsync" OTEL_RESOURCE_ATTRIBUTES: "deployment.environment=prod" OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector.elastic-system.svc:4317" @@ -97,14 +97,14 @@ microservice-chart: OTEL_TRACES_SAMPLER: "always_on" envSecret: # required - APPLICATIONINSIGHTS_CONNECTION_STRING: 'ai-p-connection-string' + APPLICATIONINSIGHTS_CONNECTION_STRING: 'azure-insight-connection-string' DB_PAGOPA_POSTGRES_PASSWORD: "db-cfg-password" DB_NEXI_POSTGRES_PASSWORD: "db-nexi-cfg-password" DB_NEXI_ORACLE_PASSWORD: "oracle-db-cfg-password" API_CONFIG_CACHE_RX_CONNECTION_STRING: "nodo-dei-pagamenti-cache-sync-rx-connection-string-key" - API_CONFIG_CACHE_SA_CONNECTION_STRING: "nodo-dei-pagamenti-cache-sync-sa-connection-string-key" + API_CONFIG_CACHE_SA_CONNECTION_STRING: "node-cfg-sync-re-sa-connection-string-key" STAND_IN_MANAGER_RX_CONNECTION_STRING: "nodo-dei-pagamenti-stand-in-sync-rx-connection-string-key" - STAND_IN_MANAGER_SA_CONNECTION_STRING: "nodo-dei-pagamenti-stand-in-sync-sa-connection-string-key" + STAND_IN_MANAGER_SA_CONNECTION_STRING: "node-cfg-sync-re-sa-connection-string-key" API_CONFIG_CACHE_SUBSCRIPTION_KEY: "cfg-for-node-subscription-key" STAND_IN_MANAGER_SUBSCRIPTION_KEY: "cfg-for-node-subscription-key" OTEL_EXPORTER_OTLP_HEADERS: "elastic-apm-secret-token" diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index c8ede77..7b920fa 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-node-cfg-sync - tag: "0.0.3" + tag: "0.0.3-23-NOD-744-deploy-uat" pullPolicy: Always livenessProbe: httpGet: @@ -74,13 +74,13 @@ microservice-chart: DB_NEXI_POSTGRES_SERVICE_IDENTIFIER: "NDP004DEV" DB_NEXI_POSTGRES_CONNECTION_TIMEOUT: "15000" DB_NEXI_POSTGRES_MAX_LIFETIME: "30000" - DB_CONFIG_URL: "jdbc:oracle:thin:@(DESCRIPTION=(ENABLE=BROKEN)(ADDRESS=(PROTOCOL=tcp)(PORT=1524)(HOST=db-nodo-pagamenti.u.db-nodo-pagamenti.com))(CONNECT_DATA=(SERVICE_NAME=NDPSPCA_NODO4_CFG))(SO_KEEPALIVE=true)(TCP_KEEPIDLE=60)(TCP_KEEPINTVL=30)(TCP_KEEPCNT=15))" + DB_NEXI_ORACLE_URL: "jdbc:oracle:thin:@(DESCRIPTION=(ENABLE=BROKEN)(ADDRESS=(PROTOCOL=tcp)(PORT=1524)(HOST=db-nodo-pagamenti.u.db-nodo-pagamenti.com))(CONNECT_DATA=(SERVICE_NAME=NDPSPCA_NODO4_CFG))(SO_KEEPALIVE=true)(TCP_KEEPIDLE=60)(TCP_KEEPINTVL=30)(TCP_KEEPCNT=15))" DB_NEXI_ORACLE_USER: "NODO4_CFG" DB_NEXI_ORACLE_ENABLED: "true" DB_NEXI_ORACLE_SERVICE_IDENTIFIER: "NDP003DEV" DB_NEXI_ORACLE_CONNECTION_TIMEOUT: "15000" DB_NEXI_ORACLE_MAX_LIFETIME: "30000" - DB_PAGOPA_POSTGRES_URL: "jdbc:postgresql://ndp.u.db-nodo-pagamenti.com:6432/nodo?sslmode=require&prepareThreshold=0¤tSchema=cfg" + DB_PAGOPA_POSTGRES_URL: "jdbc:postgresql://nodo-db.u.internal.postgresql.pagopa.it:6432/nodo?sslmode=require&prepareThreshold=0¤tSchema=cfg" DB_PAGOPA_POSTGRES_USER: "cfg" DB_PAGOPA_POSTGRES_ENABLED: "true" DB_PAGOPA_POSTGRES_SERVICE_IDENTIFIER: "NDP001DEV" @@ -97,14 +97,14 @@ microservice-chart: OTEL_TRACES_SAMPLER: "always_on" envSecret: # required - APPLICATIONINSIGHTS_CONNECTION_STRING: 'ai-u-connection-string' + APPLICATIONINSIGHTS_CONNECTION_STRING: 'azure-insight-connection-string' DB_PAGOPA_POSTGRES_PASSWORD: "db-cfg-password" DB_NEXI_POSTGRES_PASSWORD: "db-nexi-cfg-password" DB_NEXI_ORACLE_PASSWORD: "oracle-db-cfg-password" API_CONFIG_CACHE_RX_CONNECTION_STRING: "nodo-dei-pagamenti-cache-sync-rx-connection-string-key" - API_CONFIG_CACHE_SA_CONNECTION_STRING: "nodo-dei-pagamenti-cache-sync-sa-connection-string-key" + API_CONFIG_CACHE_SA_CONNECTION_STRING: "node-cfg-sync-re-sa-connection-string-key" STAND_IN_MANAGER_RX_CONNECTION_STRING: "nodo-dei-pagamenti-stand-in-sync-rx-connection-string-key" - STAND_IN_MANAGER_SA_CONNECTION_STRING: "nodo-dei-pagamenti-stand-in-sync-sa-connection-string-key" + STAND_IN_MANAGER_SA_CONNECTION_STRING: "node-cfg-sync-re-sa-connection-string-key" API_CONFIG_CACHE_SUBSCRIPTION_KEY: "cfg-for-node-subscription-key" STAND_IN_MANAGER_SUBSCRIPTION_KEY: "cfg-for-node-subscription-key" OTEL_EXPORTER_OTLP_HEADERS: "elastic-apm-secret-token" diff --git a/openapi/openapi.json b/openapi/openapi.json index b30e1bd..bd34b16 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -4,7 +4,7 @@ "title": "cfg-sync", "description": "Microservice to update configuration schema of Nodo dei Pagamenti", "termsOfService": "https://www.pagopa.gov.it/", - "version": "0.0.3" + "version": "0.0.3-23-NOD-744-deploy-uat" }, "servers": [ { diff --git a/pom.xml b/pom.xml index a4cbc99..dcd7d2a 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ it.gov.pagopa.node cfg-sync - 0.0.3 + 0.0.3-23-NOD-744-deploy-uat Microservice to update configuration schema of Nodo dei Pagamenti