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

fix: Add socialgouv config.

parent 6f7b01b4
include:
- project: SocialGouv/gitlab-ci-yml
file: /autodevops.yml
ref: v20.1.2
ref: no-k8s
variables:
AUTO_DEVOPS_RELEASE_AUTO: "🔖"
......
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`kosko generate --dev 1`] = `
"---
metadata:
annotations:
field.cattle.io/creatorId: gitlab
field.cattle.io/projectId: ''
git/branch: master
git/remote: >-
https://gitlab-ci-token:[MASKED]@gitlab.factory.social.gouv.fr/SocialGouv/archifiltre-site.git
app.gitlab.com/app: socialgouv-archifiltre-site
app.gitlab.com/env: master-dev2
app.gitlab.com/env.name: master-dev2
labels:
azure-pg-admin-user: archifiltre-site
application: master-dev2-archifiltre-site
owner: archifiltre-site
team: archifiltre-site
cert: wildcard
name: archifiltre-site-85-master-dev2
apiVersion: v1
kind: Namespace
---
metadata:
annotations:
app.gitlab.com/app: socialgouv-archifiltre-site
app.gitlab.com/env: master-dev2
app.gitlab.com/env.name: master-dev2
labels:
app: app
application: master-dev2-archifiltre-site
owner: archifiltre-site
team: archifiltre-site
cert: wildcard
component: nginx
name: app
namespace: archifiltre-site-85-master-dev2
spec:
replicas: 1
selector:
matchLabels:
app: app
template:
metadata:
annotations:
app.gitlab.com/app: socialgouv-archifiltre-site
app.gitlab.com/env: master-dev2
app.gitlab.com/env.name: master-dev2
labels:
app: app
application: master-dev2-archifiltre-site
owner: archifiltre-site
team: archifiltre-site
cert: wildcard
component: nginx
spec:
containers:
- image: >-
registry.gitlab.factory.social.gouv.fr/socialgouv/archifiltre-site/app:0123456789abcdefghijklmnopqrstuvwxyz0123
livenessProbe:
failureThreshold: 6
httpGet:
path: /index.html
port: http
initialDelaySeconds: 30
periodSeconds: 5
timeoutSeconds: 5
name: app
ports:
- containerPort: 80
name: http
readinessProbe:
failureThreshold: 15
httpGet:
path: /index.html
port: http
initialDelaySeconds: 0
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 1
resources:
limits:
cpu: 500m
memory: 128Mi
requests:
cpu: 5m
memory: 32Mi
startupProbe:
failureThreshold: 12
httpGet:
path: /index.html
port: http
periodSeconds: 5
apiVersion: apps/v1
kind: Deployment
---
metadata:
labels:
app: app
application: master-dev2-archifiltre-site
owner: archifiltre-site
team: archifiltre-site
cert: wildcard
name: app
annotations:
app.gitlab.com/app: socialgouv-archifiltre-site
app.gitlab.com/env: master-dev2
app.gitlab.com/env.name: master-dev2
namespace: archifiltre-site-85-master-dev2
spec:
ports:
- name: http
port: 80
targetPort: 80
selector:
app: app
type: ClusterIP
apiVersion: v1
kind: Service
---
metadata:
annotations:
kubernetes.io/ingress.class: nginx
app.gitlab.com/app: socialgouv-archifiltre-site
app.gitlab.com/env: master-dev2
app.gitlab.com/env.name: master-dev2
labels:
app: app
application: master-dev2-archifiltre-site
owner: archifiltre-site
team: archifiltre-site
cert: wildcard
name: app
namespace: archifiltre-site-85-master-dev2
spec:
rules:
- host: master-dev2-archifiltre-site.dev2.fabrique.social.gouv.fr
http:
paths:
- backend:
serviceName: app
servicePort: 80
path: /
tls:
- hosts:
- master-dev2-archifiltre-site.dev2.fabrique.social.gouv.fr
secretName: wildcard-crt
apiVersion: extensions/v1beta1
kind: Ingress
"
`;
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`kosko generate --preprod 1`] = `
"---
metadata:
annotations:
field.cattle.io/creatorId: gitlab
field.cattle.io/projectId: ''
git/branch: v1.2.3
git/remote: >-
https://gitlab-ci-token:[MASKED]@gitlab.factory.social.gouv.fr/SocialGouv/archifiltre-site.git
app.gitlab.com/app: socialgouv-archifiltre-site
app.gitlab.com/env: preprod-dev2
app.gitlab.com/env.name: preprod-dev2
labels:
azure-pg-admin-user: archifiltre-site
application: v1-2-3-archifiltre-site
owner: archifiltre-site
team: archifiltre-site
cert: wildcard
name: archifiltre-site-85-preprod-dev2
apiVersion: v1
kind: Namespace
---
metadata:
annotations:
app.gitlab.com/app: socialgouv-archifiltre-site
app.gitlab.com/env: preprod-dev2
app.gitlab.com/env.name: preprod-dev2
labels:
app: app
application: v1-2-3-archifiltre-site
owner: archifiltre-site
team: archifiltre-site
cert: wildcard
component: nginx
name: app
namespace: archifiltre-site-85-preprod-dev2
spec:
replicas: 1
selector:
matchLabels:
app: app
template:
metadata:
annotations:
app.gitlab.com/app: socialgouv-archifiltre-site
app.gitlab.com/env: preprod-dev2
app.gitlab.com/env.name: preprod-dev2
labels:
app: app
application: v1-2-3-archifiltre-site
owner: archifiltre-site
team: archifiltre-site
cert: wildcard
component: nginx
spec:
containers:
- image: >-
registry.gitlab.factory.social.gouv.fr/socialgouv/archifiltre-site/app:1.2.3
livenessProbe:
failureThreshold: 6
httpGet:
path: /index.html
port: http
initialDelaySeconds: 30
periodSeconds: 5
timeoutSeconds: 5
name: app
ports:
- containerPort: 80
name: http
readinessProbe:
failureThreshold: 15
httpGet:
path: /index.html
port: http
initialDelaySeconds: 0
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 1
resources:
limits:
cpu: 500m
memory: 128Mi
requests:
cpu: 5m
memory: 32Mi
startupProbe:
failureThreshold: 12
httpGet:
path: /index.html
port: http
periodSeconds: 5
apiVersion: apps/v1
kind: Deployment
---
metadata:
labels:
app: app
application: v1-2-3-archifiltre-site
owner: archifiltre-site
team: archifiltre-site
cert: wildcard
name: app
annotations:
app.gitlab.com/app: socialgouv-archifiltre-site
app.gitlab.com/env: preprod-dev2
app.gitlab.com/env.name: preprod-dev2
namespace: archifiltre-site-85-preprod-dev2
spec:
ports:
- name: http
port: 80
targetPort: 80
selector:
app: app
type: ClusterIP
apiVersion: v1
kind: Service
---
metadata:
annotations:
kubernetes.io/ingress.class: nginx
app.gitlab.com/app: socialgouv-archifiltre-site
app.gitlab.com/env: preprod-dev2
app.gitlab.com/env.name: preprod-dev2
labels:
app: app
application: v1-2-3-archifiltre-site
owner: archifiltre-site
team: archifiltre-site
cert: wildcard
name: app
namespace: archifiltre-site-85-preprod-dev2
spec:
rules:
- host: preprod-archifiltre-site.dev2.fabrique.social.gouv.fr
http:
paths:
- backend:
serviceName: app
servicePort: 80
path: /
tls:
- hosts:
- preprod-archifiltre-site.dev2.fabrique.social.gouv.fr
secretName: wildcard-crt
apiVersion: extensions/v1beta1
kind: Ingress
"
`;
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`kosko generate --prod 1`] = `
"---
metadata:
annotations:
app.gitlab.com/app: socialgouv-archifiltre-site
app.gitlab.com/env: prod2
app.gitlab.com/env.name: prod2
labels:
app: app
application: archifiltre-site
owner: archifiltre-site
team: archifiltre-site
component: nginx
name: app
namespace: archifiltre-site
spec:
replicas: 1
selector:
matchLabels:
app: app
template:
metadata:
annotations:
app.gitlab.com/app: socialgouv-archifiltre-site
app.gitlab.com/env: prod2
app.gitlab.com/env.name: prod2
labels:
app: app
application: archifiltre-site
owner: archifiltre-site
team: archifiltre-site
component: nginx
spec:
containers:
- image: >-
registry.gitlab.factory.social.gouv.fr/socialgouv/archifiltre-site/app:1.2.3
livenessProbe:
failureThreshold: 6
httpGet:
path: /index.html
port: http
initialDelaySeconds: 30
periodSeconds: 5
timeoutSeconds: 5
name: app
ports:
- containerPort: 80
name: http
readinessProbe:
failureThreshold: 15
httpGet:
path: /index.html
port: http
initialDelaySeconds: 0
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 1
resources:
limits:
cpu: 500m
memory: 128Mi
requests:
cpu: 5m
memory: 32Mi
startupProbe:
failureThreshold: 12
httpGet:
path: /index.html
port: http
periodSeconds: 5
apiVersion: apps/v1
kind: Deployment
---
metadata:
labels:
app: app
application: archifiltre-site
owner: archifiltre-site
team: archifiltre-site
name: app
annotations:
app.gitlab.com/app: socialgouv-archifiltre-site
app.gitlab.com/env: prod2
app.gitlab.com/env.name: prod2
namespace: archifiltre-site
spec:
ports:
- name: http
port: 80
targetPort: 80
selector:
app: app
type: ClusterIP
apiVersion: v1
kind: Service
---
metadata:
annotations:
kubernetes.io/ingress.class: nginx
certmanager.k8s.io/cluster-issuer: letsencrypt-prod
kubernetes.io/tls-acme: 'true'
app.gitlab.com/app: socialgouv-archifiltre-site
app.gitlab.com/env: prod2
app.gitlab.com/env.name: prod2
labels:
app: app
application: archifiltre-site
owner: archifiltre-site
team: archifiltre-site
name: app
namespace: archifiltre-site
spec:
rules:
- host: archifiltre.fabrique.social.gouv.fr
http:
paths:
- backend:
serviceName: app
servicePort: 80
path: /
tls:
- hosts:
- archifiltre.fabrique.social.gouv.fr
secretName: app-crt
apiVersion: extensions/v1beta1
kind: Ingress
"
`;
//
import { getEnvManifests } from "@socialgouv/kosko-charts/testing";
import { project } from "@socialgouv/kosko-charts/testing/fake/gitlab-ci.env";
jest.setTimeout(1000 * 60);
test("kosko generate --dev", async () => {
expect(
await getEnvManifests("dev", "", project("archifiltre-site").dev)
).toMatchSnapshot();
});
//
import { getEnvManifests } from "@socialgouv/kosko-charts/testing";
import { project } from "@socialgouv/kosko-charts/testing/fake/gitlab-ci.env";
jest.setTimeout(1000 * 60);
test("kosko generate --preprod", async () => {
expect(
await getEnvManifests("preprod", "", project("archifiltre-site").preprod)
).toMatchSnapshot();
});
//
import { getEnvManifests } from "@socialgouv/kosko-charts/testing";
import { project } from "@socialgouv/kosko-charts/testing/fake/gitlab-ci.env";
jest.setTimeout(1000 * 60);
test("kosko generate --prod", async () => {
expect(
await getEnvManifests("prod", "'!(_*)'", project("archifiltre-site").prod)
).toMatchSnapshot();
});
module.exports = {
plugins: [["@babel/plugin-transform-modules-commonjs"]],
};
import { createNamespace } from "@socialgouv/kosko-charts/components/namespace";
const manifests = createNamespace();
export default manifests;
import env from "@kosko/env";
import { create } from "@socialgouv/kosko-charts/components/nginx";
const manifests = create("app", {
env
});
export default manifests;
import { GlobalEnvironment } from "@socialgouv/kosko-charts/types";
export default {
subdomain: `archifiltre`,
} as Partial<GlobalEnvironment>;
components = ["*"]
require = ["ts-node/register"]
{
"dependencies": {
"@kosko/env": "^1.0.1",
"@socialgouv/kosko-charts": "^4.1.3",
"@types/node": "^13.13.4",
"kosko": "^1.0.1",
"kubernetes-models": "^1.0.1",
"ts-node": "^9.0.0"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@babel/plugin-transform-modules-commonjs": "^7.12.1",
"@types/jest": "^26.0.16",
"dotenv": "^8.2.0",
"jest": "^26.6.3",
"typescript": "^4.1.2"
},
"license": "Apache-2.0",
"scripts": {
"generate": "kosko generate",
"generate:dev": "kosko generate --env dev",
"generate:preprod": "kosko generate --env preprod",
"generate:prod": "kosko generate --env dev",
"gitlab": "DOTENV_CONFIG_PATH=./environments/.gitlab.env kosko generate --require dotenv/config",
"gitlab:dev": "yarn --silent gitlab --env dev",
"gitlab:preprod": "yarn --silent gitlab --env preprod",
"gitlab:prod": "yarn --silent gitlab --env prod",
"test": "jest"
}
}
{
"compilerOptions": {
"baseUrl": ".",
"esModuleInterop": true,
"module": "commonjs",
"moduleResolution": "node",
"strict": true,
"target": "es2015",
"types": ["node"]
}
}
This diff is collapsed.
{
"type": "nginx",
"name": "archifiltre-site",
"subdomain": "archifiltre"
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment