mirror of
https://github.com/eliasstepanik/caddy-ingess.git
synced 2026-01-09 19:48:28 +00:00
Add goreleaser and bump chart to v1.0.1 (#92)
This commit is contained in:
parent
16312f5480
commit
dc93125700
78
.github/workflows/main.yml
vendored
78
.github/workflows/main.yml
vendored
@ -1,60 +1,27 @@
|
||||
name: Lint and Test Charts
|
||||
name: Checks
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
tags:
|
||||
- 'v*'
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
docker-build:
|
||||
go-tests:
|
||||
name: Run tests
|
||||
runs-on: ubuntu-latest
|
||||
name: Building Docker Image
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Docker meta
|
||||
id: docker_meta
|
||||
uses: docker/metadata-action@v3
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
images: caddy/ingress
|
||||
tags: |
|
||||
type=semver,pattern={{raw}}
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=sha
|
||||
go-version: 1.16
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
- name: Test
|
||||
run: go test -v ./...
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Login to DockerHub
|
||||
# Forks don't have push access to docker
|
||||
if: github.repository == 'caddyserver/ingress'
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Build and push
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
push: ${{ github.repository == 'caddyserver/ingress' }}
|
||||
tags: ${{ steps.docker_meta.outputs.tags }}
|
||||
labels: ${{ steps.docker_meta.outputs.labels }}
|
||||
platforms: linux/amd64,linux/arm64
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
lint-test:
|
||||
chart-test-current:
|
||||
name: Test and lint charts
|
||||
needs:
|
||||
- docker-build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
@ -67,6 +34,11 @@ jobs:
|
||||
with:
|
||||
version: v3.8.1
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
with:
|
||||
platforms: arm64
|
||||
|
||||
- uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.7
|
||||
@ -77,6 +49,13 @@ jobs:
|
||||
- name: Run chart-testing (lint)
|
||||
run: ct lint --config ct.yaml
|
||||
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v2
|
||||
with:
|
||||
distribution: goreleaser
|
||||
version: latest
|
||||
args: release --snapshot --rm-dist
|
||||
|
||||
- name: Create kind cluster
|
||||
uses: helm/kind-action@v1.2.0
|
||||
|
||||
@ -99,17 +78,8 @@ jobs:
|
||||
- 172.17.255.1-172.17.255.200
|
||||
EOF
|
||||
|
||||
- name: Get image tag
|
||||
id: image-tag
|
||||
run: echo "::set-output name=data::$(echo ${GITHUB_SHA} | cut -c1-7)"
|
||||
|
||||
- name: Set current image tag
|
||||
working-directory: charts/caddy-ingress-controller
|
||||
# Forks don't have push access to docker so don't use it in tests
|
||||
if: github.repository == 'caddyserver/ingress'
|
||||
run: envsubst < ci/test-values.yaml.tpl > ci/test-values.yaml
|
||||
env:
|
||||
TAG: ${{ steps.image-tag.outputs.data }}
|
||||
- name: Load image into Kind cluster
|
||||
run: kind load docker-image "caddy/ingress:test-image" --name chart-testing
|
||||
|
||||
- name: Run chart-testing (install)
|
||||
run: ct install --config ct.yaml
|
||||
|
||||
@ -5,7 +5,7 @@ on:
|
||||
branches: [master]
|
||||
paths:
|
||||
- 'charts/**'
|
||||
- '.github/workflows/helmchart-release.yml'
|
||||
- '.github/workflows/release-controller.yml'
|
||||
|
||||
jobs:
|
||||
release:
|
||||
36
.github/workflows/release-controller.yml
vendored
Normal file
36
.github/workflows/release-controller.yml
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
name: Release Controller
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
goreleaser:
|
||||
runs-on: ubuntu-latest
|
||||
name: GoReleaser release
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.16
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v2
|
||||
with:
|
||||
distribution: goreleaser
|
||||
version: latest
|
||||
args: release --rm-dist
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
24
.github/workflows/tests.yml
vendored
24
.github/workflows/tests.yml
vendored
@ -1,24 +0,0 @@
|
||||
name: Go
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
name: Build and Test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.16
|
||||
|
||||
- name: Build
|
||||
run: go build -v ./...
|
||||
|
||||
- name: Test
|
||||
run: go test -v ./...
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,4 +1,5 @@
|
||||
.DS_Store
|
||||
bin
|
||||
vendor
|
||||
.idea/
|
||||
.idea/
|
||||
dist/
|
||||
|
||||
45
.goreleaser.yaml
Normal file
45
.goreleaser.yaml
Normal file
@ -0,0 +1,45 @@
|
||||
before:
|
||||
hooks:
|
||||
- go mod tidy
|
||||
builds:
|
||||
- main: ./cmd/caddy
|
||||
binary: ingress-controller
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
goos:
|
||||
- linux
|
||||
goarch:
|
||||
- amd64
|
||||
- arm64
|
||||
|
||||
dockers:
|
||||
- image_templates:
|
||||
- "caddy/ingress:test-image"
|
||||
use: buildx
|
||||
dockerfile: Dockerfile
|
||||
skip_push: "true"
|
||||
build_flag_templates:
|
||||
- "--platform=linux/amd64"
|
||||
|
||||
- image_templates:
|
||||
- "caddy/ingress:{{ .Tag }}-amd64"
|
||||
use: buildx
|
||||
dockerfile: Dockerfile
|
||||
build_flag_templates:
|
||||
- "--platform=linux/amd64"
|
||||
|
||||
- image_templates:
|
||||
- "caddy/ingress:{{ .Tag }}-arm64v8"
|
||||
use: buildx
|
||||
dockerfile: Dockerfile
|
||||
build_flag_templates:
|
||||
- "--platform=linux/arm64/v8"
|
||||
|
||||
docker_manifests:
|
||||
- name_template: "caddy/ingress:{{ .Tag }}"
|
||||
image_templates:
|
||||
- "caddy/ingress:{{ .Tag }}-amd64"
|
||||
- "caddy/ingress:{{ .Tag }}-arm64v8"
|
||||
|
||||
release:
|
||||
disable: true
|
||||
18
Dockerfile
18
Dockerfile
@ -1,20 +1,10 @@
|
||||
FROM golang:1.16.7-alpine AS builder
|
||||
WORKDIR /app
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY ./cmd ./cmd
|
||||
COPY ./pkg ./pkg
|
||||
COPY ./internal ./internal
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./bin/ingress-controller ./cmd/caddy
|
||||
|
||||
FROM alpine:latest AS certs
|
||||
RUN apk --update add ca-certificates
|
||||
|
||||
FROM alpine:latest
|
||||
COPY --from=builder /app/bin/ingress-controller .
|
||||
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
||||
|
||||
EXPOSE 80 443
|
||||
ENTRYPOINT ["/ingress-controller"]
|
||||
|
||||
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
||||
COPY ingress-controller /
|
||||
|
||||
@ -4,8 +4,8 @@ home: https://github.com/caddyserver/ingress
|
||||
description: A helm chart for the Caddy Kubernetes ingress controller
|
||||
icon: https://caddyserver.com/resources/images/caddy-circle-lock.svg
|
||||
type: application
|
||||
version: 1.0.0
|
||||
appVersion: "0.1.0"
|
||||
version: 1.0.1
|
||||
appVersion: "0.1.1"
|
||||
keywords:
|
||||
- ingress-controller
|
||||
- caddyserver
|
||||
|
||||
2
charts/caddy-ingress-controller/ci/test-values.yaml
Normal file
2
charts/caddy-ingress-controller/ci/test-values.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
image:
|
||||
tag: test-image
|
||||
@ -1,2 +0,0 @@
|
||||
image:
|
||||
tag: sha-${TAG}
|
||||
@ -126,6 +126,10 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"experimentalSmartSort": {
|
||||
"$id": "#/properties/ingressController/properties/config/properties/experimentalSmartSort",
|
||||
"type": "boolean"
|
||||
},
|
||||
"metrics": {
|
||||
"$id": "#/properties/ingressController/properties/config/properties/metrics",
|
||||
"type": "boolean"
|
||||
|
||||
@ -9,7 +9,7 @@ minikube: false
|
||||
image:
|
||||
repository: caddy/ingress
|
||||
pullPolicy: IfNotPresent
|
||||
tag: "v0.1.0"
|
||||
tag: "v0.1.1"
|
||||
|
||||
imagePullSecrets: []
|
||||
nameOverride: ""
|
||||
@ -30,6 +30,7 @@ ingressController:
|
||||
email: ""
|
||||
metrics: true
|
||||
proxyProtocol: false
|
||||
experimentalSmartSort: false
|
||||
onDemandTLS: false
|
||||
# onDemandRateLimitInterval:
|
||||
# onDemandRateLimitBurst:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user