Skip to content

Commit

Permalink
Merge branch 'main' into MIJN-6651-release
Browse files Browse the repository at this point in the history
  • Loading branch information
janthijs authored Nov 7, 2023
2 parents fc2031f + 0c69c91 commit b090cf1
Show file tree
Hide file tree
Showing 88 changed files with 9,523 additions and 6,209 deletions.
3 changes: 3 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ REACT_APP_ANALYTICS_ID

# BFF Variables referenced through process.env.

# Base url of api
BFF_API_BASE_URL

# SQLITE Database file
BFF_DB_FILE

Expand Down
12 changes: 6 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

version: 2
updates:
- package-ecosystem: "Docker"
directory: "/"
- package-ecosystem: 'docker'
directory: '/'
schedule:
interval: "weekly"
- package-ecosystem: "npm"
directory: "/"
interval: 'weekly'
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: "weekly"
interval: 'weekly'
71 changes: 0 additions & 71 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ WORKDIR /build-space
COPY package-lock.json /build-space/
COPY package.json /build-space/
COPY vite.config.ts /build-space/
COPY vendor /build-space/vendor

# Install the dependencies
RUN npm ci --prefer-offline --no-audit --progress=false
Expand Down Expand Up @@ -94,12 +95,15 @@ WORKDIR /app
ARG MA_FRONTEND_HOST=mijn.amsterdam.nl
ENV MA_FRONTEND_HOST=$MA_FRONTEND_HOST

ARG MA_API_HOST=$MA_FRONTEND_HOST
ENV MA_API_HOST=$MA_API_HOST

# forward request and error logs to docker log collector
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log

COPY conf/nginx-server-default.template.conf /tmp/nginx-server-default.template.conf
RUN envsubst '${MA_FRONTEND_HOST}' < /tmp/nginx-server-default.template.conf > /etc/nginx/conf.d/default.conf
RUN envsubst '${MA_FRONTEND_HOST},${MA_API_HOST}' < /tmp/nginx-server-default.template.conf > /etc/nginx/conf.d/default.conf
COPY conf/nginx.conf /etc/nginx/nginx.conf

# Copy the built application files to the current image
Expand Down Expand Up @@ -153,6 +157,7 @@ RUN chmod u+x /usr/local/bin/docker-entrypoint-bff.sh
COPY --from=build-app-bff /build-space/build-bff /app/build-bff
COPY --from=build-app-bff /build-space/node_modules /app/node_modules
COPY --from=build-app-bff /build-space/package.json /app/package.json
COPY --from=build-app-bff /build-space/vendor /app/vendor
COPY src/server/views /app/build-bff/server/views

