Commit d421ab3b authored by Gary van Woerkens's avatar Gary van Woerkens
Browse files

fix: Add preprod and prod workflows test.

parent fe712f15
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`generate k8s manifests 1`] = `
exports[`generate development k8s manifests 1`] = `
"---
apiVersion: v1
kind: Namespace
......@@ -429,3 +429,674 @@ metadata:
namespace: carnets-mybranch
"
`;
exports[`generate preproduction k8s manifests 1`] = `
"---
apiVersion: v1
kind: Namespace
metadata:
annotations:
socialgouv/creator: autodevops
field.cattle.io/creatorId: gitlab
field.cattle.io/projectId: ''
git/branch: refs/heads/mybranch
git/remote: socialgouv/carnets
app.github.com/job: '5678'
app.github.com/ref: refs/heads/mybranch
app.github.com/repo: socialgouv/carnets
app.github.com/run: '1234'
app.github.com/sha: '0123456'
labels:
azure-pg-admin-user: carnets
application: carnets
owner: carnets
team: carnets
cert: wildcard
name: carnets-preprod
---
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
kapp.k14s.io/disable-default-ownership-label-rules: ''
kapp.k14s.io/disable-default-label-scoping-rules: ''
app.github.com/job: '5678'
app.github.com/ref: refs/heads/mybranch
app.github.com/repo: socialgouv/carnets
app.github.com/run: '1234'
app.github.com/sha: '0123456'
labels:
app: carnets
application: carnets
owner: carnets
team: carnets
cert: wildcard
name: carnets
namespace: carnets-preprod
spec:
replicas: 1
selector:
matchLabels:
app: carnets
template:
metadata:
annotations:
kapp.k14s.io/disable-default-ownership-label-rules: ''
kapp.k14s.io/disable-default-label-scoping-rules: ''
app.github.com/job: '5678'
app.github.com/ref: refs/heads/mybranch
app.github.com/repo: socialgouv/carnets
app.github.com/run: '1234'
app.github.com/sha: '0123456'
labels:
app: carnets
application: carnets
owner: carnets
team: carnets
cert: wildcard
spec:
containers:
- image: >-
ghcr.io/socialgouv/fabrique/carnets:sha-0123456789abcdefghijklmnopqrstuvwxyz0123
livenessProbe:
failureThreshold: 6
httpGet:
path: /api/healthz
port: http
initialDelaySeconds: 30
periodSeconds: 15
timeoutSeconds: 5
name: carnets
ports:
- containerPort: 3000
name: http
readinessProbe:
failureThreshold: 15
httpGet:
path: /api/healthz
port: http
initialDelaySeconds: 30
periodSeconds: 15
successThreshold: 1
timeoutSeconds: 1
resources:
limits:
cpu: 200m
memory: 256Mi
requests:
cpu: 50m
memory: 128Mi
startupProbe:
failureThreshold: 12
httpGet:
path: /api/healthz
port: http
periodSeconds: 15
initialDelaySeconds: 30
env:
- name: APP_BASE_URL
value: https://carnets-preprod.dev2.fabrique.social.gouv.fr
---
apiVersion: v1
kind: Service
metadata:
labels:
app: carnets
application: carnets
owner: carnets
team: carnets
cert: wildcard
name: carnets
annotations:
kapp.k14s.io/disable-default-ownership-label-rules: ''
kapp.k14s.io/disable-default-label-scoping-rules: ''
app.github.com/job: '5678'
app.github.com/ref: refs/heads/mybranch
app.github.com/repo: socialgouv/carnets
app.github.com/run: '1234'
app.github.com/sha: '0123456'
namespace: carnets-preprod
spec:
ports:
- name: http
port: 80
targetPort: 3000
selector:
app: carnets
type: ClusterIP
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: nginx
kapp.k14s.io/disable-default-ownership-label-rules: ''
kapp.k14s.io/disable-default-label-scoping-rules: ''
app.github.com/job: '5678'
app.github.com/ref: refs/heads/mybranch
app.github.com/repo: socialgouv/carnets
app.github.com/run: '1234'
app.github.com/sha: '0123456'
labels:
app: carnets
application: carnets
owner: carnets
team: carnets
cert: wildcard
name: carnets
namespace: carnets-preprod
spec:
rules:
- host: carnets-preprod.dev2.fabrique.social.gouv.fr
http:
paths:
- backend:
service:
name: carnets
port:
name: http
path: /
pathType: Prefix
tls:
- hosts:
- carnets-preprod.dev2.fabrique.social.gouv.fr
secretName: wildcard-crt
---
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
kapp.k14s.io/disable-default-ownership-label-rules: ''
kapp.k14s.io/disable-default-label-scoping-rules: ''
app.github.com/job: '5678'
app.github.com/ref: refs/heads/mybranch
app.github.com/repo: socialgouv/carnets
app.github.com/run: '1234'
app.github.com/sha: '0123456'
labels:
app: hasura
application: carnets
owner: carnets
team: carnets
cert: wildcard
name: hasura
namespace: carnets-preprod
spec:
replicas: 1
selector:
matchLabels:
app: hasura
template:
metadata:
annotations:
kapp.k14s.io/disable-default-ownership-label-rules: ''
kapp.k14s.io/disable-default-label-scoping-rules: ''
app.github.com/job: '5678'
app.github.com/ref: refs/heads/mybranch
app.github.com/repo: socialgouv/carnets
app.github.com/run: '1234'
app.github.com/sha: '0123456'
labels:
app: hasura
application: carnets
owner: carnets
team: carnets
cert: wildcard
spec:
containers:
- image: >-
ghcr.io/socialgouv/fabrique/hasura:sha-0123456789abcdefghijklmnopqrstuvwxyz0123
livenessProbe:
failureThreshold: 6
httpGet:
path: /healthz
port: http
initialDelaySeconds: 30
periodSeconds: 5
timeoutSeconds: 5
name: hasura
ports:
- containerPort: 80
name: http
readinessProbe:
failureThreshold: 15
httpGet:
path: /healthz
port: http
initialDelaySeconds: 0
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 1
resources:
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 100m
memory: 64Mi
startupProbe:
failureThreshold: 12
httpGet:
path: /healthz
port: http
periodSeconds: 5
envFrom:
- secretRef:
name: azure-pg-user
initContainers:
- env:
- name: WAIT_FOR_RETRIES
value: '24'
envFrom:
- secretRef:
name: azure-pg-user
image: ghcr.io/socialgouv/docker/wait-for-postgres:6.39.1
imagePullPolicy: Always
name: wait-for-postgres
resources:
limits:
cpu: 20m
memory: 32Mi
requests:
cpu: 5m
memory: 16Mi
---
apiVersion: v1
kind: Service
metadata:
labels:
app: hasura
application: carnets
owner: carnets
team: carnets
cert: wildcard
name: hasura
annotations:
kapp.k14s.io/disable-default-ownership-label-rules: ''
kapp.k14s.io/disable-default-label-scoping-rules: ''
app.github.com/job: '5678'
app.github.com/ref: refs/heads/mybranch
app.github.com/repo: socialgouv/carnets
app.github.com/run: '1234'
app.github.com/sha: '0123456'
namespace: carnets-preprod
spec:
ports:
- name: http
port: 80
targetPort: 80
selector:
app: hasura
type: ClusterIP
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: nginx
kapp.k14s.io/disable-default-ownership-label-rules: ''
kapp.k14s.io/disable-default-label-scoping-rules: ''
app.github.com/job: '5678'
app.github.com/ref: refs/heads/mybranch
app.github.com/repo: socialgouv/carnets
app.github.com/run: '1234'
app.github.com/sha: '0123456'
labels:
app: hasura
application: carnets
owner: carnets
team: carnets
cert: wildcard
name: hasura
namespace: carnets-preprod
spec:
rules:
- host: hasura-carnets-preprod.dev2.fabrique.social.gouv.fr
http:
paths:
- backend:
service:
name: hasura
port:
name: http
path: /
pathType: Prefix
tls:
- hosts:
- hasura-carnets-preprod.dev2.fabrique.social.gouv.fr
secretName: wildcard-crt
"
`;
exports[`generate production k8s manifests 1`] = `
"---
apiVersion: v1
kind: Namespace
metadata:
annotations:
socialgouv/creator: autodevops
field.cattle.io/creatorId: gitlab
field.cattle.io/projectId: ''
git/branch: refs/heads/mybranch
git/remote: socialgouv/carnets
app.github.com/job: '5678'
app.github.com/ref: refs/heads/mybranch
app.github.com/repo: socialgouv/carnets
app.github.com/run: '1234'
app.github.com/sha: '0123456'
labels:
azure-pg-admin-user: carnets
application: carnets
owner: carnets
team: carnets
name: carnets
---
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
kapp.k14s.io/disable-default-ownership-label-rules: ''
kapp.k14s.io/disable-default-label-scoping-rules: ''
app.github.com/job: '5678'
app.github.com/ref: refs/heads/mybranch
app.github.com/repo: socialgouv/carnets
app.github.com/run: '1234'
app.github.com/sha: '0123456'
labels:
app: carnets
application: carnets
owner: carnets
team: carnets
name: carnets
namespace: carnets
spec:
replicas: 1
selector:
matchLabels:
app: carnets
template:
metadata:
annotations:
kapp.k14s.io/disable-default-ownership-label-rules: ''
kapp.k14s.io/disable-default-label-scoping-rules: ''
app.github.com/job: '5678'
app.github.com/ref: refs/heads/mybranch
app.github.com/repo: socialgouv/carnets
app.github.com/run: '1234'
app.github.com/sha: '0123456'
labels:
app: carnets
application: carnets
owner: carnets
team: carnets
spec:
containers:
- image: >-
ghcr.io/socialgouv/fabrique/carnets:sha-0123456789abcdefghijklmnopqrstuvwxyz0123
livenessProbe:
failureThreshold: 6
httpGet:
path: /api/healthz
port: http
initialDelaySeconds: 30
periodSeconds: 15
timeoutSeconds: 5
name: carnets
ports:
- containerPort: 3000
name: http
readinessProbe:
failureThreshold: 15
httpGet:
path: /api/healthz
port: http
initialDelaySeconds: 30
periodSeconds: 15
successThreshold: 1
timeoutSeconds: 1
resources:
limits:
cpu: 200m
memory: 256Mi
requests:
cpu: 50m
memory: 128Mi
startupProbe:
failureThreshold: 12
httpGet:
path: /api/healthz
port: http
periodSeconds: 15
initialDelaySeconds: 30
env:
- name: APP_BASE_URL
value: https://carnets.dev2.fabrique.social.gouv.fr
---
apiVersion: v1
kind: Service
metadata:
labels:
app: carnets
application: carnets
owner: carnets
team: carnets
name: carnets
annotations:
kapp.k14s.io/disable-default-ownership-label-rules: ''
kapp.k14s.io/disable-default-label-scoping-rules: ''
app.github.com/job: '5678'
app.github.com/ref: refs/heads/mybranch
app.github.com/repo: socialgouv/carnets
app.github.com/run: '1234'
app.github.com/sha: '0123456'
namespace: carnets
spec:
ports:
- name: http
port: 80
targetPort: 3000
selector:
app: carnets
type: ClusterIP
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: nginx
certmanager.k8s.io/cluster-issuer: letsencrypt-prod
kubernetes.io/tls-acme: 'true'
kapp.k14s.io/disable-default-ownership-label-rules: ''
kapp.k14s.io/disable-default-label-scoping-rules: ''
app.github.com/job: '5678'
app.github.com/ref: refs/heads/mybranch
app.github.com/repo: socialgouv/carnets
app.github.com/run: '1234'
app.github.com/sha: '0123456'
labels:
app: carnets
application: carnets
owner: carnets
team: carnets
name: carnets
namespace: carnets
spec:
rules:
- host: carnets.dev2.fabrique.social.gouv.fr
http:
paths:
- backend:
service:
name: carnets
port:
name: http
path: /
pathType: Prefix
tls:
- hosts:
- carnets.dev2.fabrique.social.gouv.fr
secretName: carnets-crt
---
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
kapp.k14s.io/disable-default-ownership-label-rules: ''
kapp.k14s.io/disable-default-label-scoping-rules: ''
app.github.com/job: '5678'
app.github.com/ref: refs/heads/mybranch
app.github.com/repo: socialgouv/carnets
app.github.com/run: '1234'
app.github.com/sha: '0123456'
labels:
app: hasura
application: carnets
owner: carnets
team: carnets
name: hasura
namespace: carnets
spec:
replicas: 1
selector:
matchLabels:
app: hasura
template:
metadata:
annotations:
kapp.k14s.io/disable-default-ownership-label-rules: ''
kapp.k14s.io/disable-default-label-scoping-rules: ''
app.github.com/job: '5678'
app.github.com/ref: refs/heads/mybranch
app.github.com/repo: socialgouv/carnets
app.github.com/run: '1234'
app.github.com/sha: '0123456'
labels:
app: hasura
application: carnets
owner: carnets
team: carnets
spec:
containers:
- image: >-
ghcr.io/socialgouv/fabrique/hasura:sha-0123456789abcdefghijklmnopqrstuvwxyz0123
livenessProbe:
failureThreshold: 6
httpGet:
path: /healthz
port: http
initialDelaySeconds: 30
periodSeconds: 5
timeoutSeconds: 5
name: hasura
ports:
- containerPort: 80
name: http
readinessProbe:
failureThreshold: 15
httpGet:
path: /healthz
port: http
initialDelaySeconds: 0
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 1
resources:
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 100m
memory: 64Mi
startupProbe:
failureThreshold: 12
httpGet:
path: /healthz
port: http
periodSeconds: 5
envFrom:
- secretRef:
name: azure-pg-user
initContainers:
- env:
- name: WAIT_FOR_RETRIES
value: '24'
envFrom:
- secretRef:
name: azure-pg-user
image: ghcr.io/socialgouv/docker/wait-for-postgres:6.39.1
imagePullPolicy: Always
name: wait-for-postgres
resources:
limits:
cpu: 20m
memory: 32Mi
requests:
cpu: 5m
memory: 16Mi
---
apiVersion: v1
kind: Service
metadata:
labels:
app: hasura
application: carnets
owner: carnets
team: carnets
name: hasura
annotations:
kapp.k14s.io/disable-default-ownership-label-rules: ''
kapp.k14s.io/disable-default-label-scoping-rules: ''
app.github.com/job: '5678'
app.github.com/ref: refs/heads/mybranch
app.github.com/repo: socialgouv/carnets
app.github.com/run: '1234'
app.github.com/sha: '0123456'
namespace: carnets
spec:
ports:
- name: http
port: 80
targetPort: 80
selector:
app: hasura