2024-05-05 16:58:35 +00:00
|
|
|
---
|
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
|
|
|
|
.chart-testing-image: &chart-testing-image
|
|
|
|
image: quay.io/helmpack/chart-testing:v3.10.1
|
|
|
|
clone:
|
|
|
|
git:
|
|
|
|
image: woodpeckerci/plugin-git
|
|
|
|
settings:
|
|
|
|
partial: false
|
|
|
|
|
|
|
|
steps:
|
|
|
|
changed:
|
|
|
|
<<: *chart-testing-image
|
|
|
|
name: Check changed charts
|
|
|
|
commands:
|
|
|
|
- git fetch origin
|
|
|
|
- helm repo add badhouseplants-lib-testing https://git.badhouseplants.net/api/packages/badhouseplants/helm
|
|
|
|
- ct lint --target-branch main --print-config --debug
|
|
|
|
- ct list-changed --target-branch main > .changed
|
|
|
|
|
|
|
|
lint:
|
|
|
|
<<: *chart-testing-image
|
|
|
|
name: Lint charts
|
|
|
|
commands:
|
|
|
|
- git fetch origin
|
|
|
|
- helm repo add badhouseplants-lib-testing https://git.badhouseplants.net/api/packages/badhouseplants/helm
|
|
|
|
- |
|
|
|
|
if [ -s .changed ]; then
|
2024-05-19 20:49:21 +00:00
|
|
|
./scripts/lint.sh
|
2024-05-05 16:58:35 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
test:
|
|
|
|
<<: *chart-testing-image
|
|
|
|
name: Test charts
|
|
|
|
environment:
|
|
|
|
- DOCKER_HOST=tcp://docker:2375
|
|
|
|
commands:
|
|
|
|
- helm repo add badhouseplants-lib-testing https://git.badhouseplants.net/api/packages/badhouseplants/helm
|
|
|
|
- |
|
|
|
|
if [ -s .changed ]; then
|
|
|
|
export PATH=$PWD/.bin:$PATH
|
|
|
|
apk update && apk add docker curl bash
|
|
|
|
curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash
|
2024-05-05 17:00:01 +00:00
|
|
|
echo "nameserver 8.8.8.8" > /etc/resolv.conf
|
2024-05-05 16:58:35 +00:00
|
|
|
k3d cluster create test --api-port 16443 --k3s-arg="kubelet-args=\"--allowed-unsafe-sysctls=net.ipv4.ip_forward\""@all
|
|
|
|
sed -i -E -e 's/localhost|0\.0\.0\.0/docker/g' ~/.kube/config
|
|
|
|
git fetch origin
|
2024-05-19 20:49:21 +00:00
|
|
|
./scripts/test.sh
|
2024-05-05 16:58:35 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
release:
|
|
|
|
<<: *chart-testing-image
|
|
|
|
name: Release charts
|
|
|
|
when:
|
|
|
|
- branch: main
|
|
|
|
secrets:
|
|
|
|
- gitea_token
|
|
|
|
environment:
|
|
|
|
- DISABLE_FORCE_OVERWRITE='true'
|
|
|
|
- ALLOW_OVERWRITE='false'
|
|
|
|
commands:
|
|
|
|
- |
|
|
|
|
helm registry login git.badhouseplants.net \
|
|
|
|
--username allanger \
|
|
|
|
--password $GITEA_TOKEN
|
|
|
|
- |
|
|
|
|
for chart in $(find charts -maxdepth 1 -mindepth 1 -type d); do
|
|
|
|
helm package $chart -d chart-packages;
|
|
|
|
done
|
|
|
|
- |
|
|
|
|
for chart in $(find chart-packages -maxdepth 1 -mindepth 1 -type f); do
|
2024-05-05 17:45:10 +00:00
|
|
|
helm push $chart oci://git.badhouseplants.net/softplayer/helm
|
2024-05-05 16:58:35 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
services:
|
|
|
|
docker:
|
|
|
|
image: docker:dind
|
|
|
|
commands:
|
|
|
|
- echo "1" > /proc/sys/net/ipv4/ip_forward
|
2024-05-05 17:00:01 +00:00
|
|
|
- echo "nameserver 8.8.8.8" > /etc/resolv.conf
|
2024-05-05 16:58:35 +00:00
|
|
|
- dockerd -H tcp://0.0.0.0:2375 --tls=false
|
|
|
|
privileged: true
|
|
|
|
ports:
|
|
|
|
- 2375
|
|
|
|
- 16443
|
|
|
|
backend_options:
|
|
|
|
kubernetes:
|
|
|
|
resources:
|
|
|
|
requests:
|
|
|
|
memory: 500Mi
|
|
|
|
cpu: 500m
|
|
|
|
limits:
|
|
|
|
memory: 1000Mi
|
|
|
|
cpu: 1000m
|
|
|
|
securityContext:
|
|
|
|
privileged: true
|