Skip to content

Commit bcd5bdf

Browse files
authored
Merge pull request #4 from papercups-io/jimp/issue/4
doc(papercups): fix notes
2 parents f6b24e7 + 971bc4b commit bcd5bdf

File tree

9 files changed

+89
-54
lines changed

9 files changed

+89
-54
lines changed

.github/ct.yaml

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
chart-repos:
2-
- papercups=https://papercups-io.datadoghq.com/papercups
2+
- papercups-io=https://papercups-io.github.io/charts/
3+
- bitnami=https://charts.bitnami.com/bitnami
34
helm-extra-args: --timeout 300s
45
check-version-increment: true
5-
debug: true
6+
debug: false
7+
target-branch: main
8+
namespace: default
9+
release-label: "app.kubernetes.io/instance"

.github/helm-docs.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ curl --silent --show-error --fail --location --output /tmp/helm-docs.tar.gz http
99
tar -xf /tmp/helm-docs.tar.gz helm-docs
1010

1111
# validate docs
12-
./helm-docs
13-
git diff --exit-code
12+
./helm-docs

.github/workflows/ci.yml

+57-34
Original file line numberDiff line numberDiff line change
@@ -6,49 +6,49 @@ on:
66
- "charts/**"
77

88
jobs:
9+
update-docs:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
- name: Run helm-docs
15+
run: .github/helm-docs.sh
16+
- name: commit changes
17+
uses: stefanzweifel/git-auto-commit-action@v4.6.0
18+
with:
19+
commit_message: ":robot: update docs [skip ci]"
20+
repository: .
21+
922
changed:
1023
runs-on: ubuntu-latest
1124
outputs:
1225
charts: ${{ steps.list-changed.outputs.changed }}
1326
steps:
1427
- name: Checkout
15-
uses: actions/checkout@v1
28+
uses: actions/checkout@v2
29+
with:
30+
fetch-depth: 0
31+
- name: Set up Helm
32+
uses: azure/setup-helm@v1
33+
with:
34+
version: v3.4.0
35+
- uses: actions/setup-python@v2
36+
with:
37+
python-version: 3.7
1638
- name: Set up chart-testing
1739
uses: helm/chart-testing-action@v2.0.1
1840
- name: Run chart-testing (list-changed)
1941
id: list-changed
2042
run: |
21-
changed=$(ct list-changed)
43+
changed=$(ct list-changed --config .github/ct.yaml)
2244
if [[ -n "$changed" ]]; then
2345
echo -n "Charts changed:"
2446
echo "$changed"
2547
echo "::set-output name=changed::$changed"
26-
else
27-
echo "PR without any chart changes - failing"
28-
exit 1
2948
fi
30-
lint-chart:
31-
runs-on: ubuntu-latest
32-
needs:
33-
- changed
34-
steps:
35-
- name: Checkout
36-
uses: actions/checkout@v1
37-
- name: Set up chart-testing
38-
uses: helm/chart-testing-action@v2.0.1
3949
- name: Run chart-testing (lint)
4050
run: ct lint --config .github/ct.yaml
4151

42-
lint-docs:
43-
runs-on: ubuntu-latest
44-
needs:
45-
- changed
46-
steps:
47-
- name: Checkout
48-
uses: actions/checkout@v1
49-
- name: Run helm-docs
50-
run: .github/helm-docs.sh
51-
5252
kubeval-chart:
5353
runs-on: ubuntu-latest
5454
needs:
@@ -57,12 +57,20 @@ jobs:
5757
matrix:
5858
# When changing versions here, check that the version exists at: https://github.com/instrumenta/kubernetes-json-schema
5959
k8s:
60-
- v1.14.10
61-
- v1.16.4
60+
- v1.17.4
6261
- v1.18.1
6362
steps:
6463
- name: Checkout
65-
uses: actions/checkout@v1
64+
uses: actions/checkout@v2
65+
with:
66+
fetch-depth: 0
67+
- name: Set up Helm
68+
uses: azure/setup-helm@v1
69+
with:
70+
version: v3.4.0
71+
- uses: actions/setup-python@v2
72+
with:
73+
python-version: 3.7
6674
- name: Add papercups helm repo
6775
run: helm repo add papercups-io https://papercups-io.github.io/charts && helm repo update
6876
- name: Run kubeval
@@ -75,23 +83,38 @@ jobs:
7583
name: install-chart
7684
runs-on: ubuntu-latest
7785
needs:
78-
- lint-chart
7986
- kubeval-chart
8087
strategy:
8188
matrix:
89+
# When changing versions here, check that the version exists at: https://hub.docker.com/r/kindest/node/tags?page=1&ordering=last_updated
8290
k8s:
83-
- v1.14.10
84-
- v1.16.9
85-
- v1.18.4
91+
- v1.16.15
92+
- v1.17.17
93+
- v1.18.15
94+
- v1.19.7
95+
- v1.20.2
8696
steps:
8797
- name: Checkout
88-
uses: actions/checkout@v1
98+
uses: actions/checkout@v2
99+
with:
100+
fetch-depth: 0
101+
- name: Set up Helm
102+
uses: azure/setup-helm@v1
103+
with:
104+
version: v3.4.0
105+
- uses: actions/setup-python@v2
106+
with:
107+
python-version: 3.7
89108
- name: Create kind ${{ matrix.k8s }} cluster
90-
uses: helm/kind-action@master
109+
uses: helm/kind-action@v1.0.0
91110
with:
92111
node_image: kindest/node:${{ matrix.k8s }}
93112
- name: Set up chart-testing
94113
uses: helm/chart-testing-action@v2.0.1
114+
- name: helm repo add bitnami
115+
run: helm repo add bitnami https://charts.bitnami.com/bitnami
116+
- name: Install postgresql dependency
117+
run: helm install papercups-db bitnami/postgresql --set postgresqlUsername=papercups,postgresqlPassword=changeit,postgresqlDatabase=papercups
95118
- name: Run chart-testing (install)
96119
run: ct install --config .github/ct.yaml
97120

