container-openvpn/.woodpecker/.test.yml

83 lines
2.2 KiB
YAML
Raw Normal View History

---
clone:
git:
image: woodpeckerci/plugin-git
settings:
partial: false
steps:
deps:
name: Download dependencies
image: ghcr.io/allanger/dumb-downloader:latest
environment:
KIND_VERSION: v0.20.0
HELM_VERSION: v3.12.1
KUBECTL_VERSION: v1.28.3
CT_VERSION: 3.10.1
commands:
- mkdir .bin
# -- Download kind
- dudo -l "https://kind.sigs.k8s.io/dl/{{ version }}/kind-{{ os }}-{{ arch }}" -d .bin/kind -p $KIND_VERSION
- chmod +x .bin/kind
changed:
name: Check changed charts
image: quay.io/helmpack/chart-testing
commands:
- git fetch origin
- ls -la
- ct help
- ct lint --chart-dirs . --target-branch main --print-config --debug
- |
if [[ -n "$(ct list-changed --chart-dirs . --target-branch main)" ]]; then
touch .changed
fi
lint:
name: Lint charts
image: quay.io/helmpack/chart-testing
commands:
- git fetch origin
- |
if [ -e .changed ]; then
ct lint --target-branch main --validate-maintainers=false --chart-dirs .
fi
test:
name: Test charts
image: quay.io/helmpack/chart-testing
environment:
- DOCKER_HOST=tcp://docker:2375
commands:
- 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
- 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
- kubectl get storageclass
- git fetch origin
- |
if [ -e .changed ]; then
ct install --target-branch main --chart-dirs .
ct install --target-branch main --chart-dirs . --upgrade
fi
services:
docker:
image: docker:dind
commands:
- echo "1" > /proc/sys/net/ipv4/ip_forward
- 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