@catladder/cli 0.0.0-next-1cd29c1f → 0.0.0-next-52feb889
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundles/catenv/index.js +45 -9
- package/dist/bundles/cli/index.js +125 -11
- package/dist/bundles/runner-images/agent-claude/Dockerfile +5 -0
- package/dist/bundles/runner-images/docker-build/Dockerfile +26 -0
- package/dist/bundles/runner-images/docker-build/scripts/ensureMeteorDockerfile +55 -0
- package/dist/bundles/runner-images/docker-build/scripts/ensureNginxDockerfile +85 -0
- package/dist/bundles/runner-images/docker-build/scripts/ensureNodeDockerfile +50 -0
- package/dist/bundles/runner-images/gcloud/Dockerfile +3 -0
- package/dist/bundles/runner-images/jobs-default/Dockerfile +22 -0
- package/dist/bundles/runner-images/jobs-meteor/Dockerfile +7 -0
- package/dist/bundles/runner-images/jobs-testing-chrome/Dockerfile +15 -0
- package/dist/bundles/runner-images/kubernetes/Dockerfile +26 -0
- package/dist/bundles/runner-images/kubernetes/helm-charts/the-panter-chart/Chart.lock +9 -0
- package/dist/bundles/runner-images/kubernetes/helm-charts/the-panter-chart/Chart.yaml +14 -0
- package/dist/bundles/runner-images/kubernetes/helm-charts/the-panter-chart/README.md +24 -0
- package/dist/bundles/runner-images/kubernetes/helm-charts/the-panter-chart/charts/mailhog-5.0.1.tgz +0 -0
- package/dist/bundles/runner-images/kubernetes/helm-charts/the-panter-chart/charts/mongodb-12.1.27.tgz +0 -0
- package/dist/bundles/runner-images/kubernetes/helm-charts/the-panter-chart/myvalues.yaml +15 -0
- package/dist/bundles/runner-images/kubernetes/helm-charts/the-panter-chart/templates/_helpers.tpl +202 -0
- package/dist/bundles/runner-images/kubernetes/helm-charts/the-panter-chart/templates/app.cloudsql-proxy-credentials.yml +10 -0
- package/dist/bundles/runner-images/kubernetes/helm-charts/the-panter-chart/templates/app.cronjobs.yml +69 -0
- package/dist/bundles/runner-images/kubernetes/helm-charts/the-panter-chart/templates/app.deployment.autoscaler.yml +19 -0
- package/dist/bundles/runner-images/kubernetes/helm-charts/the-panter-chart/templates/app.deployment.yml +103 -0
- package/dist/bundles/runner-images/kubernetes/helm-charts/the-panter-chart/templates/app.env.configmap.yml +27 -0
- package/dist/bundles/runner-images/kubernetes/helm-charts/the-panter-chart/templates/app.env.secrets.yml +10 -0
- package/dist/bundles/runner-images/kubernetes/helm-charts/the-panter-chart/templates/app.ingress.redirects.yaml +91 -0
- package/dist/bundles/runner-images/kubernetes/helm-charts/the-panter-chart/templates/app.ingress.yaml +48 -0
- package/dist/bundles/runner-images/kubernetes/helm-charts/the-panter-chart/templates/app.jobs.yml +70 -0
- package/dist/bundles/runner-images/kubernetes/helm-charts/the-panter-chart/templates/app.service.yaml +31 -0
- package/dist/bundles/runner-images/kubernetes/helm-charts/the-panter-chart/templates/app.volumes.yml +20 -0
- package/dist/bundles/runner-images/kubernetes/helm-charts/the-panter-chart/templates/app.worker.deployment.yml +104 -0
- package/dist/bundles/runner-images/kubernetes/helm-charts/the-panter-chart/templates/app.worker.service.yaml +34 -0
- package/dist/bundles/runner-images/kubernetes/helm-charts/the-panter-chart/templates/mailhog.ingress.yaml +35 -0
- package/dist/bundles/runner-images/kubernetes/helm-charts/the-panter-chart/templates/maintenance.deployment.yml +45 -0
- package/dist/bundles/runner-images/kubernetes/helm-charts/the-panter-chart/templates/maintenance.service.yml +24 -0
- package/dist/bundles/runner-images/kubernetes/helm-charts/the-panter-chart/templates/mongodb.backup.cronjob.yml +120 -0
- package/dist/bundles/runner-images/kubernetes/helm-charts/the-panter-chart/values.yaml +154 -0
- package/dist/bundles/runner-images/kubernetes/scripts/kubernetesCreateSecret +11 -0
- package/dist/bundles/runner-images/kubernetes/scripts/kubernetesDelete +5 -0
- package/dist/bundles/runner-images/kubernetes/scripts/kubernetesDeploy +57 -0
- package/dist/bundles/runner-images/kubernetes/scripts/kubernetesRollback +5 -0
- package/dist/bundles/runner-images/semantic-release/Dockerfile +24 -0
- package/dist/bundles/runner-images/semantic-release/scripts/semanticRelease +67 -0
- package/dist/cli/src/apps/cli/commands/project/setup/ensureGcloudProjectNumbers.d.ts +12 -0
- package/dist/cli/src/apps/cli/commands/project/setup/ensureGcloudProjectNumbers.js +64 -0
- package/dist/cli/src/apps/cli/commands/project/setup/ensureGcloudProjectNumbers.js.map +1 -0
- package/dist/cli/src/apps/cli/commands/project/setup/index.js +3 -0
- package/dist/cli/src/apps/cli/commands/project/setup/index.js.map +1 -1
- package/dist/cli/src/config/getProjectConfig.d.ts +6 -0
- package/dist/cli/src/config/getProjectConfig.js +10 -1
- package/dist/cli/src/config/getProjectConfig.js.map +1 -1
- package/dist/cli/src/gcloud/cloudSql/copyDb.js +6 -2
- package/dist/cli/src/gcloud/cloudSql/copyDb.js.map +1 -1
- package/dist/pipeline/src/constants.js +1 -1
- package/dist/pipeline/src/context/index.d.ts +1 -0
- package/dist/pipeline/src/context/index.js +1 -0
- package/dist/pipeline/src/context/index.js.map +1 -1
- package/dist/pipeline/src/customImages/shippedImages.js +3 -1
- package/dist/pipeline/src/customImages/shippedImages.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/execute/schedules.js +18 -3
- package/dist/pipeline/src/deploy/cloudRun/createJobs/execute/schedules.js.map +1 -1
- package/dist/pipeline/src/deploy/types/googleCloudRun.d.ts +5 -1
- package/dist/pipeline/src/store/index.d.ts +4 -0
- package/dist/pipeline/src/store/index.js +12 -3
- package/dist/pipeline/src/store/index.js.map +1 -1
- package/dist/runner-images/agent-claude/Dockerfile +5 -0
- package/dist/runner-images/docker-build/Dockerfile +26 -0
- package/dist/runner-images/docker-build/scripts/ensureMeteorDockerfile +55 -0
- package/dist/runner-images/docker-build/scripts/ensureNginxDockerfile +85 -0
- package/dist/runner-images/docker-build/scripts/ensureNodeDockerfile +50 -0
- package/dist/runner-images/gcloud/Dockerfile +3 -0
- package/dist/runner-images/jobs-default/Dockerfile +22 -0
- package/dist/runner-images/jobs-meteor/Dockerfile +7 -0
- package/dist/runner-images/jobs-testing-chrome/Dockerfile +15 -0
- package/dist/runner-images/kubernetes/Dockerfile +26 -0
- package/dist/runner-images/kubernetes/helm-charts/the-panter-chart/Chart.lock +9 -0
- package/dist/runner-images/kubernetes/helm-charts/the-panter-chart/Chart.yaml +14 -0
- package/dist/runner-images/kubernetes/helm-charts/the-panter-chart/README.md +24 -0
- package/dist/runner-images/kubernetes/helm-charts/the-panter-chart/charts/mailhog-5.0.1.tgz +0 -0
- package/dist/runner-images/kubernetes/helm-charts/the-panter-chart/charts/mongodb-12.1.27.tgz +0 -0
- package/dist/runner-images/kubernetes/helm-charts/the-panter-chart/myvalues.yaml +15 -0
- package/dist/runner-images/kubernetes/helm-charts/the-panter-chart/templates/_helpers.tpl +202 -0
- package/dist/runner-images/kubernetes/helm-charts/the-panter-chart/templates/app.cloudsql-proxy-credentials.yml +10 -0
- package/dist/runner-images/kubernetes/helm-charts/the-panter-chart/templates/app.cronjobs.yml +69 -0
- package/dist/runner-images/kubernetes/helm-charts/the-panter-chart/templates/app.deployment.autoscaler.yml +19 -0
- package/dist/runner-images/kubernetes/helm-charts/the-panter-chart/templates/app.deployment.yml +103 -0
- package/dist/runner-images/kubernetes/helm-charts/the-panter-chart/templates/app.env.configmap.yml +27 -0
- package/dist/runner-images/kubernetes/helm-charts/the-panter-chart/templates/app.env.secrets.yml +10 -0
- package/dist/runner-images/kubernetes/helm-charts/the-panter-chart/templates/app.ingress.redirects.yaml +91 -0
- package/dist/runner-images/kubernetes/helm-charts/the-panter-chart/templates/app.ingress.yaml +48 -0
- package/dist/runner-images/kubernetes/helm-charts/the-panter-chart/templates/app.jobs.yml +70 -0
- package/dist/runner-images/kubernetes/helm-charts/the-panter-chart/templates/app.service.yaml +31 -0
- package/dist/runner-images/kubernetes/helm-charts/the-panter-chart/templates/app.volumes.yml +20 -0
- package/dist/runner-images/kubernetes/helm-charts/the-panter-chart/templates/app.worker.deployment.yml +104 -0
- package/dist/runner-images/kubernetes/helm-charts/the-panter-chart/templates/app.worker.service.yaml +34 -0
- package/dist/runner-images/kubernetes/helm-charts/the-panter-chart/templates/mailhog.ingress.yaml +35 -0
- package/dist/runner-images/kubernetes/helm-charts/the-panter-chart/templates/maintenance.deployment.yml +45 -0
- package/dist/runner-images/kubernetes/helm-charts/the-panter-chart/templates/maintenance.service.yml +24 -0
- package/dist/runner-images/kubernetes/helm-charts/the-panter-chart/templates/mongodb.backup.cronjob.yml +120 -0
- package/dist/runner-images/kubernetes/helm-charts/the-panter-chart/values.yaml +154 -0
- package/dist/runner-images/kubernetes/scripts/kubernetesCreateSecret +11 -0
- package/dist/runner-images/kubernetes/scripts/kubernetesDelete +5 -0
- package/dist/runner-images/kubernetes/scripts/kubernetesDeploy +57 -0
- package/dist/runner-images/kubernetes/scripts/kubernetesRollback +5 -0
- package/dist/runner-images/semantic-release/Dockerfile +24 -0
- package/dist/runner-images/semantic-release/scripts/semanticRelease +67 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -2
- package/src/apps/cli/commands/project/setup/ensureGcloudProjectNumbers.ts +61 -0
- package/src/apps/cli/commands/project/setup/index.ts +3 -0
- package/src/config/getProjectConfig.ts +9 -0
- package/src/gcloud/cloudSql/copyDb.ts +7 -2
package/dist/runner-images/kubernetes/helm-charts/the-panter-chart/templates/app.deployment.yml
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
|
|
2
|
+
{{- if .Values.application.enabled -}}
|
|
3
|
+
{{ $context := . }}
|
|
4
|
+
|
|
5
|
+
apiVersion: apps/v1
|
|
6
|
+
kind: Deployment
|
|
7
|
+
metadata:
|
|
8
|
+
name: {{ template "fullname" $context }}-app
|
|
9
|
+
annotations:
|
|
10
|
+
"cluster-autoscaler.kubernetes.io/safe-to-evict": "true"
|
|
11
|
+
{{ if .Values.gitlab.app }}app.gitlab.com/app: {{ .Values.gitlab.app | quote }}{{ end }}
|
|
12
|
+
{{ if .Values.gitlab.env }}app.gitlab.com/env: {{ .Values.gitlab.env | quote }}{{ end }}
|
|
13
|
+
labels:
|
|
14
|
+
app: {{ .Release.Name }}
|
|
15
|
+
namespace: {{ .Release.Namespace }}
|
|
16
|
+
spec:
|
|
17
|
+
replicas: {{ .Values.application.replicas }}
|
|
18
|
+
revisionHistoryLimit: 2
|
|
19
|
+
selector:
|
|
20
|
+
matchLabels:
|
|
21
|
+
app: {{ template "fullname" $context }}-app
|
|
22
|
+
release: {{ .Release.Name }}
|
|
23
|
+
strategy:
|
|
24
|
+
{{ toYaml .Values.application.updateStrategy | indent 4 }}
|
|
25
|
+
template:
|
|
26
|
+
metadata:
|
|
27
|
+
annotations:
|
|
28
|
+
{{ if .Values.gitlab.app }}app.gitlab.com/app: {{ .Values.gitlab.app | quote }}{{ end }}
|
|
29
|
+
{{ if .Values.gitlab.env }}app.gitlab.com/env: {{ .Values.gitlab.env | quote }}{{ end }}
|
|
30
|
+
labels:
|
|
31
|
+
app: {{ template "fullname" $context }}-app
|
|
32
|
+
release: {{ .Release.Name }}
|
|
33
|
+
spec:
|
|
34
|
+
{{- if .Values.image.pullSecret }}
|
|
35
|
+
imagePullSecrets:
|
|
36
|
+
- name: {{ .Values.image.pullSecret }}
|
|
37
|
+
{{- end }}
|
|
38
|
+
dnsPolicy: ClusterFirst
|
|
39
|
+
restartPolicy: Always
|
|
40
|
+
schedulerName: default-scheduler
|
|
41
|
+
securityContext: {}
|
|
42
|
+
terminationGracePeriodSeconds: 30
|
|
43
|
+
tolerations:
|
|
44
|
+
{{- if and .Values.global.ENV_SHORT (eq .Values.global.ENV_SHORT "review")}}
|
|
45
|
+
- key: "stage"
|
|
46
|
+
operator: "Equal"
|
|
47
|
+
value: "review"
|
|
48
|
+
effect: "NoSchedule"
|
|
49
|
+
{{- end }}
|
|
50
|
+
|
|
51
|
+
containers:
|
|
52
|
+
- name: {{ template "fullname" $context }}-app
|
|
53
|
+
image: "{{ template "appImage" .}}"
|
|
54
|
+
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
55
|
+
{{ if .Values.application.command }}
|
|
56
|
+
|
|
57
|
+
command: ["/bin/sh", "-c"]
|
|
58
|
+
args:
|
|
59
|
+
- |
|
|
60
|
+
{{(kindIs "slice" .Values.application.command) | ternary (join " " .Values.application.command) .Values.application.command}}
|
|
61
|
+
|
|
62
|
+
{{- end }}
|
|
63
|
+
{{include "env" $context | nindent 8}}
|
|
64
|
+
startupProbe:
|
|
65
|
+
{{ toYaml .Values.application.startupProbe | indent 10 }}
|
|
66
|
+
livenessProbe:
|
|
67
|
+
{{ toYaml .Values.application.livenessProbe | indent 10 }}
|
|
68
|
+
readinessProbe:
|
|
69
|
+
{{ toYaml .Values.application.readinessProbe | indent 10 }}
|
|
70
|
+
ports:
|
|
71
|
+
- containerPort: 8080
|
|
72
|
+
protocol: TCP
|
|
73
|
+
resources:
|
|
74
|
+
{{ toYaml .Values.application.resources | indent 10 }}
|
|
75
|
+
terminationMessagePath: /dev/termination-log
|
|
76
|
+
terminationMessagePolicy: File
|
|
77
|
+
volumeMounts:
|
|
78
|
+
|
|
79
|
+
{{- range $key, $volume := .Values.application.volumes }}
|
|
80
|
+
- mountPath: {{$volume.mountPath}}
|
|
81
|
+
name: {{ template "fullname" $context }}-{{$volume.name}}
|
|
82
|
+
{{- end }}
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
{{if .Values.cloudsql.enabled}}
|
|
86
|
+
- {{- include "cloudSqlContainer" $context | nindent 8 }}
|
|
87
|
+
{{- end }}
|
|
88
|
+
volumes:
|
|
89
|
+
|
|
90
|
+
{{if .Values.cloudsql.enabled}}
|
|
91
|
+
- name: tmp-pod # required for a hack
|
|
92
|
+
emptyDir: {}
|
|
93
|
+
{{- end }}
|
|
94
|
+
{{- range $key, $volume := .Values.application.volumes }}
|
|
95
|
+
- name: {{ template "fullname" $context }}-{{$volume.name}}
|
|
96
|
+
persistentVolumeClaim:
|
|
97
|
+
claimName: {{ template "fullname" $context }}-{{$volume.name}}
|
|
98
|
+
{{- end }}
|
|
99
|
+
{{if .Values.cloudsql.enabled}}
|
|
100
|
+
- {{- include "cloudSqlCredentialsVolume" $context | nindent 10 }}
|
|
101
|
+
{{- end }}
|
|
102
|
+
{{- end }}
|
|
103
|
+
|
package/dist/runner-images/kubernetes/helm-charts/the-panter-chart/templates/app.env.configmap.yml
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
|
|
2
|
+
apiVersion: v1
|
|
3
|
+
kind: ConfigMap
|
|
4
|
+
metadata:
|
|
5
|
+
name: {{ template "fullname" . }}-app-env
|
|
6
|
+
labels:
|
|
7
|
+
app: {{ .Release.Name }}
|
|
8
|
+
namespace: {{ .Release.Namespace }}
|
|
9
|
+
data:
|
|
10
|
+
PORT: "8080"
|
|
11
|
+
TZ: Europe/Zurich
|
|
12
|
+
ENV_SHORT: {{ .Values.global.ENV_SHORT }}
|
|
13
|
+
SERVICE_VAR_PREFIX: "{{- template "serviceVarPrefix" . -}}"
|
|
14
|
+
|
|
15
|
+
{{ if .Values.mailhog.enabled }}
|
|
16
|
+
MAILHOG_SMTP_URL: "{{- template "MAILHOG_SMTP_URL" . -}}"
|
|
17
|
+
MAIL_URL: "{{- template "MAILHOG_SMTP_URL" . -}}"
|
|
18
|
+
{{- end -}}
|
|
19
|
+
|
|
20
|
+
{{- range $key, $val := .Values.env.public }}
|
|
21
|
+
{{ $key }}: {{ template "envValue" $val }}
|
|
22
|
+
{{- end -}}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
{{- if .Values.application -}}
|
|
2
|
+
{{ $app := .Values.application }}
|
|
3
|
+
{{ $serviceName := include "fullname" . }}
|
|
4
|
+
{{ $servicePort := .Values.service.externalPort }}
|
|
5
|
+
|
|
6
|
+
{{ $hastCustomHost := ne $app.hostCanonical (default $app.hostCanonical $app.host) }}
|
|
7
|
+
# if it has a custom host, add a redirect from canonical to custom host
|
|
8
|
+
{{if $hastCustomHost -}}
|
|
9
|
+
apiVersion: networking.k8s.io/v1
|
|
10
|
+
kind: Ingress
|
|
11
|
+
metadata:
|
|
12
|
+
name: {{ template "fullname" . }}-{{ $app.hostCanonical }}-redirect
|
|
13
|
+
labels:
|
|
14
|
+
app: {{ template "name" . }}
|
|
15
|
+
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
|
|
16
|
+
release: {{ .Release.Name }}
|
|
17
|
+
heritage: {{ .Release.Service }}
|
|
18
|
+
annotations:
|
|
19
|
+
{{- range $key, $value := .Values.ingress.annotations }}
|
|
20
|
+
{{ $key }}: {{ $value | quote }}
|
|
21
|
+
{{- end }}
|
|
22
|
+
nginx.ingress.kubernetes.io/configuration-snippet: |
|
|
23
|
+
return 301 $scheme://{{ template "host" . }}$request_uri;
|
|
24
|
+
spec:
|
|
25
|
+
rules:
|
|
26
|
+
- host: {{ $app.hostCanonical}}
|
|
27
|
+
http:
|
|
28
|
+
paths:
|
|
29
|
+
- path: /
|
|
30
|
+
pathType: ImplementationSpecific
|
|
31
|
+
backend:
|
|
32
|
+
service:
|
|
33
|
+
name: {{ template "fullname" . }}-app
|
|
34
|
+
port:
|
|
35
|
+
number: {{ $servicePort }}
|
|
36
|
+
tls:
|
|
37
|
+
- secretName: {{ $app.hostCanonical | trunc 59 | trimSuffix "." }}-tls
|
|
38
|
+
hosts:
|
|
39
|
+
- {{ $app.hostCanonical }}
|
|
40
|
+
---
|
|
41
|
+
{{- end }}
|
|
42
|
+
|
|
43
|
+
{{ if $app.redirects }}
|
|
44
|
+
{{ $context := . }}
|
|
45
|
+
{{ range $index, $redirect := $app.redirects -}}
|
|
46
|
+
|
|
47
|
+
apiVersion: networking.k8s.io/v1
|
|
48
|
+
kind: Ingress
|
|
49
|
+
metadata:
|
|
50
|
+
{{- if $redirect.path }}
|
|
51
|
+
name: {{ template "fullname" $context }}-{{ $redirect.host }}-{{ $index }}-redirect
|
|
52
|
+
{{- else }}
|
|
53
|
+
name: {{ template "fullname" $context }}-{{ $redirect.host }}-redirect
|
|
54
|
+
{{- end }}
|
|
55
|
+
labels:
|
|
56
|
+
app: {{ template "name" $context }}
|
|
57
|
+
chart: {{$context.Chart.Name }}-{{$context.Chart.Version | replace "+" "_" }}
|
|
58
|
+
release: {{$context.Release.Name }}
|
|
59
|
+
heritage: {{$context.Release.Service }}
|
|
60
|
+
annotations:
|
|
61
|
+
{{- range $key, $value := $context.Values.ingress.annotations }}
|
|
62
|
+
{{ $key }}: {{ $value | quote }}
|
|
63
|
+
{{- end }}
|
|
64
|
+
{{- if $redirect.rule}}
|
|
65
|
+
nginx.ingress.kubernetes.io/configuration-snippet: |
|
|
66
|
+
{{ $redirect.rule }}
|
|
67
|
+
{{ else }}
|
|
68
|
+
nginx.ingress.kubernetes.io/configuration-snippet: |
|
|
69
|
+
return 301 $scheme://{{ template "host" $context }}$request_uri;
|
|
70
|
+
{{- end }}
|
|
71
|
+
|
|
72
|
+
spec:
|
|
73
|
+
rules:
|
|
74
|
+
- host: {{ $redirect.host}}
|
|
75
|
+
http:
|
|
76
|
+
paths:
|
|
77
|
+
- path: {{ $redirect.path | default "/" }}
|
|
78
|
+
pathType: ImplementationSpecific
|
|
79
|
+
backend:
|
|
80
|
+
service:
|
|
81
|
+
name: {{ template "fullname" $context }}-app
|
|
82
|
+
port:
|
|
83
|
+
number: {{ $servicePort }}
|
|
84
|
+
tls:
|
|
85
|
+
- secretName: {{ $redirect.host | trunc 59 | trimSuffix "." }}-tls
|
|
86
|
+
hosts:
|
|
87
|
+
- {{ $redirect.host }}
|
|
88
|
+
---
|
|
89
|
+
{{- end }}
|
|
90
|
+
{{- end }}
|
|
91
|
+
{{- end }}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{{- if .Values.ingress.enabled -}}
|
|
2
|
+
{{- if .Values.application.enabled -}}
|
|
3
|
+
{{- $servicePort := .Values.service.externalPort -}}
|
|
4
|
+
{{- $app := .Values.application -}}
|
|
5
|
+
{{ $hosts := without (prepend (default (list nil) $app.hostAliases) (include "host" .)) nil }}
|
|
6
|
+
apiVersion: networking.k8s.io/v1
|
|
7
|
+
kind: Ingress
|
|
8
|
+
metadata:
|
|
9
|
+
name: {{ template "fullname" . }}-app
|
|
10
|
+
labels:
|
|
11
|
+
app: {{ template "name" . }}
|
|
12
|
+
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
|
|
13
|
+
release: {{ .Release.Name }}
|
|
14
|
+
heritage: {{ .Release.Service }}
|
|
15
|
+
annotations:
|
|
16
|
+
nginx.ingress.kubernetes.io/rewrite-target: /$1
|
|
17
|
+
nginx.ingress.kubernetes.io/configuration-snippet: |
|
|
18
|
+
more_set_headers "x-build-id: {{ .Values.global.BUILD_ID }}";
|
|
19
|
+
{{- if and .Values.gitlab.visualReviewEnabled (and .Values.global.ENV_SHORT (eq .Values.global.ENV_SHORT "review"))}}
|
|
20
|
+
proxy_set_header Accept-Encoding "";
|
|
21
|
+
sub_filter_once on;
|
|
22
|
+
sub_filter "</head>" "{{- include "visualReviewSnippet" . | nindent 8 -}}</head>";
|
|
23
|
+
{{- end }}
|
|
24
|
+
{{- range $key, $value := .Values.ingress.annotations }}
|
|
25
|
+
{{ $key }}: {{ $value | quote }}
|
|
26
|
+
{{- end }}
|
|
27
|
+
spec:
|
|
28
|
+
rules:
|
|
29
|
+
{{- range $hosts }}
|
|
30
|
+
- host: {{ . }}
|
|
31
|
+
http:
|
|
32
|
+
paths:
|
|
33
|
+
- path: /?(.*)
|
|
34
|
+
pathType: ImplementationSpecific
|
|
35
|
+
backend:
|
|
36
|
+
service:
|
|
37
|
+
name: {{ template "fullname" $ }}-app
|
|
38
|
+
port:
|
|
39
|
+
number: {{ $servicePort }}
|
|
40
|
+
{{- end }}
|
|
41
|
+
tls:
|
|
42
|
+
- secretName: {{ include "host" . | trunc 59 | trimSuffix "." }}-tls
|
|
43
|
+
hosts:
|
|
44
|
+
{{- range $hosts }}
|
|
45
|
+
- {{ . }}
|
|
46
|
+
{{- end }}
|
|
47
|
+
{{- end -}}
|
|
48
|
+
{{- end -}}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
|
|
2
|
+
{{ $jobs := .Values.jobs }}
|
|
3
|
+
{{ if $jobs }}
|
|
4
|
+
{{ $context := . }}
|
|
5
|
+
{{ range $key, $job := $jobs -}}
|
|
6
|
+
|
|
7
|
+
{{- $name := (kindIs "map" $jobs) | ternary $key $job.name -}}
|
|
8
|
+
{{- $defaultIndex := (kindIs "map" $jobs) | ternary 0 $key -}}
|
|
9
|
+
|
|
10
|
+
apiVersion: batch/v1
|
|
11
|
+
kind: Job
|
|
12
|
+
|
|
13
|
+
metadata:
|
|
14
|
+
name: {{ include "fullname" $context | trunc 24 }}-{{ $name | trunc 35 }}
|
|
15
|
+
namespace: {{ $context.Release.Namespace }}
|
|
16
|
+
labels:
|
|
17
|
+
app: {{ $context.Release.Name }}
|
|
18
|
+
app.kubernetes.io/managed-by: {{$context.Release.Service | quote }}
|
|
19
|
+
app.kubernetes.io/instance: {{$context.Release.Name | quote }}
|
|
20
|
+
helm.sh/chart: "{{$context.Chart.Name}}-{{$context.Chart.Version}}"
|
|
21
|
+
annotations:
|
|
22
|
+
# This is what defines this resource as a hook. Without this line, the
|
|
23
|
+
# job is considered part of the release.
|
|
24
|
+
"helm.sh/hook": "{{- default "post-install,post-upgrade" $job.hook -}}"
|
|
25
|
+
"helm.sh/hook-weight": "{{- default $defaultIndex $job.hookWeight -}}"
|
|
26
|
+
"helm.sh/hook-delete-policy": "{{- default "hook-succeeded,before-hook-creation" $job.hookDeletePolicy -}}"
|
|
27
|
+
spec:
|
|
28
|
+
template:
|
|
29
|
+
spec:
|
|
30
|
+
{{- if $context.Values.image.pullSecret }}
|
|
31
|
+
imagePullSecrets:
|
|
32
|
+
- name: {{ $context.Values.image.pullSecret }}
|
|
33
|
+
{{- end }}
|
|
34
|
+
restartPolicy: Never
|
|
35
|
+
|
|
36
|
+
containers:
|
|
37
|
+
- name: {{ $name }}-job
|
|
38
|
+
{{include "env" $context | nindent 8}}
|
|
39
|
+
{{if $job.image -}}
|
|
40
|
+
image: "{{ $job.image }}"
|
|
41
|
+
{{else}}
|
|
42
|
+
image: "{{ template "appImage" $context}}"
|
|
43
|
+
{{end}}
|
|
44
|
+
imagePullPolicy: {{ $context.Values.image.pullPolicy }}
|
|
45
|
+
# see https://github.com/kubernetes/kubernetes/issues/25908#issuecomment-308569672
|
|
46
|
+
command: ["/bin/sh", "-c"]
|
|
47
|
+
args:
|
|
48
|
+
- |
|
|
49
|
+
trap "touch /tmp/pod/main-terminated" EXIT
|
|
50
|
+
{{$job.command}}
|
|
51
|
+
volumeMounts:
|
|
52
|
+
- mountPath: /tmp/pod
|
|
53
|
+
name: tmp-pod
|
|
54
|
+
resources:
|
|
55
|
+
{{ toYaml $context.Values.jobDefaults.resources | indent 10 }}
|
|
56
|
+
|
|
57
|
+
{{if $context.Values.cloudsql.enabled}}
|
|
58
|
+
- {{- include "cloudSqlContainer" $context | nindent 8 }}
|
|
59
|
+
{{- end }}
|
|
60
|
+
volumes:
|
|
61
|
+
- name: tmp-pod
|
|
62
|
+
emptyDir: {}
|
|
63
|
+
{{if $context.Values.cloudsql.enabled}}
|
|
64
|
+
- {{- include "cloudSqlCredentialsVolume" $context | nindent 10 }}
|
|
65
|
+
{{- end }}
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
{{- end }}
|
|
70
|
+
{{- end }}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{{- if .Values.application.enabled -}}
|
|
2
|
+
{{- $context := . }}
|
|
3
|
+
apiVersion: v1
|
|
4
|
+
kind: Service
|
|
5
|
+
metadata:
|
|
6
|
+
labels:
|
|
7
|
+
app: {{ template "fullname" . }}-app
|
|
8
|
+
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
|
|
9
|
+
release: {{ .Release.Name }}
|
|
10
|
+
heritage: {{ .Release.Service }}
|
|
11
|
+
name: {{ template "fullname" . }}-app
|
|
12
|
+
namespace: {{ .Release.Namespace }}
|
|
13
|
+
spec:
|
|
14
|
+
type: {{ .Values.service.type }}
|
|
15
|
+
ports:
|
|
16
|
+
- port: {{ .Values.service.externalPort }}
|
|
17
|
+
targetPort: {{ .Values.service.internalPort }}
|
|
18
|
+
protocol: TCP
|
|
19
|
+
name: {{ template "fullname" . }}-service
|
|
20
|
+
{{- range $ports := .Values.service.additionalPorts }}
|
|
21
|
+
- port: {{ required ".Values.service.additionalPorts.port is required" $ports.port }}
|
|
22
|
+
targetPort: {{ $ports.targetPort | default $ports.port }}
|
|
23
|
+
protocol: {{ $ports.protocol | default "TCP" }}
|
|
24
|
+
name: {{ template "fullname" $context }}-{{ required ".Values.service.additionalPorts.nameSuffix is required" $ports.nameSuffix }}-service
|
|
25
|
+
{{- end }}
|
|
26
|
+
selector:
|
|
27
|
+
app: {{ template "fullname" . }}-app
|
|
28
|
+
release: {{ .Release.Name }}
|
|
29
|
+
sessionAffinity: None
|
|
30
|
+
type: NodePort
|
|
31
|
+
{{- end -}}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
|
|
2
|
+
{{ $context := . }}
|
|
3
|
+
{{- range $key, $volume := .Values.application.volumes }}
|
|
4
|
+
|
|
5
|
+
kind: PersistentVolumeClaim
|
|
6
|
+
apiVersion: v1
|
|
7
|
+
metadata:
|
|
8
|
+
name: {{ template "fullname" $context }}-{{$volume.name}}
|
|
9
|
+
labels:
|
|
10
|
+
app: {{ $context.Release.Name }}
|
|
11
|
+
namespace: {{ $context.Release.Namespace }}
|
|
12
|
+
spec:
|
|
13
|
+
resources:
|
|
14
|
+
requests:
|
|
15
|
+
storage: {{ default "10Gi" $volume.size }}
|
|
16
|
+
accessModes:
|
|
17
|
+
- ReadWriteOnce
|
|
18
|
+
---
|
|
19
|
+
{{- end }}
|
|
20
|
+
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
{{- if .Values.application.worker.enabled -}}
|
|
2
|
+
|
|
3
|
+
{{ $context := . }}
|
|
4
|
+
|
|
5
|
+
apiVersion: apps/v1
|
|
6
|
+
kind: Deployment
|
|
7
|
+
metadata:
|
|
8
|
+
annotations:
|
|
9
|
+
name: {{ template "fullname" $context }}-worker
|
|
10
|
+
labels:
|
|
11
|
+
app: {{ .Release.Name }}
|
|
12
|
+
namespace: {{ .Release.Namespace }}
|
|
13
|
+
spec:
|
|
14
|
+
replicas: 1
|
|
15
|
+
revisionHistoryLimit: 2
|
|
16
|
+
selector:
|
|
17
|
+
matchLabels:
|
|
18
|
+
app: {{ template "fullname" $context }}-worker
|
|
19
|
+
release: {{ .Release.Name }}
|
|
20
|
+
strategy:
|
|
21
|
+
rollingUpdate:
|
|
22
|
+
maxSurge: 1
|
|
23
|
+
maxUnavailable: 1
|
|
24
|
+
type: RollingUpdate
|
|
25
|
+
template:
|
|
26
|
+
metadata:
|
|
27
|
+
labels:
|
|
28
|
+
app: {{ template "fullname" $context }}-worker
|
|
29
|
+
release: {{ .Release.Name }}
|
|
30
|
+
spec:
|
|
31
|
+
{{- if .Values.image.pullSecret }}
|
|
32
|
+
imagePullSecrets:
|
|
33
|
+
- name: {{ .Values.image.pullSecret }}
|
|
34
|
+
{{- end }}
|
|
35
|
+
dnsPolicy: ClusterFirst
|
|
36
|
+
restartPolicy: Always
|
|
37
|
+
schedulerName: default-scheduler
|
|
38
|
+
securityContext: {}
|
|
39
|
+
terminationGracePeriodSeconds: 30
|
|
40
|
+
tolerations:
|
|
41
|
+
{{- if and .Values.global.ENV_SHORT (eq .Values.global.ENV_SHORT "review")}}
|
|
42
|
+
- key: "stage"
|
|
43
|
+
operator: "Equal"
|
|
44
|
+
value: "review"
|
|
45
|
+
effect: "NoSchedule"
|
|
46
|
+
{{- end }}
|
|
47
|
+
{{- if .Values.application.worker.useExclusivePool }}
|
|
48
|
+
- key: "ch-panter-sla"
|
|
49
|
+
operator: "Equal"
|
|
50
|
+
value: "1"
|
|
51
|
+
effect: "NoSchedule"
|
|
52
|
+
{{- end }}
|
|
53
|
+
containers:
|
|
54
|
+
- name: {{ template "fullname" $context }}-worker
|
|
55
|
+
image: "{{ template "appImage" .}}"
|
|
56
|
+
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
57
|
+
command: ["/bin/sh", "-c"]
|
|
58
|
+
args:
|
|
59
|
+
- |
|
|
60
|
+
trap "touch /tmp/pod/main-terminated" EXIT
|
|
61
|
+
{{join " " (default .Values.application.command .Values.application.worker.command)}}
|
|
62
|
+
|
|
63
|
+
{{include "env" $context | nindent 8}}
|
|
64
|
+
- name: BACKGROUND_JOBS_ENABLED
|
|
65
|
+
value: "true"
|
|
66
|
+
- name: IS_WORKER
|
|
67
|
+
value: "true"
|
|
68
|
+
|
|
69
|
+
{{if .Values.application.worker.livenessProbe}}
|
|
70
|
+
livenessProbe:
|
|
71
|
+
httpGet:
|
|
72
|
+
{{ toYaml .Values.application.livenessProbe.httpGet | indent 12 }}
|
|
73
|
+
initialDelaySeconds: 10
|
|
74
|
+
timeoutSeconds: 10
|
|
75
|
+
periodSeconds: 30
|
|
76
|
+
failureThreshold: 100 # dont kill worker pod too early when cpu intensive stuff is done
|
|
77
|
+
{{- end }}
|
|
78
|
+
ports:
|
|
79
|
+
- containerPort: 8080
|
|
80
|
+
protocol: TCP
|
|
81
|
+
resources:
|
|
82
|
+
{{ toYaml .Values.application.worker.resources | indent 10 }}
|
|
83
|
+
terminationMessagePath: /dev/termination-log
|
|
84
|
+
terminationMessagePolicy: File
|
|
85
|
+
volumeMounts:
|
|
86
|
+
{{- range $key, $volume := .Values.application.volumes }}
|
|
87
|
+
- mountPath: {{$volume.mountPath}}
|
|
88
|
+
name: {{ template "fullname" $context }}-{{$volume.name}}
|
|
89
|
+
{{- end }}
|
|
90
|
+
{{if .Values.cloudsql.enabled}}
|
|
91
|
+
- {{- include "cloudSqlContainer" $context | nindent 8 }}
|
|
92
|
+
{{- end }}
|
|
93
|
+
volumes:
|
|
94
|
+
- name: tmp-pod
|
|
95
|
+
emptyDir: {}
|
|
96
|
+
{{- range $key, $volume := .Values.application.volumes }}
|
|
97
|
+
- name: {{ template "fullname" $context }}-{{$volume.name}}
|
|
98
|
+
persistentVolumeClaim:
|
|
99
|
+
claimName: {{ template "fullname" $context }}-{{$volume.name}}
|
|
100
|
+
{{- end }}
|
|
101
|
+
{{if .Values.cloudsql.enabled}}
|
|
102
|
+
- {{- include "cloudSqlCredentialsVolume" $context | nindent 10 }}
|
|
103
|
+
{{- end }}
|
|
104
|
+
{{- end -}}
|
package/dist/runner-images/kubernetes/helm-charts/the-panter-chart/templates/app.worker.service.yaml
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
{{- if .Values.application.worker.enabled -}}
|
|
3
|
+
{{- if .Values.application.worker.service.enabled -}}
|
|
4
|
+
{{- $context := . }}
|
|
5
|
+
apiVersion: v1
|
|
6
|
+
kind: Service
|
|
7
|
+
metadata:
|
|
8
|
+
labels:
|
|
9
|
+
app: {{ template "fullname" . }}-worker
|
|
10
|
+
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
|
|
11
|
+
release: {{ .Release.Name }}
|
|
12
|
+
heritage: {{ .Release.Service }}
|
|
13
|
+
name: {{ template "fullname" . }}-worker
|
|
14
|
+
namespace: {{ .Release.Namespace }}
|
|
15
|
+
spec:
|
|
16
|
+
type: {{ .Values.application.worker.service.type }}
|
|
17
|
+
ports:
|
|
18
|
+
- port: {{ .Values.application.worker.service.externalPort }}
|
|
19
|
+
targetPort: {{ .Values.application.worker.service.internalPort }}
|
|
20
|
+
protocol: TCP
|
|
21
|
+
name: {{ template "fullname" . }}-worker-service
|
|
22
|
+
{{- range $ports := .Values.application.worker.service.additionalPorts }}
|
|
23
|
+
- port: {{ required ".Values.application.worker.service.additionalPorts.port is required" $ports.port }}
|
|
24
|
+
targetPort: {{ $ports.targetPort | default $ports.port }}
|
|
25
|
+
protocol: {{ $ports.protocol | default "TCP" }}
|
|
26
|
+
name: {{ template "fullname" $context }}-{{ required ".Values.application.worker.service.additionalPorts.nameSuffix is required" $ports.nameSuffix }}-service
|
|
27
|
+
{{- end }}
|
|
28
|
+
selector:
|
|
29
|
+
app: {{ template "fullname" . }}-worker
|
|
30
|
+
release: {{ .Release.Name }}
|
|
31
|
+
sessionAffinity: None
|
|
32
|
+
type: NodePort
|
|
33
|
+
{{- end -}}
|
|
34
|
+
{{- end -}}
|
package/dist/runner-images/kubernetes/helm-charts/the-panter-chart/templates/mailhog.ingress.yaml
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{{- if .Values.mailhog.enabled -}}
|
|
2
|
+
#{{ $host := (default "mailhog.{{ template 'host' . }}" .Values.mailhog.host ) | quote }}
|
|
3
|
+
{{ $host := default (printf "mailhog.%s" (include "host" .)) .Values.mailhog.host }}
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
apiVersion: networking.k8s.io/v1
|
|
7
|
+
kind: Ingress
|
|
8
|
+
metadata:
|
|
9
|
+
name: {{ .Values.mailhog.fullnameOverride }} # unfortunatly due to history reasons we override the release name
|
|
10
|
+
labels:
|
|
11
|
+
app: {{ template "name" . }}
|
|
12
|
+
annotations:
|
|
13
|
+
kubernetes.io/ingress.class: nginx
|
|
14
|
+
kubernetes.io/tls-acme: "true"
|
|
15
|
+
spec:
|
|
16
|
+
rules:
|
|
17
|
+
- host: {{ $host }}
|
|
18
|
+
http:
|
|
19
|
+
paths:
|
|
20
|
+
- path: /
|
|
21
|
+
pathType: Prefix
|
|
22
|
+
backend:
|
|
23
|
+
service:
|
|
24
|
+
name: {{ .Values.mailhog.fullnameOverride }} # unfortunatly due to history reasons we override the release name
|
|
25
|
+
port:
|
|
26
|
+
number: 8025
|
|
27
|
+
tls:
|
|
28
|
+
- hosts:
|
|
29
|
+
- {{ $host }}
|
|
30
|
+
secretName: {{ $host | trunc 59 | trimSuffix "." }}-tls
|
|
31
|
+
|
|
32
|
+
{{- end -}}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{{- if (.Values.maintenance) }}
|
|
2
|
+
apiVersion: apps/v1
|
|
3
|
+
kind: Deployment
|
|
4
|
+
metadata:
|
|
5
|
+
annotations:
|
|
6
|
+
name: {{ template "fullname" . }}-maintenance
|
|
7
|
+
labels:
|
|
8
|
+
app: {{ .Release.Name }}
|
|
9
|
+
namespace: {{ .Release.Namespace }}
|
|
10
|
+
spec:
|
|
11
|
+
replicas: 1
|
|
12
|
+
selector:
|
|
13
|
+
matchLabels:
|
|
14
|
+
app: {{ template "fullname" . }}-maintenance
|
|
15
|
+
release: {{ .Release.Name }}
|
|
16
|
+
strategy:
|
|
17
|
+
rollingUpdate:
|
|
18
|
+
maxSurge: 1
|
|
19
|
+
maxUnavailable: 1
|
|
20
|
+
type: RollingUpdate
|
|
21
|
+
template:
|
|
22
|
+
metadata:
|
|
23
|
+
labels:
|
|
24
|
+
app: {{ template "fullname" . }}-maintenance
|
|
25
|
+
release: {{ .Release.Name }}
|
|
26
|
+
spec:
|
|
27
|
+
{{- if .Values.image.pullSecret }}
|
|
28
|
+
imagePullSecrets:
|
|
29
|
+
- name: {{ .Values.image.pullSecret }}
|
|
30
|
+
{{- end }}
|
|
31
|
+
containers:
|
|
32
|
+
- image: {{ .Values.maintenance.image }}
|
|
33
|
+
imagePullPolicy: Always
|
|
34
|
+
name: {{ template "fullname" . }}-maintenance
|
|
35
|
+
resources: {}
|
|
36
|
+
securityContext:
|
|
37
|
+
privileged: false
|
|
38
|
+
terminationMessagePath: /dev/termination-log
|
|
39
|
+
terminationMessagePolicy: File
|
|
40
|
+
dnsPolicy: ClusterFirst
|
|
41
|
+
restartPolicy: Always
|
|
42
|
+
schedulerName: default-scheduler
|
|
43
|
+
securityContext: {}
|
|
44
|
+
terminationGracePeriodSeconds: 30
|
|
45
|
+
{{- end }}
|
package/dist/runner-images/kubernetes/helm-charts/the-panter-chart/templates/maintenance.service.yml
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{{- if (.Values.maintenance) }}
|
|
2
|
+
apiVersion: v1
|
|
3
|
+
kind: Service
|
|
4
|
+
metadata:
|
|
5
|
+
annotations:
|
|
6
|
+
name: {{ template "fullname" . }}-maintenance
|
|
7
|
+
labels:
|
|
8
|
+
app: {{ .Release.Name }}
|
|
9
|
+
namespace: {{ .Release.Namespace }}
|
|
10
|
+
spec:
|
|
11
|
+
ports:
|
|
12
|
+
- port: 80
|
|
13
|
+
protocol: TCP
|
|
14
|
+
targetPort: 80
|
|
15
|
+
name: {{ template "fullname" . }}-maintenance-service
|
|
16
|
+
selector:
|
|
17
|
+
app: {{ template "fullname" . }}-maintenance
|
|
18
|
+
release: {{ .Release.Name }}
|
|
19
|
+
sessionAffinity: None
|
|
20
|
+
type: ClusterIP
|
|
21
|
+
status:
|
|
22
|
+
loadBalancer: {}
|
|
23
|
+
|
|
24
|
+
{{- end }}
|