Skip to content

Commit

Permalink
Merge dependabot/npm_and_yarn/cypress-13.11.0 into combine-prs-branch
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Aug 13, 2024
2 parents 905f709 + ab0aff5 commit 519a318
Show file tree
Hide file tree
Showing 46 changed files with 597 additions and 343 deletions.
11 changes: 6 additions & 5 deletions .env.acceptance
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
REACT_APP_ENVIRONMENT=acceptance

REACT_APP_API_HOST=https://acc.api.wonen.zaken.amsterdam.nl/
REACT_APP_AUTH_URL="https://auth.grip-on-it.com/v2/rjsfm52t/oidc/idp/authorize?response_type=code&scope=openid&client_id=d3d664c7-bb33-4bf0-b7c9-b8bdf1199b76&redirect_uri=https%3A%2F%2Facc.wonen.zaken.amsterdam.nl%2Fauthentication%2Fcallback"
REACT_APP_API_HOST=https://api.wonen.zaken.woon-a.azure.amsterdam.nl/

# AZA
REACT_APP_AZA_FE=https://acc.wonen.zaken.amsterdam.nl/
REACT_APP_AZA_FE=https://wonen.zaken.woon-a.azure.amsterdam.nl/

# TON
REACT_APP_API_HOST_TON=https://acc.api.ton.amsterdam.nl/
REACT_APP_HOST_TON=https://acc.ton.amsterdam.nl/
REACT_APP_API_HOST_TON=https://api.ton.woon-a.azure.amsterdam.nl/
REACT_APP_HOST_TON=https://ton.woon-a.azure.amsterdam.nl/

# Keycloak
REACT_APP_AUTH_URL=https://acc.iam.amsterdam.nl/auth/
REACT_APP_KEYCLOAK_REALM=datapunt-ad-acc
REACT_APP_KEYCLOAK_CLIENT_ID=wonen-zaaksysteem-frontend

# Sentry
REACT_APP_SENTRY_PROJECT_NAME=zaken-frontend
Expand Down
7 changes: 6 additions & 1 deletion .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@
REACT_APP_API_HOST=http://localhost:8080/
REACT_APP_API_PATH=api/v1/

# Keycloak
REACT_APP_AUTH_URL=https://acc.iam.amsterdam.nl/auth/ # wonen-zaaksysteem-frontend client only exist for iam.amsterdam (prod)
REACT_APP_KEYCLOAK_CLIENT_ID=wonen-zaaksysteem-frontend
REACT_APP_KEYCLOAK_REALM=datapunt-ad-acc

# AZA
REACT_APP_AZA_FE=https://acc.wonen.zaken.amsterdam.nl/
REACT_APP_AZA_FE=http://localhost:2999/

# TON
REACT_APP_API_HOST_TON=https://acc.api.ton.amsterdam.nl/
Expand Down
3 changes: 2 additions & 1 deletion .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ REACT_APP_ENVIRONMENT=production

REACT_APP_API_HOST=https://api.wonen.zaken.amsterdam.nl/
REACT_APP_API_PATH=api/v1/
REACT_APP_AUTH_URL="https://auth.grip-on-it.com/v2/rjsfm52t/oidc/idp/authorize?response_type=code&scope=openid&client_id=65ba2077-9c90-4fcd-be2a-f7549e783bdc&redirect_uri=https%3A%2F%2Fwonen.zaken.amsterdam.nl%2Fauthentication%2Fcallback"
REACT_APP_AUTH_URL=https://iam.amsterdam.nl/auth/


# AZA
REACT_APP_AZA_FE=https://wonen.zaken.amsterdam.nl/
Expand Down
3 changes: 0 additions & 3 deletions .env.test

This file was deleted.

1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm run lint:fix
30 changes: 15 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,35 @@ ARG COMMIT_HASH

ENV DIR /var/www
COPY . $DIR/
RUN ls -la $DIR

# build dirs
RUN mkdir -p $DIR/builds/acceptance
RUN mkdir -p $DIR/builds/production
RUN mkdir -p $DIR/builds/application

WORKDIR $DIR

# install dependencies
COPY package*.json $DIR/
RUN npm ci --production --unsafe-perm --ignore-scripts .

# global variables
RUN echo "REACT_APP_GIT_COMMIT_HASH=$COMMIT_HASH" > .env.local
# RUN echo "REACT_APP_GIT_COMMIT_HASH=$COMMIT_HASH" > .env.local

# remove storybook files
RUN find src -type f -name "*.stories.tsx" -delete

# build production
RUN npm run build
RUN mv $DIR/build/* $DIR/builds/production/

# build acceptance
RUN npm run build:acc
RUN mv $DIR/build/* $DIR/builds/acceptance/
RUN mv $DIR/build/* $DIR/builds/application/

# Use the official Nginx image as the final stage
FROM nginx:stable-alpine

# Copy the nginx configuration
ADD nginx.conf /etc/nginx/nginx.conf

# Copy the build artifacts from the builder stage
COPY --from=builder /var/www/builds /var/www
COPY --from=builder /var/www/env.* /var/www
COPY --from=builder /var/www/package.json /var/www/package.json

COPY entrypoint.sh /entrypoint.sh

RUN chmod +x /entrypoint.sh

# Start nginx
ENTRYPOINT [ "/entrypoint.sh" ]
CMD nginx -g 'daemon off;'
47 changes: 47 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.PHONY: manifests deploy

dc = docker-compose

ENVIRONMENT ?= local
HELM_ARGS = manifests/chart \
-f manifests/values.yaml \
-f manifests/env/${ENVIRONMENT}.yaml \
--set image.tag=${VERSION}

REGISTRY ?= 127.0.0.1:5001
REPOSITORY ?= salmagundi/zaken-frontend
VERSION ?= latest

build:
$(dc) build

test:
echo "No tests available"

migrate:

push:
$(dc) push


manifests:
@helm template wonen-frontend $(HELM_ARGS) $(ARGS)

deploy: manifests
helm upgrade --install wonen-frontend $(HELM_ARGS) $(ARGS)

update-chart:
rm -rf manifests/chart
git clone --branch 1.5.2 --depth 1 git@github.com:Amsterdam/helm-application.git manifests/chart
rm -rf manifests/chart/.git

clean:
$(dc) down -v --remove-orphans

reset:
helm uninstall wonen-frontend

refresh: reset build push deploy

dev:
nohup kubycat kubycat-config.yaml > /dev/null 2>&1&
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: "3"
services:
zaken-frontend:
build:
context: .
dockerfile: Dockerfile
container_name: zaken-frontend
image: ${REGISTRY:-127.0.0.1:5001}/${REPOSITORY:-salmagundi/zaken-frontend}:${VERSION:-latest}
ports:
- "8081:8000"
21 changes: 21 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh

set -x

# This script will read all the env variables prefixed with REACT_APP on start of the container and write them to the env.js file
# The code uses this file as the env variables instead of the .env files
# This makes it possible to use a single build artifact/image for multiple environment

echo "window.env = {" >> /var/www/application/config/env.js

for var in $(printenv); do
if [[ $var == REACT_APP* ]]; then
key=$(echo $var | cut -f1 -d=)
value=$(echo $var | cut -f2 -d=)
echo " \"$key\": \"$value\"," >> /var/www/application/config/env.js
fi
done

echo "}" >> /var/www/application/config/env.js

exec "$@"
12 changes: 6 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@
<link rel="apple-touch-icon" href="%PUBLIC_URL%/apple-touch-icon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="%REACT_APP_PAGE_TITLE%"
/>
<meta name="description" content="%REACT_APP_PAGE_TITLE%" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<base href="/">
<title>%REACT_APP_PAGE_TITLE%</title>
<script type="module" src="src/index"></script></head>
<script type="module" src="src/index"></script>
<script src='/config/env.js'></script>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root">
Expand All @@ -26,11 +25,12 @@
if (elem != null) elem.style.display = "block";
}, 4000);
</script>

<!-- Usabilla Combicode for gemamsterdam, by support@usabilla.com -->
<!-- Begin Usabilla for Websites embed code -->
<script type="text/javascript">/*{literal}<![CDATA[*/window.lightningjs||function(c){function g(b,d){d&&(d+=(/\?/.test(d)?"&":"?")+"lv=1");c[b]||function(){var i=window,h=document,j=b,g=h.location.protocol,l="load",k=0;(function(){function b(){a.P(l);a.w=1;c[j]("_load")}c[j]=function(){function m(){m.id=e;return c[j].apply(m,arguments)}var b,e=++k;b=this&&this!=i?this.id||0:0;(a.s=a.s||[]).push([e,b,arguments]);m.then=function(b,c,h){var d=a.fh[e]=a.fh[e]||[],j=a.eh[e]=a.eh[e]||[],f=a.ph[e]=a.ph[e]||[];b&&d.push(b);c&&j.push(c);h&&f.push(h);return m};return m};var a=c[j]._={};a.fh={};a.eh={};a.ph={};a.l=d?d.replace(/^\/\//,(g=="https:"?g:"http:")+"//"):d;a.p={0:+new Date};a.P=function(b){a.p[b]=new Date-a.p[0]};a.w&&b();i.addEventListener?i.addEventListener(l,b,!1):i.attachEvent("on"+l,b);var q=function(){function b(){return["<head></head><",c,' onload="var d=',n,";d.getElementsByTagName('head')[0].",d,"(d.",g,"('script')).",i,"='",a.l,"'\"></",c,">"].join("")}var c="body",e=h[c];if(!e)return setTimeout(q,100);a.P(1);var d="appendChild",g="createElement",i="src",k=h[g]("div"),l=k[d](h[g]("div")),f=h[g]("iframe"),n="document",p;k.style.display="none";e.insertBefore(k,e.firstChild).id=o+"-"+j;f.frameBorder="0";f.id=o+"-frame-"+j;/MSIE[ ]+6/.test(navigator.userAgent)&&(f[i]="javascript:false");f.allowTransparency="true";l[d](f);try{f.contentWindow[n].open()}catch(s){a.domain=h.domain,p="javascript:var d="+n+".open();d.domain='"+h.domain+"';",f[i]=p+"void(0);"}try{var r=f.contentWindow[n];r.write(b());r.close()}catch(t) {
f[i]=p+'d.write("'+b().replace(/"/g,String.fromCharCode(92)+'"')+'");d.close();'}a.P(2)};
a.l&&setTimeout(q,0)})()}();c[b].lv="1";return c[b]}var o="lightningjs",k=window[o]=g(o);k.require=g;k.modules=c}({}); if(!navigator.userAgent.match(/Android|BlackBerry|BB10|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {window.usabilla_live = lightningjs.require("usabilla_live", "//w.usabilla.com/89a13f9847d9.js"); } else {window.usabilla_live = lightningjs.require("usabilla_live", "//w.usabilla.com/0ac2b0b0c0a0.js"); }/*]]>{/literal}*/</script>
</body>
</html>


33 changes: 1 addition & 32 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,7 @@ events {
http {
include mime.types;

# Acceptance

server {
server_name acc.wonen.zaken.amsterdam.nl;

listen 8000;

gzip on;
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml;

location / {

if ($request_method != GET) {
return 405;
}

gzip_static on;

root /var/www/acceptance;

try_files $uri /index.html;

location /static/ {
expires max;
}
}
}

# Production

server {
server_name wonen.zaken.amsterdam.nl;

listen 8000;

Expand All @@ -51,7 +20,7 @@ http {

gzip_static on;

root /var/www/production;
root /var/www/application;

try_files $uri /index.html;

Expand Down
Loading

0 comments on commit 519a318

Please sign in to comment.