Skip to content

Commit

Permalink
Skall for app for aggregering av opplysninger om arbeidssøker
Browse files Browse the repository at this point in the history
  • Loading branch information
naviktthomas committed Jul 10, 2024
1 parent 9423699 commit 79bb31b
Show file tree
Hide file tree
Showing 56 changed files with 1,640 additions and 27 deletions.
28 changes: 17 additions & 11 deletions .github/workflows/api-start-stopp.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
name: Api Start stopp
on:
push:
paths:
- 'apps/api-start-stopp-perioder/**'
- 'domain/**'
- 'lib/**'
- '.github/workflows/api-start-stopp.yml'
- 'gradle/**'
- 'settings.gradle.kts'
- 'gradle.properties'
- 'gradlew'
push:
branches:
- main
- dev/*
paths:
- 'apps/api-start-stopp-perioder/**'
- 'domain/**'
- 'lib/**'
- '.github/workflows/api-start-stopp.yml'
- 'gradle/**'
- 'settings.gradle.kts'
- 'gradle.properties'
- 'gradlew'

env:
IMAGE: europe-north1-docker.pkg.dev/${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}/paw/paw-arbeidssokerregisteret-api-inngang
Expand Down Expand Up @@ -50,7 +53,9 @@ jobs:
uses: nais/[email protected]
with:
image_ref: ${{ env.IMAGE }}@${{ env.DIGEST }}

deploy-dev:
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/dev')
name: Deploy to dev-gcp - API Start Stopp
needs: build
runs-on: ubuntu-latest
Expand All @@ -64,10 +69,11 @@ jobs:
CLUSTER: dev-gcp
RESOURCE: apps/api-start-stopp-perioder/nais/nais-dev.yaml
VAR: image=${{ needs.build.outputs.image }}

deploy-prod:
if: github.ref == 'refs/heads/main'
name: Deploy to prod-gcp - API Start Stopp
needs: [build, deploy-dev]
needs: [ build, deploy-dev ]
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/hendelselogg-backup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Hendelselogg-backup

on:
push:
branches:
- main
- dev/*
paths:
- 'apps/hendelselogg-backup/**'
- 'lib/**'
Expand All @@ -11,6 +14,7 @@ on:
- 'settings.gradle.kts'
- 'gradle.properties'
- 'gradlew'

env:
IMAGE: europe-north1-docker.pkg.dev/${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}/paw/paw-arbeidssoekerregisteret-hendelselogg-backup
jobs:
Expand Down Expand Up @@ -53,6 +57,7 @@ jobs:
image_ref: ${{ env.IMAGE }}@${{ env.DIGEST }}

deploy-dev:
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/dev')
name: Deploy to dev-gcp
needs: build
runs-on: ubuntu-latest
Expand All @@ -70,7 +75,7 @@ jobs:
deploy-prod:
if: github.ref == 'refs/heads/main'
name: Deploy to prod-gcp
needs: [build, deploy-dev]
needs: [ build, deploy-dev ]
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/hendelseprosessor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Hendelseprosessor

on:
push:
branches:
- main
- dev/*
paths:
- 'apps/hendelseprosessor/**'
- 'lib/**'
Expand All @@ -11,6 +14,7 @@ on:
- 'settings.gradle.kts'
- 'gradle.properties'
- 'gradlew'

env:
IMAGE: europe-north1-docker.pkg.dev/${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}/paw/paw-arbeidssokerregisteret-event-prosessor
jobs:
Expand Down Expand Up @@ -51,7 +55,9 @@ jobs:
uses: nais/[email protected]
with:
image_ref: ${{ env.IMAGE }}@${{ env.DIGEST }}

deploy-dev:
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/dev')
name: Deploy to dev-gcp
needs: build
runs-on: ubuntu-latest
Expand All @@ -69,7 +75,7 @@ jobs:
deploy-prod:
if: github.ref == 'refs/heads/main'
name: Deploy to prod-gcp
needs: [build, deploy-dev]
needs: [ build, deploy-dev ]
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down
98 changes: 98 additions & 0 deletions .github/workflows/opplysninger-aggregering.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Build, push, and deploy - paw-arbeidssoeker-opplysninger-aggregering

on:
push:
branches:
- main
- dev/*
paths:
- 'apps/opplysninger-aggregering/**'
- 'lib/**'
- 'domain/**'
- '.github/workflows/opplysninger-aggregering.yaml'
- 'gradle/**'
- 'settings.gradle.kts'
- 'gradle.properties'
- 'gradlew'

env:
IMAGE: europe-north1-docker.pkg.dev/${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}/paw/paw-arbeidssoeker-opplysninger-aggregering
jobs:
build:
name: Build and push Docker container
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
packages: write
outputs:
image: ${{ steps.docker-build-push.outputs.image }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: 21
distribution: temurin
cache: gradle
- name: Specify module
run: echo "MODULE=:apps:opplysninger-aggregering" >> $GITHUB_ENV
- name: Specify version
run: echo "VERSION=$(date +'%y.%m.%d').${{ github.run_number }}-${{ github.run_attempt }}" >> $GITHUB_ENV
- name: Login GAR
uses: nais/login@v0
with:
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
team: paw
- name: Build with Gradle
id: docker-build-push
working-directory: ./
run: |
echo "image=${{ env.IMAGE }}:${{ env.VERSION }}" >> $GITHUB_OUTPUT
./gradlew -Pversion=${{ env.VERSION }} -Pimage=${{ env.IMAGE }} ${{ env.MODULE }}:build ${{ env.MODULE }}:test ${{ env.MODULE }}:jib
echo "DIGEST=$(cat ./apps/opplysninger-aggregering/build/jib-image.digest)" >> $GITHUB_ENV
env:
ORG_GRADLE_PROJECT_githubPassword: ${{ secrets.GITHUB_TOKEN }}
- name: Attest and sign
uses: nais/[email protected]
with:
image_ref: ${{ env.IMAGE }}@${{ env.DIGEST }}

deploy-dev:
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/dev')
name: Deploy to dev-gcp
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Deploy
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: dev-gcp
RESOURCE: ./apps/opplysninger-aggregering/nais/nais-dev.yaml
VAR: image=${{ needs.build.outputs.image }},kafka=nav-dev

deploy-prod:
if: github.ref == 'refs/heads/main'
name: Deploy to prod-gcp
needs: [build, deploy-dev]
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Deploy
uses: nais/deploy/actions/deploy@v2
env:
TEAM: paw
CLUSTER: prod-gcp
RESOURCE: ./apps/opplysninger-aggregering/nais/nais-prod.yaml
VAR: image=${{ needs.build.outputs.image }},kafka=nav-prod
8 changes: 7 additions & 1 deletion .github/workflows/utgang-formidlingsgruppe-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Formidlingsgruppe - Utgang

on:
push:
branches:
- main
- dev/*
paths:
- 'apps/utgang-formidlingsgruppe/**'
- 'lib/**'
Expand Down Expand Up @@ -55,7 +58,9 @@ jobs:
uses: nais/[email protected]
with:
image_ref: ${{ env.IMAGE }}@${{ env.DIGEST }}

deploy-dev:
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/dev')
name: Deploy to dev-gcp
permissions:
contents: read
Expand All @@ -69,13 +74,14 @@ jobs:
CLUSTER: dev-gcp
RESOURCE: apps/utgang-formidlingsgruppe/nais/nais-dev.yaml
VAR: image=${{ needs.build.outputs.image }},kafka=nav-dev

deploy-prod:
if: github.ref == 'refs/heads/main'
name: Deploy to prod-gcp
permissions:
contents: read
id-token: write
needs: [deploy-dev,build]
needs: [ deploy-dev,build ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/utgang-pdl-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: PDL - Utgang

on:
push:
branches:
- main
- dev/*
paths:
- 'apps/utgang-pdl/**'
- '.github/workflows/utgang-pdl-deploy.yaml'
Expand Down Expand Up @@ -55,7 +58,9 @@ jobs:
uses: nais/[email protected]
with:
image_ref: ${{ env.IMAGE }}@${{ env.DIGEST }}

deploy-dev:
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/dev')
name: Deploy to dev-gcp
permissions:
contents: read
Expand All @@ -69,6 +74,7 @@ jobs:
CLUSTER: dev-gcp
RESOURCE: apps/utgang-pdl/nais/nais-dev.yaml
VAR: image=${{ needs.build.outputs.image }},kafka=nav-dev

deploy-prod:
if: github.ref == 'refs/heads/main'
name: Deploy to prod-gcp
Expand All @@ -83,4 +89,4 @@ jobs:
env:
CLUSTER: prod-gcp
RESOURCE: apps/utgang-pdl/nais/nais-prod.yaml
VAR: image=${{ needs.build.outputs.image }},kafka=nav-prod
VAR: image=${{ needs.build.outputs.image }},kafka=nav-prod
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
package no.nav.paw.arbeidssoekerregisteret.backup.brukerstoette

import com.fasterxml.jackson.databind.SerializationFeature
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule
import com.fasterxml.jackson.module.kotlin.registerKotlinModule
import io.ktor.client.*
import io.ktor.client.plugins.contentnegotiation.*
import io.ktor.serialization.jackson.*
import io.ktor.client.HttpClient
import io.ktor.client.plugins.contentnegotiation.ContentNegotiation
import io.ktor.serialization.jackson.jackson
import no.nav.common.token_client.client.AzureAdMachineToMachineTokenClient
import no.nav.paw.config.env.currentNaisEnv
import no.nav.paw.config.hoplite.loadNaisOrLocalConfiguration
import no.nav.paw.kafkakeygenerator.auth.AzureM2MConfig
import no.nav.paw.kafkakeygenerator.auth.azureAdM2MTokenClient
import no.nav.paw.kafkakeygenerator.auth.currentNaisEnv
import no.nav.paw.kafkakeygenerator.client.KafkaKeysClient
import no.nav.paw.kafkakeygenerator.client.createKafkaKeyGeneratorClient

Expand Down
2 changes: 2 additions & 0 deletions apps/opplysninger-aggregering/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# PAW Arbeidssoeker Opplysninger Aggregering

Loading

0 comments on commit 79bb31b

Please sign in to comment.