Skip to content

Commit 5494ee3

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 96cdea7 + 61e733f commit 5494ee3

File tree

13 files changed

+150
-79
lines changed

13 files changed

+150
-79
lines changed

.ci/ct-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
chart-repos:
55
- haproxy=https://haproxytech.github.io/helm-charts
66

7-
lint-conf: .ci/lint-config.yaml
7+
lint-conf: .ci/lint-config.yaml
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Linting
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'charts/**'
7+
- '.github/**'
8+
9+
jobs:
10+
ct-lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v1
15+
16+
- name: Run chart-testing (lint)
17+
id: lint
18+
uses: helm/chart-testing-action@v1.0.0-rc.2
19+
with:
20+
config: .ci/ct-config.yaml
21+
command: lint
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
name: Lint and Test Charts
1+
name: Testing
22

33
on:
4-
push:
4+
pull_request:
55
paths:
66
- 'charts/**'
77
- '.github/**'
88

99
jobs:
10-
lint-test:
10+
ct-test:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout
1414
uses: actions/checkout@v1
1515

1616
- name: Run chart-testing (lint)
1717
id: lint
18-
uses: helm/chart-testing-action@v1.0.0-rc.1
18+
uses: helm/chart-testing-action@v1.0.0-rc.2
1919
with:
2020
config: .ci/ct-config.yaml
2121
command: lint
2222

2323
- name: Create kind cluster
24-
uses: helm/kind-action@v1.0.0-alpha.3
24+
uses: helm/kind-action@v1.0.0-rc.1
2525
with:
2626
install_local_path_provisioner: true
2727
# Only build a kind cluster if there are chart changes to test.
2828
if: steps.lint.outputs.changed == 'true'
2929

3030
- name: Run chart-testing (install)
31-
uses: helm/chart-testing-action@v1.0.0-rc.1
31+
uses: helm/chart-testing-action@v1.0.0-rc.2
3232
with:
3333
command: install
3434
config: .ci/ct-config.yaml

.github/workflows/on-push-master-publish-chart.yml

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,6 @@ jobs:
1515

1616
steps:
1717
- uses: actions/checkout@v2
18-
# - uses: azure/setup-helm@v1
19-
# id: installhelm3
20-
# with:
21-
# version: 'v3.0.3'
22-
# - name: Publish helm charts
23-
# uses: funkypenguin/helm-gh-pages-action@v1.1.1
24-
# with:
25-
# # A personal access token needed to push your site after it has been built.
26-
# access-token: ${{ secrets.CR_TOKEN }}
27-
# # The branch expected by GitHub to have the static files needed for your site.
28-
# deploy-branch: chart
29-
# # The folder in which the helm charts are located
30-
# charts-folder: charts
3118

3219
- name: Fetch history
3320
run: git fetch --prune --unshallow
@@ -49,18 +36,10 @@ jobs:
4936
env:
5037
CR_TOKEN: "${{ secrets.CR_TOKEN }}"
5138

52-
# - name: Discord notification
53-
# env:
54-
# DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
55-
# uses: Ilshidur/action-discord@master
56-
# with:
57-
# args: |
58-
# Greetings, geeks! 🤓
59-
60-
# A new/updated helm ⎈ chart is fresh out of the oven!
61-
62-
# Here's what's changed:
63-
# > ${{github.event.commits[0].message}}
64-
65-
# Get more details at:
66-
# {{ EVENT_PAYLOAD.compare }}
39+
- name: Emit repository_dispatch
40+
uses: mvasigh/dispatch-action@master
41+
with:
42+
token: ${{ secrets.CR_TOKEN }}
43+
repo: charts
44+
owner: geek-cookbook
45+
event_type: chart_update

