Skip to content

Commit

Permalink
Merge pull request #43 from pagopa/NOD-692_riversamento
Browse files Browse the repository at this point in the history
[NOD-692] Riversamento
  • Loading branch information
aomegax authored Feb 27, 2024
2 parents f8a3352 + dcca485 commit 69491a7
Show file tree
Hide file tree
Showing 27 changed files with 418 additions and 168 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/anchore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,28 @@ jobs:
- name: Checkout the code
uses: actions/checkout@v3

- name: Build the Docker image
run: docker build . --file ${{ env.DOCKERFILE }} --tag localbuild/testimage:latest
# - name: Build the Docker image
# run: docker build . --file ${{ env.DOCKERFILE }} --tag localbuild/testimage:latest
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: false
tags: localbuild/testimage:latest
secrets: |
GH_TOKEN=${{ secrets.READ_PACKAGES_TOKEN }}
- name: Run the Anchore scan action itself with GitHub Advanced Security code scanning integration enabled
id: scan
uses: anchore/scan-action@v3
with:
image: "localbuild/testimage:latest"
acs-report-enable: true
fail-build: true
severity-cutoff: "high"

- name: Upload Anchore Scan Report
uses: github/codeql-action/upload-sarif@v2
if: always()
with:
sarif_file: results.sarif
sarif_file: ${{ steps.scan.outputs.sarif }}
3 changes: 2 additions & 1 deletion .github/workflows/code_review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +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@v1.4.2
uses: pagopa/github-actions-template/maven-code-review@v1.8.3
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'

# smoke-test:
# name: Smoke Test
Expand Down
6 changes: 3 additions & 3 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 as buildtime
FROM maven:3.9.5-amazoncorretto-17-al2023@sha256:eeaa7ab572d931f7273fc5cf31429923f172091ae388969e11f42ec6dd817d74 as buildtime
WORKDIR /build
COPY . .
RUN --mount=type=secret,id=GH_TOKEN,dst=/tmp/secret_token export GITHUB_TOKEN_READ_PACKAGES="$(cat /tmp/secret_token)" \
&& mvn clean package -Dmaven.test.skip=true

