Skip to content

Commit eb23bf5

Browse files
authored
Fix chart test CI (#81)
1 parent e9c594c commit eb23bf5

File tree

6 files changed

+38
-36
lines changed

6 files changed

+38
-36
lines changed

.github/workflows/helmchart-release.yml

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: Release Charts
33
on:
44
push:
55
branches: [master]
6+
paths:
7+
- 'charts/**'
8+
- '.github/workflows/helmchart-release.yml'
69

710
jobs:
811
release:

.github/workflows/main.yml

+20-28
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,18 @@ jobs:
1717

1818
- name: Docker meta
1919
id: docker_meta
20-
uses: crazy-max/ghaction-docker-meta@v1
20+
uses: docker/metadata-action@v3
2121
with:
2222
images: caddy/ingress
23-
tag-sha: true
23+
tags: |
24+
type=semver,pattern={{raw}}
25+
type=ref,event=branch
26+
type=ref,event=pr
27+
type=sha
2428
2529
- name: Set up Docker Buildx
2630
uses: docker/setup-buildx-action@v1
2731

28-
- name: Cache Docker layers
29-
uses: actions/cache@v2
30-
with:
31-
path: /tmp/.buildx-cache
32-
key: ${{ runner.os }}-buildx-${{ github.sha }}
33-
restore-keys: |
34-
${{ runner.os }}-buildx-
35-
3632
- name: Login to DockerHub
3733
uses: docker/login-action@v1
3834
with:
@@ -46,8 +42,8 @@ jobs:
4642
push: true
4743
tags: ${{ steps.docker_meta.outputs.tags }}
4844
labels: ${{ steps.docker_meta.outputs.labels }}
49-
cache-from: type=local,src=/tmp/.buildx-cache
50-
cache-to: type=local,dest=/tmp/.buildx-cache
45+
cache-from: type=gha
46+
cache-to: type=gha,mode=max
5147

5248
lint-test:
5349
name: Test and lint charts
@@ -60,29 +56,25 @@ jobs:
6056
with:
6157
fetch-depth: 0
6258

63-
- name: Set up chart-testing
64-
uses: helm/[email protected]
59+
- name: Set up Helm
60+
uses: azure/setup-helm@v1
61+
with:
62+
version: v3.8.1
6563

66-
- name: Run chart-testing (list-changed)
67-
id: list-changed
68-
run: |
69-
changed=$(ct list-changed)
70-
if [[ -n "$changed" ]]; then
71-
echo "::set-output name=changed::true"
72-
fi
64+
- uses: actions/setup-python@v2
65+
with:
66+
python-version: 3.7
67+
68+
- name: Set up chart-testing
69+
uses: helm/[email protected]
7370

7471
- name: Run chart-testing (lint)
75-
run: ct lint
72+
run: ct lint --config ct.yaml
7673

7774
- name: Create kind cluster
78-
uses: helm/[email protected]
79-
with:
80-
version: "v0.9.0"
81-
# Only build a kind cluster if there are chart changes to test.
82-
if: steps.list-changed.outputs.changed == 'true'
75+
uses: helm/[email protected]
8376

8477
- name: Install MetalLB to allow LoadBalancer services
85-
if: steps.list-changed.outputs.changed == 'true'
8678
run: |
8779
kubectl create ns metallb-system
8880
kubectl apply -f https://raw.githubusercontent.com/google/metallb/v0.9.3/manifests/metallb.yaml

CONTRIBUTING.md

+13
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,16 @@ curl -H 'Host: example2.kubernetes.localhost http://127.0.0.1:80/hello2
5858
- You can change local port forwarded by skaffold by changing the port values in the `skaffold.yaml` file on section `portForward` `localPort`. Remind that you can forward only port greather than 1024 if you execute it as non root user
5959
- You can delete your local cluster with the command `kind delete cluster`
6060
- To use TLS your domain should be publically resolved to your cluster IP in order to allow Let's Encript to validate the domain
61+
62+
## Releasing new helm chart version
63+
64+
If you want to release a new version of the `caddy-ingress-controller` chart, you'll need
65+
to create a new PR with:
66+
- The new chart's `version` in `Chart.yaml`
67+
- The new `image.tag` in `values.yaml` (if you want to update the default image used in the chart)
68+
- The new `appVersion` in `Chart.yaml` (if you did the previous line)
69+
70+
## Releasing a new app version
71+
72+
To release a new caddy-ingress-controller image, you need to create a new semver tag.
73+
It will build and push an image to https://hub.docker.com/r/caddy/ingress.

charts/caddy-ingress-controller/Chart.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ description: A helm chart for the Caddy Kubernetes ingress controller
55
icon: https://caddyserver.com/resources/images/caddy-circle-lock.svg
66
type: application
77
version: 0.0.1-rc4
8+
appVersion: "0.1.0"
89
keywords:
910
- ingress-controller
1011
- caddyserver

charts/caddy-ingress-controller/values.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ minikube: false
99
image:
1010
repository: caddy/ingress
1111
pullPolicy: IfNotPresent
12-
tag: "latest"
12+
tag: "v0.1.0"
1313

1414
imagePullSecrets: []
1515
nameOverride: ""

ct.yaml

-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
11
# See https://github.com/helm/chart-testing#configuration
2-
remote: origin
3-
validate-maintainers: true
4-
validate-chart-schema: true
5-
validate-yaml: true
6-
check-version-increment: true
72
all: true
8-
chart-dirs:
9-
- charts
103
helm-extra-args: --timeout 600s

0 commit comments

Comments
 (0)