2b37986218
Small Go tool + distroless container used as a K8s initContainer to block an app until its database (Postgres/MySQL) is reachable. Env-var configured (WAITFORDB_* + libpq PG* fallback), configurable timeout/interval, redacted logs, exit codes. Woodpecker CI publishes docker-internal/waitfordb on tag.
44 lines
1.2 KiB
YAML
44 lines
1.2 KiB
YAML
when:
|
|
- event: [pull_request, push]
|
|
|
|
steps:
|
|
- name: test
|
|
image: golang:1.25
|
|
commands:
|
|
- go test -race ./...
|
|
backend_options:
|
|
kubernetes:
|
|
serviceAccountName: default
|
|
resources:
|
|
requests:
|
|
memory: 512Mi
|
|
cpu: 1
|
|
limits:
|
|
memory: 2Gi
|
|
cpu: 2
|
|
|
|
# Validate the image builds without pushing. The CA-baked buildx plugin trusts
|
|
# the internal registry's CA; the plain woodpeckerci plugin fails x509 here.
|
|
- name: build-check
|
|
image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/plugin-docker-buildx:latest
|
|
settings:
|
|
repo: artifactapi.k8s.syd1.au.unkin.net/docker-internal/waitfordb
|
|
dockerfile: Dockerfile
|
|
dry_run: true
|
|
platforms: linux/amd64
|
|
build_args:
|
|
VERSION: ${CI_COMMIT_SHA}
|
|
buildkit_config: |
|
|
[registry."artifactapi.k8s.syd1.au.unkin.net"]
|
|
ca = ["/etc/docker/certs.d/artifactapi.k8s.syd1.au.unkin.net/ca.crt"]
|
|
backend_options:
|
|
kubernetes:
|
|
serviceAccountName: default
|
|
resources:
|
|
requests:
|
|
memory: 1Gi
|
|
cpu: 1
|
|
limits:
|
|
memory: 4Gi
|
|
cpu: 2
|