FROM adoptopenjdk/openjdk11:alpine-jre as builder
FROM amazoncorretto:17.0.9-alpine3.18@sha256:df48bf2e183230040890460ddb4359a10aa6c7aad24bd88899482c52053c7e17 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:v1.1.0@sha256:6fa320d452fa22066441f1ef292d15eb06f944bc8bca293e1a91ea460d30a613
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 helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: pagopa-api-cache-chart
description: Microservice that handles calculation for pagoPA Advanced Fees Management
type: application
version: 0.26.0
version: 0.28.0
dependencies:
- name: microservice-chart
version: 3.0.0
Expand Down Expand Up @@ -40,4 +40,4 @@ dependencies:
version: 2.3.0
repository: "https://pagopa.github.io/aks-cron-chart-blueprint"
alias: refresh-oprod
appVersion: 0.8.7
appVersion: 0.8.7-2-NOD-692_riversamento
9 changes: 5 additions & 4 deletions helm/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ microservice-chart: &microservice-chart
namespace: "apiconfig"
image:
repository: ghcr.io/pagopa/pagopa-api-config-cache
tag: 0.8.7
tag: 0.8.7-2-NOD-692_riversamento
canaryDelivery:
deployment:
image:
Expand Down Expand Up @@ -40,12 +40,14 @@ microservice-chart: &microservice-chart
OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector.elastic-system.svc:4317"
OTEL_LOGS_EXPORTER: none
OTEL_TRACES_SAMPLER: "always_on"
CACHET_TX_NAME: "nodo-dei-pagamenti-cache"
secretProvider: &azureSecretProvider
create: true
envSecrets: &envSecret
APPLICATIONINSIGHTS_CONNECTION_STRING: "ai-d-connection-string"
REDIS_PWD: "redis-password"
OTEL_EXPORTER_OTLP_HEADERS: elastic-apm-secret-token
CACHE_TX_CONNECTION_STRING: "nodo-dei-pagamenti-cache-tx-connection-string-key"
keyvault:
name: "pagopa-d-apiconfig-kv"
tenantId: "7788edaf-0346-4068-9d79-c868aed15b3d"
Expand Down Expand Up @@ -75,6 +77,7 @@ postgresql:
DATABASE_ID: "p"
HEALTHCHECK_QUERY: "select 1"
SAVE_DB: "true"
SEND_EVENT: "true"
secretProvider:
!!merge <<: *azureSecretProvider
envSecrets:
Expand All @@ -91,10 +94,10 @@ oracle:
DB_CONFIG_URL: "jdbc:oracle:thin:@(DESCRIPTION=(ENABLE=BROKEN)(ADDRESS=(PROTOCOL=tcp)(PORT=1522)(HOST=db-nodo-pagamenti.d.db-nodo-pagamenti.com))(CONNECT_DATA=(SERVICE_NAME=NDPSPCT_PP_NODO4_CFG))(SO_KEEPALIVE=true)(TCP_KEEPIDLE=60)(TCP_KEEPINTVL=30)(TCP_KEEPCNT=15))"
DB_CONFIG_USER: "NODO4_CFG"
DB_CONFIG_DRIVER: "oracle.jdbc.OracleDriver"
JAVA_OPTS: "-Dspring.jpa.show-sql=false"
DATABASE_ID: "o"
HEALTHCHECK_QUERY: "select 1 from dual"
SAVE_DB: "true"
SEND_EVENT: "true"
secretProvider:
!!merge <<: *azureSecretProvider
envSecrets:
Expand All @@ -111,7 +114,6 @@ oracledev:
DB_CONFIG_URL: "jdbc:oracle:thin:@db-nodo-pagamenti.d.db-nodo-pagamenti.com:1522/NDPSPCT_NODO4_CFG"
DB_CONFIG_USER: "NODO4_CFG_DEV"
DB_CONFIG_DRIVER: "oracle.jdbc.OracleDriver"
JAVA_OPTS: "-Dspring.jpa.show-sql=false"
DATABASE_ID: "odev"
HEALTHCHECK_QUERY: "select 1 from dual"
SAVE_DB: "true"
Expand All @@ -131,7 +133,6 @@ oracleprod:
DB_CONFIG_URL: "jdbc:oracle:thin:@db-nodo-pagamenti.d.db-nodo-pagamenti.com:1522/NDPSPCT_NODO4_CFG"
DB_CONFIG_USER: "NODO4_CFG_EXPORT"
DB_CONFIG_DRIVER: "oracle.jdbc.OracleDriver"
JAVA_OPTS: "-Dspring.jpa.show-sql=false"
DATABASE_ID: "oprod"
HEALTHCHECK_QUERY: "select 1 from dual"
SAVE_DB: "true"
Expand Down
13 changes: 8 additions & 5 deletions helm/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ microservice-chart: &microservice-chart
namespace: "apiconfig"
image:
repository: ghcr.io/pagopa/pagopa-api-config-cache
tag: 0.8.7
tag: 0.8.7-2-NOD-692_riversamento
canaryDelivery:
deployment:
image:
Expand Down Expand Up @@ -31,6 +31,7 @@ microservice-chart: &microservice-chart
cpu: "2.5"
envConfig: &envConfig
ENV: "prod"
TZ: "Europe/Rome"
AZURE_INSIGHTS_ENABLED: "true"
REDIS_HOST: "pagopa-p-redis.redis.cache.windows.net"
REDIS_PORT: "6380"
Expand All @@ -39,12 +40,14 @@ microservice-chart: &microservice-chart
OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector.elastic-system.svc:4317"
OTEL_LOGS_EXPORTER: none
OTEL_TRACES_SAMPLER: "always_on"
CACHET_TX_NAME: "nodo-dei-pagamenti-cache"
secretProvider: &azureSecretProvider
create: true
envSecrets: &envSecret
APPLICATIONINSIGHTS_CONNECTION_STRING: "ai-p-connection-string"
REDIS_PWD: "redis-password"
OTEL_EXPORTER_OTLP_HEADERS: elastic-apm-secret-token
CACHE_TX_CONNECTION_STRING: "nodo-dei-pagamenti-cache-tx-connection-string-key"
keyvault:
name: "pagopa-p-apiconfig-kv"
tenantId: "7788edaf-0346-4068-9d79-c868aed15b3d"
Expand Down Expand Up @@ -82,7 +85,8 @@ postgresql:
DB_CONFIG_DRIVER: "org.postgresql.Driver"
DATABASE_ID: "p"
HEALTHCHECK_QUERY: "select 1"
JAVA_OPTS: "-Dspring.jpa.show-sql=false"
SAVE_DB: "false"
SEND_EVENT: "true"
secretProvider:
!!merge <<: *azureSecretProvider
envSecrets:
Expand All @@ -99,12 +103,12 @@ oracle:
DB_CONFIG_URL: "jdbc:oracle:thin:@db-nodo-pagamenti.p.db-nodo-pagamenti.com:1521/NDPSPCP_NODO4_CFG"
DB_CONFIG_USER: "NODO4_CFG"
DB_CONFIG_DRIVER: "oracle.jdbc.OracleDriver"
JAVA_OPTS: "-Dspring.jpa.show-sql=false -XX:MaxHeapSize=6g"
JAVA_OPTS: "-XX:MaxHeapSize=6g"
DATABASE_ID: "o"
IN_PROGRESS_TTL: "20"
HEALTHCHECK_QUERY: "select 1 from dual"
SAVE_DB: "true"
DEFAULT_LOGGING_LEVEL: "info" # TODO remove
SEND_EVENT: "true"
secretProvider:
!!merge <<: *azureSecretProvider
envSecrets:
Expand All @@ -123,7 +127,6 @@ refresh-oprod:
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_CONFIG_USER: "NODO4_CFG"
DB_CONFIG_DRIVER: "oracle.jdbc.OracleDriver"
JAVA_OPTS: "-Dspring.jpa.show-sql=false"
DATABASE_ID: "oprod"
IN_PROGRESS_TTL: "20"
HEALTHCHECK_QUERY: "select 1 from dual"
Expand Down
9 changes: 7 additions & 2 deletions helm/values-uat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ microservice-chart: &microservice-chart
namespace: "apiconfig"
image:
repository: ghcr.io/pagopa/pagopa-api-config-cache
tag: 0.8.7
tag: 0.8.7-2-NOD-692_riversamento
canaryDelivery:
deployment:
image:
Expand Down Expand Up @@ -31,6 +31,7 @@ microservice-chart: &microservice-chart
cpu: "1"
envConfig: &envConfig
ENV: "uat"
TZ: "Europe/Rome"
AZURE_INSIGHTS_ENABLED: "true"
REDIS_HOST: "pagopa-u-redis.redis.cache.windows.net"
REDIS_PORT: "6380"
Expand All @@ -39,12 +40,14 @@ microservice-chart: &microservice-chart
OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector.elastic-system.svc:4317"
OTEL_LOGS_EXPORTER: none
OTEL_TRACES_SAMPLER: "always_on"
CACHET_TX_NAME: "nodo-dei-pagamenti-cache"
secretProvider: &azureSecretProvider
create: true
envSecrets: &envSecret
APPLICATIONINSIGHTS_CONNECTION_STRING: "ai-u-connection-string"
REDIS_PWD: "redis-password"
OTEL_EXPORTER_OTLP_HEADERS: elastic-apm-secret-token
CACHE_TX_CONNECTION_STRING: "nodo-dei-pagamenti-cache-tx-connection-string-key"
keyvault:
name: "pagopa-u-apiconfig-kv"
tenantId: "7788edaf-0346-4068-9d79-c868aed15b3d"
Expand Down Expand Up @@ -73,6 +76,8 @@ postgresql:
DB_CONFIG_DRIVER: "org.postgresql.Driver"
DATABASE_ID: "p"
HEALTHCHECK_QUERY: "select 1"
SAVE_DB: "false"
SEND_EVENT: "true"
secretProvider:
!!merge <<: *azureSecretProvider
envSecrets:
Expand All @@ -89,10 +94,10 @@ oracle:
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_CONFIG_USER: "NODO4_CFG"
DB_CONFIG_DRIVER: "oracle.jdbc.OracleDriver"
JAVA_OPTS: "-Dspring.jpa.show-sql=false"
DATABASE_ID: "o"
HEALTHCHECK_QUERY: "select 1 from dual"
SAVE_DB: "true"
SEND_EVENT: "true"
secretProvider:
!!merge <<: *azureSecretProvider
envSecrets:
Expand Down
10 changes: 5 additions & 5 deletions openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@
"title": "API-Config Cacher ${service}",
"description": "Generate cache for various microservices",
"termsOfService": "https://www.pagopa.gov.it/",
"version": "0.8.7"
"version": "0.8.7-2-NOD-692_riversamento"
},
"servers": [
{
"url": "https://{host}/{basePath}",
"variables": {
"host": {
"default": "api.dev.platform.pagopa.it",
"enum": [
"api.dev.platform.pagopa.it",
"api.uat.platform.pagopa.it",
"api.platform.pagopa.it"
],
"default": "api.dev.platform.pagopa.it"
]
},
"basePath": {
"default": "api-config-cache/o/v1",
"enum": [
"api-config-cache/o/v1",
"api-config-cache/p/v1",
"api-config-cache/odev/v1"
],
"default": "api-config-cache/o/v1"
]
}
}
}
Expand Down
Loading

0 comments on commit 69491a7

Please sign in to comment.