From f8c7aaf6c9739f6161d06935b44bee094d6415e5 Mon Sep 17 00:00:00 2001 From: "Michal J. Sladek" Date: Sun, 20 Oct 2024 14:57:47 +0200 Subject: [PATCH] Legger inn fp-inntektsmelding backend. --- lokal-utvikling/setup-lokal-utvikling.sh | 4 + resources/pipeline/compose.yml | 131 ++++++++++++------ .../pipeline/fpinfohistorikk_datasource.env | 6 - .../pipeline/fpinntektsmelding_datasource.env | 6 + .../postgres-init/fpinntektsmelding.sql | 11 ++ resources/pipeline/update-versions.sh | 1 + 6 files changed, 113 insertions(+), 46 deletions(-) delete mode 100644 resources/pipeline/fpinfohistorikk_datasource.env create mode 100644 resources/pipeline/fpinntektsmelding_datasource.env create mode 100644 resources/pipeline/postgres-init/fpinntektsmelding.sql diff --git a/lokal-utvikling/setup-lokal-utvikling.sh b/lokal-utvikling/setup-lokal-utvikling.sh index ebe8d611816b..172a19cb91ff 100755 --- a/lokal-utvikling/setup-lokal-utvikling.sh +++ b/lokal-utvikling/setup-lokal-utvikling.sh @@ -40,6 +40,10 @@ settPorterSomSkalErstattes () { replace_port_array=("8080") with_port_array=("8050") ;; + fpinntektsmelding) + replace_port_array=("8080") + with_port_array=("8040") + ;; *) replace_port_array=("") with_port_array=("") diff --git a/resources/pipeline/compose.yml b/resources/pipeline/compose.yml index ee190f198cce..7af3d5485969 100644 --- a/resources/pipeline/compose.yml +++ b/resources/pipeline/compose.yml @@ -15,7 +15,7 @@ services: container_name: audit.nais mem_limit: 16mb ports: - - 127.0.0.1:6514:6514 + - "127.0.0.1:6514:6514" oracle: image: $ORACLE_IMAGE container_name: oracle @@ -48,7 +48,7 @@ services: volumes: - ./postgres-init:/docker-entrypoint-initdb.d/ ports: - - 127.0.0.1:5432:5432 + - "127.0.0.1:5432:5432" healthcheck: test: [ "CMD-SHELL", "while ! /usr/bin/pg_isready -U admin -t 1; do sleep 1; done" ] interval: 2s @@ -78,13 +78,13 @@ services: volumes: - *sertifikat-volum ports: - - 127.0.0.1:8060:8060 - - 127.0.0.1:8063:8063 - - 127.0.0.1:8636:8636 - - 127.0.0.1:9093:9093 - - 127.0.0.1:9092:9092 - - 127.0.0.1:1337:1337 - - 127.0.0.1:8389:8389 + - "127.0.0.1:8060:8060" + - "127.0.0.1:8063:8063" + - "127.0.0.1:8636:8636" + - "127.0.0.1:9093:9093" + - "127.0.0.1:9092:9092" + - "127.0.0.1:1337:1337" + - "127.0.0.1:8389:8389" healthcheck: test: ["CMD", "wget", "--no-verbose","--tries=1", "--spider", "http://localhost:8060/rest/isReady"] interval: 5s @@ -113,7 +113,7 @@ services: volumes: - *sertifikat-volum ports: - - 127.0.0.1:8050:8080 + - "127.0.0.1:8050:8080" healthcheck: test: [ "CMD", "wget", "--no-verbose","--tries=1", "--spider", "http://localhost:8080/fptilgang/internal/health/isReady" ] interval: 5s @@ -135,7 +135,7 @@ services: volumes: - *sertifikat-volum ports: - - 127.0.0.1:8015:8080 + - "127.0.0.1:8015:8080" healthcheck: test: [ "CMD", "wget", "--no-verbose","--tries=1", "--spider", "http://localhost:8080/fpabakus/internal/health/isReady" ] interval: 5s @@ -159,7 +159,7 @@ services: volumes: - *sertifikat-volum ports: - - 127.0.0.1:8016:8080 + - "127.0.0.1:8016:8080" healthcheck: test: [ "CMD", "wget", "--no-verbose","--tries=1", "--spider", "http://localhost:8080/fpkalkulus/internal/health/isReady" ] interval: 5s @@ -188,7 +188,7 @@ services: volumes: - *sertifikat-volum ports: - - 127.0.0.1:8080:8080 + - "127.0.0.1:8080:8080" healthcheck: test: [ "CMD", "wget", "--no-verbose","--tries=1", "--spider", "http://localhost:8080/fpsak/internal/health/isReady" ] interval: 10s @@ -253,7 +253,7 @@ services: env_file: - *common-properties ports: - - 127.0.0.1:9090:9090 + - "127.0.0.1:9090:9090" depends_on: wonderwall-fpfrontend: condition: service_started @@ -278,7 +278,7 @@ services: --session.refresh=true --log-level=debug ports: - - 127.0.0.1:9000:9000 + - "127.0.0.1:9000:9000" env_file: - *common-properties fpfordel: @@ -295,7 +295,7 @@ services: - *sertifikat-volum - ./tokenx:/tokenx ports: - - 127.0.0.1:8090:8080 + - "127.0.0.1:8090:8080" healthcheck: test: [ "CMD", "wget", "--no-verbose","--tries=1", "--spider", "http://localhost:8080/fpfordel/internal/health/isReady" ] interval: 15s @@ -326,7 +326,7 @@ services: volumes: - *sertifikat-volum ports: - - 127.0.0.1:8010:8080 + - "127.0.0.1:8010:8080" healthcheck: test: [ "CMD", "wget", "--no-verbose","--tries=1", "--spider", "http://localhost:8080/fpformidling/internal/health/isReady" ] interval: 5s @@ -349,7 +349,7 @@ services: volumes: - *sertifikat-volum ports: - - 127.0.0.1:8291:8080 + - "127.0.0.1:8291:8080" healthcheck: test: [ "CMD", "wget", "--no-verbose","--tries=1", "--spider", "http://localhost:8080/actuator/info" ] interval: 5s @@ -366,7 +366,7 @@ services: volumes: - *sertifikat-volum ports: - - 127.0.0.1:8070:8080 + - "127.0.0.1:8070:8080" healthcheck: test: [ "CMD", "wget", "--no-verbose","--tries=1", "--spider", "http://localhost:8080/fpoppdrag/internal/health/isReady" ] interval: 5s @@ -400,7 +400,7 @@ services: volumes: - *sertifikat-volum ports: - - 127.0.0.1:8030:8080 + - "127.0.0.1:8030:8080" healthcheck: test: [ "CMD", "wget", "--no-verbose","--tries=1", "--spider", "http://localhost:8080/fptilbake/internal/health/isReady" ] interval: 5s @@ -426,7 +426,7 @@ services: volumes: - *sertifikat-volum ports: - - 127.0.0.1:8075:8080 + - "127.0.0.1:8075:8080" healthcheck: test: [ "CMD", "wget", "--no-verbose","--tries=1", "--spider", "http://localhost:8080/fprisk/internal/health/isReady" ] interval: 5s @@ -448,7 +448,7 @@ services: volumes: - *sertifikat-volum ports: - - 127.0.0.1:8065:8080 + - "127.0.0.1:8065:8080" healthcheck: test: [ "CMD", "wget", "--no-verbose","--tries=1", "--spider", "http://localhost:8080/fpabonnent/internal/health/isReady" ] interval: 5s @@ -474,7 +474,7 @@ services: volumes: - *sertifikat-volum ports: - - 127.0.0.1:8071:8080 + - "127.0.0.1:8071:8080" healthcheck: test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/fplos/internal/health/isReady"] interval: 5s @@ -514,7 +514,7 @@ services: volumes: - *sertifikat-volum ports: - - 127.0.0.1:8889:8080 + - "127.0.0.1:8889:8080" healthcheck: test: [ "CMD", "wget", "--no-verbose","--tries=1", "--spider", "http://localhost:8080/internal/health/isReady" ] interval: 15s @@ -558,7 +558,7 @@ services: - *sertifikat-volum - ./tokenx:/tokenx ports: - - 127.0.0.1:9001:9001 + - "127.0.0.1:9001:9001" healthcheck: test: [ "CMD", "wget", "--no-verbose","--tries=1", "--spider", "http://localhost:9001/api/actuator" ] interval: 5s @@ -567,6 +567,46 @@ services: depends_on: - vtp - fpfordel + fpinntektsmelding: + <<: *default-konfigurasjon + image: $FPINNTEKTSMELDING_IMAGE + container_name: fpinntektsmelding + mem_limit: 512mb + environment: + FPDOKGEN_URL: http://fpdokgen:8080 + ARBEIDSGIVER_NOTIFIKASJON_URL: http://fager-api:8080/api/graphql + ARBEIDSGIVER_NOTIFIKASJON_SCOPES: api://vtp.teamforeldrepenger.vtp/.default + ALTINN_URL: http://vtp:8060/rest/altinn-rettigheter-proxy/ekstern/altinn/api/serviceowner/reportees + env_file: + - *common-properties + - fpinntektsmelding_datasource.env + volumes: + - *sertifikat-volum + ports: + - "127.0.0.1:8040:8080" + healthcheck: + test: [ "CMD", "wget", "--no-verbose","--tries=1", "--spider", "http://localhost:8080/internal/health/isReady" ] + interval: 15s + timeout: 10s + retries: 10 + depends_on: + postgres: + condition: service_healthy + vtp: + condition: service_healthy + fager-api: + condition: service_healthy + + fager-api: + image: ghcr.io/navikt/arbeidsgiver-notifikasjon-produsent-api/fake-produsent-api:latest + ports: + - "127.0.0.1:8072:8080" + environment: + ALWAYS_SUCCESSFUL_RESPONSE: true + healthcheck: + test: [ "CMD", "curl", "-f", "http://localhost:8072/rest/isReady" ] + interval: 30s + timeout: 5s ## SELVBETJENING SPESIFIKK foreldrepengesoknad-api: @@ -586,7 +626,7 @@ services: - *sertifikat-volum - ./tokenx:/tokenx ports: - - 127.0.0.1:9002:9002 + - "127.0.0.1:9002:9002" healthcheck: test: [ "CMD", "wget", "--no-verbose","--tries=1", "--spider", "http://localhost:9002/internal/actuator" ] interval: 5s @@ -601,7 +641,7 @@ services: image: $FORELDREPENGEOVERSIKT_IMAGE container_name: foreldrepengeoversikt ports: - - 127.0.0.1:9066:9066 + - "127.0.0.1:9066:9066" env_file: - *common-properties environment: @@ -614,7 +654,7 @@ services: image: $FORELDREPENGESOKNAD_IMAGE container_name: foreldrepengesoknad ports: - - 127.0.0.1:9067:9067 + - "127.0.0.1:9067:9067" env_file: - *common-properties environment: @@ -628,7 +668,7 @@ services: image: $SVANGERSKAPSPENGESOKNAD_IMAGE container_name: svangerskapspengesoknad ports: - - 127.0.0.1:9068:9068 + - "127.0.0.1:9068:9068" env_file: - *common-properties environment: @@ -642,7 +682,7 @@ services: image: $ENGANGSSTONAD_IMAGE container_name: engangsstonad ports: - - 127.0.0.1:9069:9069 + - "127.0.0.1:9069:9069" env_file: - *common-properties environment: @@ -733,15 +773,27 @@ services: { "path": "/api", "scopes": "api://vtp.teamforeldrepenger.fpoversikt/swagger", - "url": "http://fpoversikt:8889", + "url": "http://fpoversikt:8080", "name": "fp-oversikt" + }, + { + "path": "/fpabakus/ekstern/api", + "scopes": "api://vtp.teamforeldrepenger.fpabakus/swagger", + "url": "http://fpabakus:8080", + "name": "fp-abakus ekstern API" + }, + { + "path": "/fpinntektsmelding/forvaltning/api", + "scopes": "api://vtp.teamforeldrepenger.fpinntektsmelding/swagger", + "url": "http://fpinntektsmelding:8080", + "name": "fp-inntektsmelding" } ] } env_file: - *common-properties ports: - - 127.0.0.1:9190:9190 + - "127.0.0.1:9190:9190" depends_on: fpswagger-wonderwall: condition: service_started @@ -757,18 +809,17 @@ services: --auto-login=true --log-level=debug ports: - - 127.0.0.1:9200:9200 + - "127.0.0.1:9200:9200" env_file: - *common-properties depends_on: fpsak: condition: service_started - redis: image: redis:7 container_name: redis ports: - - 127.0.0.1:6379:6379 + - "127.0.0.1:6379:6379" wonderwall-selvbetjening-sso-server: <<: *default-konfigurasjon image: ghcr.io/nais/wonderwall:latest @@ -788,7 +839,7 @@ services: --auto-login=true --log-level=debug ports: - - 127.0.0.1:9111:9111 + - "127.0.0.1:9111:9111" env_file: - *common-properties depends_on: @@ -812,7 +863,7 @@ services: --ingress=http://localhost:9100 --upstream-host=foreldrepengeoversikt:9066 ports: - - 127.0.0.1:9100:9100 + - "127.0.0.1:9100:9100" env_file: - *common-properties depends_on: @@ -837,7 +888,7 @@ services: --bind-address=0.0.0.0:9101 --upstream-host=foreldrepengesoknad:9067 ports: - - 127.0.0.1:9101:9101 + - "127.0.0.1:9101:9101" env_file: - *common-properties depends_on: @@ -862,7 +913,7 @@ services: --bind-address=0.0.0.0:9102 --upstream-host=svangerskapspengesoknad:9068 ports: - - 127.0.0.1:9102:9102 + - "127.0.0.1:9102:9102" env_file: - *common-properties depends_on: @@ -887,7 +938,7 @@ services: --bind-address=0.0.0.0:9103 --upstream-host=engangsstonad:9069 ports: - - 127.0.0.1:9103:9103 + - "127.0.0.1:9103:9103" env_file: - *common-properties depends_on: diff --git a/resources/pipeline/fpinfohistorikk_datasource.env b/resources/pipeline/fpinfohistorikk_datasource.env deleted file mode 100644 index 01423540ab0f..000000000000 --- a/resources/pipeline/fpinfohistorikk_datasource.env +++ /dev/null @@ -1,6 +0,0 @@ -APP_NAME=fpinfohistorikk -NAIS_APP_NAME=fpinfohistorikk - -DEFAULTDS_USERNAME=fpinfohistorikk -DEFAULTDS_PASSWORD=fpinfohistorikk -DEFAULTDS_URL=jdbc:postgresql://postgres:5432/fpinfohistorikk diff --git a/resources/pipeline/fpinntektsmelding_datasource.env b/resources/pipeline/fpinntektsmelding_datasource.env new file mode 100644 index 000000000000..49677f82c687 --- /dev/null +++ b/resources/pipeline/fpinntektsmelding_datasource.env @@ -0,0 +1,6 @@ +APP_NAME=fpinntektsmelding +NAIS_APP_NAME=fpinntektsmelding + +DB_JDBC_URL=jdbc:postgresql://postgres:5432/fpinntektsmelding?reWriteBatchedInserts=true +DB_USERNAME=fpinntektsmelding +DB_PASSWORD=fpinntektsmelding diff --git a/resources/pipeline/postgres-init/fpinntektsmelding.sql b/resources/pipeline/postgres-init/fpinntektsmelding.sql new file mode 100644 index 000000000000..c6e1e2ce1881 --- /dev/null +++ b/resources/pipeline/postgres-init/fpinntektsmelding.sql @@ -0,0 +1,11 @@ +CREATE DATABASE fpinntektsmelding_unit; +CREATE USER fpinntektsmelding_unit WITH PASSWORD 'fpinntektsmelding_unit'; +GRANT ALL ON DATABASE fpinntektsmelding_unit TO fpinntektsmelding_unit; +ALTER DATABASE fpinntektsmelding_unit SET timezone TO 'Europe/Oslo'; +ALTER DATABASE fpinntektsmelding_unit OWNER TO fpinntektsmelding_unit; + +CREATE DATABASE fpinntektsmelding; +CREATE USER fpinntektsmelding WITH PASSWORD 'fpinntektsmelding'; +GRANT ALL ON DATABASE fpinntektsmelding TO fpinntektsmelding; +ALTER DATABASE fpinntektsmelding SET timezone TO 'Europe/Oslo'; +ALTER DATABASE fpinntektsmelding OWNER TO fpinntektsmelding; diff --git a/resources/pipeline/update-versions.sh b/resources/pipeline/update-versions.sh index a8990340bbba..ffde81a408e9 100755 --- a/resources/pipeline/update-versions.sh +++ b/resources/pipeline/update-versions.sh @@ -39,6 +39,7 @@ echo ENGANGSSTONAD_IMAGE="$(imageVersion "europe-north1-docker.pkg.dev/nais-mana echo FPOVERSIKT_IMAGE="$(imageVersion "europe-north1-docker.pkg.dev/nais-management-233d/teamforeldrepenger/navikt/fp-oversikt")" >> .env echo FPSWAGGER_IMAGE="$(imageVersion "europe-north1-docker.pkg.dev/nais-management-233d/teamforeldrepenger/navikt/fp-swagger")" >> .env echo FPTILGANG_IMAGE="$(imageVersion "europe-north1-docker.pkg.dev/nais-management-233d/teamforeldrepenger/navikt/fp-tilgang")" >> .env +echo FPINNTEKTSMELDING_IMAGE="$(imageVersion "europe-north1-docker.pkg.dev/nais-management-233d/teamforeldrepenger/navikt/ft-inntektsmelding")" >> .env if [[ $(arch) == *'arm'* ]]; then