# Run the app
Expand Down
17 changes: 13 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ pipeline {
MA_FRONTEND_HOST_ACC = "acc.mijn.amsterdam.nl"
MA_FRONTEND_HOST_PROD = "mijn.amsterdam.nl"

MA_API_HOST_ACC = "acc.mijn-bff.amsterdam.nl"
MA_API_HOST_PROD = "mijn-bff.amsterdam.nl"

REACT_APP_BFF_API_URL_ACC = "https://acc.mijn-bff.amsterdam.nl/api/v1"
REACT_APP_BFF_API_URL_PROD = "https://mijn-bff.amsterdam.nl/api/v1"

Expand Down Expand Up @@ -160,9 +163,11 @@ pipeline {
sh "docker build -t ${IMAGE_ACCEPTANCE} " +
"--build-arg MA_OTAP_ENV=acceptance " +
"--build-arg MA_FRONTEND_HOST=${MA_FRONTEND_HOST_ACC} " +
"--build-arg MA_API_HOST=${MA_API_HOST_ACC} " +
"--build-arg MA_BUILD_ID=${BUILD_NUMBER} " +
"--build-arg MA_GIT_SHA=${COMMIT_HASH} " +
"--build-arg REACT_APP_BFF_API_URL=${REACT_APP_BFF_API_URL_ACC} " +
"--build-arg REACT_APP_SENTRY_DSN=${REACT_APP_SENTRY_DSN} " +
"--target=deploy-frontend " +
"--shm-size 1G " +
"."
Expand Down Expand Up @@ -204,15 +209,20 @@ pipeline {
steps {
script { currentBuild.displayName = "PROD:Build:#${BUILD_NUMBER}" }

// Build the FE production image
// build the Front-end/nginx image
sh "docker build -t ${IMAGE_PRODUCTION} " +
"--build-arg MA_FRONTEND_URL=${MA_FRONTEND_URL_PROD} " +
"--build-arg MA_OTAP_ENV=production " +
"--build-arg MA_FRONTEND_HOST=${MA_FRONTEND_HOST_PROD} " +
"--build-arg MA_API_HOST=${MA_API_HOST_PROD} " +
"--build-arg MA_BUILD_ID=${BUILD_NUMBER} " +
"--build-arg MA_FRONTEND_URL=${MA_FRONTEND_URL_PROD} " +
"--build-arg MA_GIT_SHA=${COMMIT_HASH} " +
"--build-arg MA_OTAP_ENV=production " +
"--build-arg REACT_APP_BFF_API_URL=${REACT_APP_BFF_API_URL_PROD} " +
"--build-arg REACT_APP_SENTRY_DSN=${REACT_APP_SENTRY_DSN} " +
"--target=deploy-production-frontend " +
"--shm-size 1G " +
"."

sh "docker push ${IMAGE_PRODUCTION}"

// Build the BFF production image
Expand All @@ -221,7 +231,6 @@ pipeline {
"--build-arg MA_BUILD_ID=${BUILD_NUMBER} " +
"--build-arg MA_GIT_SHA=${COMMIT_HASH} " +
"--build-arg MA_OTAP_ENV=production " +
"--build-arg REACT_APP_BFF_API_URL=${REACT_APP_BFF_API_URL_PROD} " +
"--target=deploy-bff " +
"--shm-size 1G " +
"."
Expand Down
6 changes: 6 additions & 0 deletions azure-pipeline-bff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ trigger:
include:
- ontwikkelen
- testen
- main
paths:
include:
- src/server
Expand Down Expand Up @@ -56,12 +57,17 @@ variables:
- ${{ if or(eq(variables['Build.SourceBranchName'], 'testen'), eq(variables['Build.Reason'], 'PullRequest')) }}:
- name: dtapName
value: t
- ${{ if eq(variables['Build.SourceBranchName'], 'az-acceptance') }}:
- name: dtapName
value: a
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
- name: btdDeploy
value: false
- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
- name: btdDeploy
value: ${{ parameters.btdDeploy }}
- name: dtapName
value: t

jobs:
- template: pipelines/jobs/apps/btd-frontend.yaml@MamsInfra
Expand Down
8 changes: 7 additions & 1 deletion azure-pipeline-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ trigger:
include:
- ontwikkelen
- testen
- main
paths:
include:
- src/client
Expand All @@ -24,7 +25,7 @@ pr:
- public
- Dockerfile
- package.json
- package-lock.json-bff
- package-lock.json
branches:
include:
- main
Expand Down Expand Up @@ -58,12 +59,17 @@ variables:
- ${{ if or(eq(variables['Build.SourceBranchName'], 'testen'), eq(variables['Build.Reason'], 'PullRequest')) }}:
- name: dtapName
value: t
- ${{ if eq(variables['Build.SourceBranchName'], 'az-acceptance') }}:
- name: dtapName
value: a
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
- name: btdDeploy
value: false
- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
- name: btdDeploy
value: ${{ parameters.btdDeploy }}
- name: dtapName
value: t

jobs:
- template: pipelines/jobs/apps/btd-frontend.yaml@MamsInfra
Expand Down
7 changes: 5 additions & 2 deletions azure-pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ parameters:
- none
- o
- t
# - a
# - p
- a
- p

- name: updateAppSettings
type: boolean
Expand All @@ -47,6 +47,9 @@ variables:
- ${{ if and(or(eq(variables['Build.SourceBranchName'], 'testen'), eq(variables['Build.Reason'], 'PullRequest')), eq(parameters.dtapName, 'none')) }}:
- name: dtapName
value: t
- ${{ if and(eq(variables['Build.SourceBranchName'], 'az-acceptance'), eq(parameters.dtapName, 'none')) }}:
- name: dtapName
value: a
- ${{ if ne(parameters.dtapName, 'none') }}:
- name: dtapName
value: ${{ parameters.dtapName }}
Expand Down
5 changes: 3 additions & 2 deletions conf/nginx-server-default.template.conf
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ server {

root /usr/share/nginx/html;
set $target_host $MA_FRONTEND_HOST;
set $api_host $MA_API_HOST;

# Note: prolly better to put this in env somewhere
set $mams_bff_login "https://$target_host/api/v1/auth/digid/login";
set $mams_bff_login_eh "https://$target_host/api/v1/auth/eherkenning/login";
set $mams_bff_login "https://$api_host/api/v1/auth/digid/login";
set $mams_bff_login_eh "https://$api_host/api/v1/auth/eherkenning/login";

location /api/login {
if ($host = $target_host) {
Expand Down
24 changes: 0 additions & 24 deletions docker-compose.yml

This file was deleted.

Loading

0 comments on commit b090cf1

Please sign in to comment.