@@ -102,4 +125,4 @@ jobs:
102125
- install-chart
103126
steps:
104127
- name: validate
105-
run: echo "PR OK"
128+
run: echo "PR passed chart-testing install"

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ $ helm repo update
99

1010
## Before you begin
1111
### Prerequisites
12-
- [Kubernetes 1.20+](http://kubernetes.io/docs/getting-started-guides/)
13-
- [Helm 3.3](https://github.com/helm/helm#install)
12+
- [Kubernetes 1.17.4+](http://kubernetes.io/docs/getting-started-guides/)
13+
- [Helm 3.4+](https://github.com/helm/helm#install)
1414

1515
### Add Repo
1616
```

charts/papercups/Chart.yaml

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ description: A Helm chart to deploy the papercups chat server to Kubernetes
44
type: application
55

66
# This is the chart version.
7-
version: 0.1.0
7+
version: 0.1.1
88

99
# This is the version number of the application being deployed.
1010
appVersion: "latest"
11+
12+
maintainers:
13+
- name: jim80net
14+
email: jim@ramtank.com
15+
url: https://github.com/jim80net
16+
icon: https://papercups.io/papercups-v2.svg

charts/papercups/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Papercups Helm Chart
22

3-
![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square)
3+
![Version: 0.1.1](https://img.shields.io/badge/Version-0.1.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square)
44

55
This chart was designed to deploy [papercups](https://papercups.io) to your Kubernetes cluster.
66

@@ -43,7 +43,7 @@ $ helm install papercups-db bitnami/postgresql --set postgresqlUsername=papercup
4343
| image.tag | string | `"latest@sha256:3c369ea5d68b258c88b12c9fbdfa97e651e4a5b6136f4651553afd217fa55299"` | Override the image tag |
4444
| imagePullSecrets | list | `[]` | |
4545
| ingress | object | `{"annotations":{},"enabled":false,"hosts":[{"host":"papercups.example.com","paths":[]}],"tls":[]}` | TODO: This is untested |
46-
| initialize_database.enabled | bool | `true` | Create the databases upon install/upgrade. This runs in a distinct job. This is idempotent, but you can disable this if you want. |
46+
| initialize_database.enabled | bool | `true` | Create the databases upon install/upgrade. This runs in a distinct job. This is idempotent, but you can disable this if you want. |
4747
| migration.enabled | bool | `true` | Perform a DB migration upon install/upgrade. This runs in a distinct job. |
4848
| nameOverride | string | `""` | Override name of app |
4949
| nodeSelector | object | `{}` | Allow the Deployment to be scheduled on selected nodes |
@@ -54,7 +54,7 @@ $ helm install papercups-db bitnami/postgresql --set postgresqlUsername=papercup
5454
| secrets.DATABASE_URL | string | `"ecto://papercups:changeit@papercups-db-postgresql.default.svc.cluster.local/papercups"` | The connection parameters for ecto to connect to postgresql |
5555
| secrets.SECRET_KEY_BASE | string | `"dvPPvOjpgX2Wk8Y3ONrqWsgM9ZtU4sSrs4l/5CFD1sLm4H+CjLU+EidjNGuSz7bz"` | The secret Phoenix uses to sign and encrypt important information |
5656
| securityContext | object | `{}` | SecurityContext holds security configuration that will be applied to a container. |
57-
| service.port | int | `443` | |
57+
| service.port | int | `4000` | |
5858
| service.type | string | `"ClusterIP"` | |
5959
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
6060
| serviceAccount.create | bool | `true` | Specifies whether a service account should be created |

charts/papercups/templates/NOTES.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
echo http://$SERVICE_IP:{{ .Values.service.port }}
1717
{{- else if contains "ClusterIP" .Values.service.type }}
1818
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "papercups.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
19-
echo "Visit http://127.0.0.1:8080 to use your application"
20-
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80
19+
echo "Visit http://127.0.0.1:4000 to use your application"
20+
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 4000
2121
{{- end }}

charts/papercups/templates/tests/test-connection.yaml

+8-5
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ metadata:
88
"helm.sh/hook": test-success
99
spec:
1010
containers:
11-
- name: wget
12-
image: busybox
13-
command: ['wget']
14-
args: ['{{ include "papercups.fullname" . }}:{{ .Values.service.port }}']
15-
restartPolicy: Never
11+
- name: curl
12+
image: curlimages/curl:7.75.0
13+
command: ['curl']
14+
args: [
15+
'--silent',
16+
'http://{{ include "papercups.fullname" . }}:{{ .Values.service.port }}/api/ping'
17+
]
18+
restartPolicy: Never

charts/papercups/values.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ securityContext: {}
5151

5252
service:
5353
type: ClusterIP
54-
port: 443
54+
port: 4000
5555

5656
# -- TODO: This is untested
5757
ingress:
@@ -113,6 +113,6 @@ migration:
113113
enabled: true
114114

115115
initialize_database:
116-
# -- Create the databases upon install/upgrade. This runs in a distinct job.
116+
# -- Create the databases upon install/upgrade. This runs in a distinct job.
117117
# This is idempotent, but you can disable this if you want.
118-
enabled: true
118+
enabled: true

0 commit comments

Comments
 (0)