Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy Q2 til dev-gcp #2145

Merged
merged 25 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
60d1583
legg til handling per tema for fullmakter
LudvigHz Jun 7, 2024
1d4569f
Fjerne ubrukt import
LudvigHz Jun 7, 2024
82d0f18
Deploy Q2 til dev-gcp
LudvigHz Apr 24, 2024
4896127
Bruk ny syntaks for unleash
LudvigHz Apr 30, 2024
18035f9
Bruk node dockerfil for self-signed CA støtte
LudvigHz May 2, 2024
54ba2e1
Midlertidig skru av unleash i proxy
LudvigHz May 2, 2024
0709aff
API i q1 har /modiapersonoversikt-api som context
LudvigHz May 2, 2024
ae95e13
Midlertidig build-time override av url til draft
LudvigHz May 2, 2024
39938f7
Separer configurasjon for gcp
LudvigHz May 3, 2024
4763a2b
Bruk en plugin for å skille html mellom prod og gcp
LudvigHz May 3, 2024
9424a1f
Legg til azure-token-generator i inbound access
LudvigHz May 14, 2024
2bffbd6
Ikke autologin på /proxy
LudvigHz May 14, 2024
99cf0d9
Bruk faro til frontend observability
LudvigHz May 24, 2024
59fc518
Fjerne sentry
LudvigHz May 24, 2024
c4002a0
Legge til manglende komma
LudvigHz May 28, 2024
fc4505f
Fjern verbose logging på faro
LudvigHz May 28, 2024
1e376c9
Bruk ny path til skrivestotte i gcp
LudvigHz May 28, 2024
41034a9
Oppdtater proxy url for draft
LudvigHz Jun 5, 2024
9e046ae
Formater med prettier & fiks litt bugs
LudvigHz Jun 7, 2024
4470b6c
Bruk riktig url for innstillinger
LudvigHz Jun 10, 2024
63b4095
Riktig url til draft i gcp
LudvigHz Jun 11, 2024
4bf0638
Bruk bun docker bilde og oppdater CSP
LudvigHz Jun 12, 2024
44d08aa
Oppgrader til modia-frontend 0.12
LudvigHz Jun 12, 2024
ad86f2e
Bruk funksjoner i siste modia-login
LudvigHz Jun 13, 2024
78b0ded
Separer gcp og fss bygg litt mer
LudvigHz Jun 13, 2024
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
8 changes: 8 additions & 0 deletions .env.gcp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
VITE_MOCK_ENABLED=false
VITE_USE_HASH_ROUTER=false
VITE_HODE_URL_V2=https://cdn.nav.no/personoversikt/internarbeidsflate-decorator-v3
SKIP_PREFLIGHT_CHECK=true
VITE_AMPLITUDE_API_KEY=4b7349a378cfc18faf21e1fe6bea0cf2
VITE_AMPLITUDE_API_KEY_DEV=716ce898b7143ffd7ff3e52dfe69bae7

VITE_DRAFT_URL_WS=wss://modiapersonoversikt-draft.intern.dev.nav.no
56 changes: 56 additions & 0 deletions .github/workflows/gcp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build & deploy to GCP

on: [push]

env:
CI: true
TZ: Europe/Oslo

jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
id-token: write
outputs:
image: ${{ steps.docker-build-push.outputs.image }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Test
run: npm run test
- name: Build
run: npm run build:gcp
- name: Publish Docker image
if: github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/gcp' # || github.ref = 'refs/heads/master'
uses: nais/docker-build-push@v0
id: docker-build-push
with:
dockerfile: Dockerfile.gcp
team: personoversikt
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}

deploy-dev:
name: Deploy to dev-gcp
needs: build
if: github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/gcp'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: nais/deploy/actions/deploy@v2
env:
PRINT_PAYLOAD: true
CLUSTER: dev-gcp
RESOURCE: .nais/dev.yaml
VAR: version=${{ github.sha }},image=${{ needs.build.outputs.image }}
12 changes: 1 addition & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ name: Build, push, and deploy
on: [push]

env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
CI: true
TZ: Europe/Oslo
Q1_TEST_BRANCH: refs/heads/branch_name

jobs:
build:
Expand All @@ -33,21 +31,13 @@ jobs:
- name: Build
run: npm run build
- name: Publish Docker image
if: github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/master' || github.ref == env.Q1_TEST_BRANCH
if: github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/master'
uses: nais/docker-build-push@v0
id: docker-build-push
with:
team: personoversikt
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
- name: Deploy to Q1 (Test branch)
uses: nais/deploy/actions/deploy@v2
if: github.ref == env.Q1_TEST_BRANCH
env:
PRINT_PAYLOAD: true
CLUSTER: dev-fss
RESOURCE: .nais/qa-template.yaml
VAR: q_env=q1,version=${{ github.sha }},image=${{ steps.docker-build-push.outputs.image }}

deploy-qa:
name: Deploy to preprod
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/unleash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,22 @@ jobs:
CLUSTER: dev-fss
RESOURCE: .nais/unleash/unleash-apitoken-preprod.yaml