TESTING.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# How this chart is tested
2+
3+
# Automated tests
4+
5+
Every pull request to the master branch trigger the following tests:
6+
7+
* ct lint
8+
* ct install
9+
10+
11+
[![Linting](https://github.com/funkypenguin/helm-docker-mailserver/workflows/Linting/badge.svg)](.github/workflows/on-pr-lint-charts.yml)
12+
[![Testing](https://github.com/funkypenguin/helm-docker-mailserver/workflows/Testing/badge.svg)](.github/workflows/on-pr-test-charts.yml)
13+
14+
15+
# Local testing
16+
17+
If you're submitting a PR, and you want to ensure your changes will pass automated testing (above), here are your options:
18+
19+
## Linting
20+
21+
We use helm's [chart-testing](https://github.com/helm/chart-testing) tool to lint our charts. The tool can be installed locally, or it can be run in a Docker container.
22+
23+
To run in Docker:
24+
25+
1. Have Docker installed
26+
2. Run `./ci/scripts/local-lint`
27+
28+
To run locally:
29+
30+
1. Have ct installed (Get a binary package from https://github.com/helm/chart-testing/releases)
31+
2. Run `ct lint --config=.ci/ct-config.yaml`
32+
33+
## Deployment testing
34+
35+
*ct* can also test a chart by deploying it to a temporary namespace in a Kubernetes cluster, and waiting for indications that the deployment has been successful. This is a good way to test how the deployment behaves "for real".
36+
37+
38+
39+
40+
ct lint --config=.ci/ct-config.yaml
41+
42+
Create a KinD cluster, by running `kind create cluster`:
43+
44+
```
45+
❯ kind create cluster
46+
Creating cluster "kind" ...
47+
✓ Ensuring node image (kindest/node:v1.17.0) 🖼
48+
✓ Preparing nodes 📦
49+
✓ Writing configuration 📜
50+
✓ Starting control-plane 🕹️
51+
✓ Installing CNI 🔌
52+
✓ Installing StorageClass 💾
53+
Set kubectl context to "kind-kind"
54+
You can now use your cluster with:
55+
56+
kubectl cluster-info --context kind-kind
57+
58+
Have a nice day! 👋
59+
```
60+
61+
Trigger a `ct install` test against the KinD cluster, by running `t install --config=.ci/ct-config.yaml`. **ct** will target your current context (be careful if you've got multiple contexts configured!), create a temporary namespace, and deploy the chart into that namespace, until `helm --wait` indicates success. After this, the helm release will be removed, the namespace deleted, and you can retire your KinD cluster by running `kind delete cluster`.

charts/docker-mailserver/Chart.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
apiVersion: v1
2-
appVersion: "6.3.0"
2+
appVersion: "7.0.0"
33
description: A fullstack but simple mailserver (smtp, imap, antispam, antivirus, ssl...) using Docker.
44
name: docker-mailserver
5-
version: 0.2.4-pre1
5+
version: 0.2.7
66
sources:
77
- https://github.com/funkypenguin/helm-docker-mailserver
88
maintainers:
@@ -14,4 +14,4 @@ keywords:
1414
- dovecot
1515
- amavis
1616
- imap
17-
home: https://github.com/funkypenguin/helm-docker-mailserver
17+
home: https://github.com/funkypenguin/helm-docker-mailserver

charts/docker-mailserver/templates/_upstream-env-variables.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ We list them here (and include this template in deployment.yaml) to keep deploym
1818
- name: SMTP_ONLY
1919
value: {{ .Values.pod.dockermailserver.smtp_only | quote }}
2020
- name: SSL_TYPE
21-
value: {{ default "manual" .Values.pod.dockermailserver.ssl_type | quote }}
21+
value: {{ .Values.pod.dockermailserver.ssl_type | quote }}
2222
- name: SSL_CERT_PATH
2323
value: {{ default "/tmp/ssl/tls.crt" .Values.pod.dockermailserver.ssl_cert_path | quote }}
2424
- name: SSL_KEY_PATH

charts/docker-mailserver/templates/certificate-crd.yaml renamed to charts/docker-mailserver/templates/certificate.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ spec:
1919
domains:
2020
- '*.{{ default "example.com" .Values.ssl.dnsname }}'
2121
- {{ default "example.com" .Values.ssl.dnsname }}
22-
{{- end -}}
22+
{{- end -}}

charts/docker-mailserver/templates/configmap.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ data:
3434
{{- if .Values.haproxy.enabled }} # Necessary to permit proxy protocol from haproxy to postscreen
3535
postscreen_upstream_proxy_protocol = haproxy
3636
{{ end }}
37-
{{ if .Values.spfTestsDisabled }}
38-
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, reject_unauth_pipelining, reject_invalid_helo_hostname, reject_non_fqdn_helo_hostname, reject_unknown_recipient_domain, reject_rbl_client zen.spamhaus.org, reject_rbl_client bl.spamcop.net
37+
{{ if not .Values.spfTestsDisabled }}
38+
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, reject_unauth_pipelining, reject_invalid_helo_hostname, reject_non_fqdn_helo_hostname, reject_unknown_recipient_domain, reject_rbl_client zen.spamhaus.org, reject_rbl_client bl.spamcop.net{{ range .Values.rblRejectDomains }}, reject_rbl_client {{ . }}{{ end }}
3939
{{ end -}}
40-
dovecot.cf: |
40+
dovecot-services.cf: |
4141
{{- if .Values.haproxy.enabled }}
4242
haproxy_trusted_networks = {{ .Values.haproxy.trustedNetworks }}
4343
{{ end }}
@@ -114,4 +114,4 @@ data:
114114
{{ . }} && \
115115
{{- end }}
116116
echo "All healthy"
117-
{{- end -}}
117+
{{- end -}}

charts/docker-mailserver/templates/deployment.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ metadata:
88
heritage: "{{ .Release.Service }}"
99
release: "{{ .Release.Name }}"
1010
name: {{ template "dockermailserver.fullname" . }}
11+
{{- if .Values.deployment.annotations }}
12+
annotations:
13+
{{ toYaml .Values.deployment.annotations | indent 4 }}
14+
{{ end }}
1115
spec:
1216
replicas: {{ default 2 .Values.deployment.replicas }}
1317
selector:
@@ -87,6 +91,10 @@ spec:
8791
- name: data
8892
mountPath: /var/mail-state
8993
subPath: mail-state
94+
- name: configmap
95+
subPath: dovecot-services.cf
96+
mountPath: /etc/dovecot/conf.d/services.cf
97+
readOnly: true
9098
- name: configmap
9199
subPath: dovecot.cf
92100
mountPath: /etc/dovecot/conf.d/zz-custom.cf
@@ -134,13 +142,13 @@ spec:
134142
command:
135143
- /bin/bash
136144
- /tmp/docker-mailserver/am-i-healthy.sh
137-
initialDelaySeconds: 600
138-
timeoutSeconds: 60
139-
failureThreshold: 3
145+
initialDelaySeconds: 60
146+
timeoutSeconds: 10
147+
failureThreshold: 2
140148
readinessProbe:
141149
tcpSocket:
142150
port: 25
143-
initialDelaySeconds: 600
151+
initialDelaySeconds: 60
144152
periodSeconds: 20
145153
timeoutSeconds: 1
146154
failureThreshold: 3

0 commit comments

Comments
 (0)