deploy-unleash-api-token-to-dev-gcp:
if: github.ref == 'refs/heads/gcp'
name: Deploy unleash api-token to dev-gcp
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Deploy unleash api token
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: dev-gcp
RESOURCE: .nais/unleash/unleash-apitoken-preprod.yaml

deploy-unleash-api-token-to-prod:
if: github.ref == 'refs/heads/master'
name: Deploy unleash api-token to prod-fss
Expand All @@ -35,4 +51,4 @@ jobs:
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: prod-fss
RESOURCE: .nais/unleash/unleash-apitoken-prod.yaml
RESOURCE: .nais/unleash/unleash-apitoken-prod.yaml
81 changes: 81 additions & 0 deletions .nais/dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
apiVersion: "nais.io/v1alpha1"
kind: "Application"
metadata:
name: modiapersonoversikt
namespace: personoversikt
labels:
team: personoversikt
annotations:
nginx.ingress.kubernetes.io/proxy-buffer-size: "8k"
spec:
image: "{{image}}"
port: 3000
webproxy: true
liveness:
path: /internal/liveness
initialDelay: 20
readiness:
path: /internal/readiness
initialDelay: 20
prometheus:
enabled: false
path: /internal/metrics
secureLogs:
enabled: true
resources:
requests:
cpu: 200m
memory: 512Mi
limits:
cpu: 3000m
memory: 1536Mi
ingresses:
- https://modiapersonoversikt.intern.dev.nav.no
replicas:
min: 2
max: 4
cpuThresholdPercentage: 60
azure:
application:
enabled: true
tenant: trygdeetaten.no
allowAllUsers: false
claims:
groups:
- id: "67a06857-0028-4a90-bf4c-9c9a92c7d733" # 0000-GA-BD06_ModiaGenerellTilgang
sidecar:
enabled: true
autoLogin: true
autoLoginIgnorePaths:
- /internal/*
- /proxy/**
accessPolicy:
inbound:
rules:
- application: azure-token-generator
namespace: aura
cluster: dev-gcp
outbound:
rules:
- application: modiapersonoversikt-innstillinger
- application: modiapersonoversikt-skrivestotte
- application: modiapersonoversikt-draft
- application: modiacontextholder
external:
- host: personoversikt-unleash-api.nav.cloud.nais.io
- host: modiapersonoversikt-api-q1.dev-fss-pub.nais.io
envFrom:
- secret: modiapersonoversikt-unleash-api-token
env:
- name: APP_NAME
value: "modiapersonoversikt"
- name: APP_VERSION
value: "{{ version }}"
- name: REFERRER_POLICY
value: "no-referrer"
- name: APP_ENVIRONMENT_NAME
value: q2
- name: ENVIRONMENT
value: ${APP_ENVIRONMENT_NAME}
- name: UNLEASH_ENVIRONMENT
value: "development"
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM europe-north1-docker.pkg.dev/nais-management-233d/personoversikt/modialogin:2024.06.05-09.00-e08afd9
FROM europe-north1-docker.pkg.dev/nais-management-233d/personoversikt/modialogin:2024.01.04-09.48-46cd9d7
ADD proxy-config.json /proxy-config.json
ADD preprod-proxy-config.json /preprod-proxy-config.json
COPY build /www
6 changes: 6 additions & 0 deletions Dockerfile.gcp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM europe-north1-docker.pkg.dev/nais-management-233d/personoversikt/modia-frontend:0.12
ADD proxy-config-q2.json proxy-config.json
COPY build ./static

ENV STATIC_FILES_DIR=./static
ENV BASE_PATH=/
27 changes: 0 additions & 27 deletions Dockerfile_heroku

This file was deleted.

45 changes: 45 additions & 0 deletions index-gcp.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!DOCTYPE html>
<html lang="no" data-hj-suppress>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#222222">
<meta name="author" content="NAV">
<meta property="og:title" content="Modia Personoversikt">
<meta property="og:site_name" content="NAV Modia Personoversikt">
<meta property="og:description"
content="Intern arbeidsflate. Brukes som personoppslag og dialogverktøy av veiledere og saksbehandlere i NAV">
<link rel="shortcut icon" href="./favicon.ico">

<slot not-environment="production">
<script src="%VITE_HODE_URL_V2%/dev/latest/dist/bundle.js"></script>
<link rel="stylesheet" href="%VITE_HODE_URL_V2%/dev/latest/dist/index.css" />
</slot>
<slot environment="production">
<script src="%VITE_HODE_URL_V2%/prod/latest/dist/bundle.js"></script>
<link rel="stylesheet" href="%VITE_HODE_URL_V2%/prod/latest/dist/index.css" />
</slot>

<script unleash toggles="modiapersonoversikt.enable-faro">
const applicationFeatureToggles = {
enableFaro: unleash && unleash["modiapersonoversikt_enable-faro"]
};
window.applicationFeatureToggles = applicationFeatureToggles;
</script>

<script type="application/javascript">
const global = globalThis;
</script>

<script type="module" src="/src/index.tsx"></script>

<title>Modia Personoversikt</title>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>

</body>
</html>
Loading
Loading