diff --git a/.woodpecker/build.yaml b/.woodpecker/build.yaml index 74123b5..8448f17 100644 --- a/.woodpecker/build.yaml +++ b/.woodpecker/build.yaml @@ -3,7 +3,19 @@ when: steps: - name: build - image: golang:1.25 + image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/gobuilder:0.1.2-alma9 + environment: + GOCACHE_S3_BUCKET: gocache + GOCACHE_S3_REGION: us-east-1 + GOCACHE_S3_ENDPOINT_URL: https://s3.ceph.unkin.net + GOCACHE_S3_PATH_STYLE: "true" + GOCACHE_KEY_PREFIX: ci-sshsignhost + GOCACHE_METRICS: "true" + GOCACHEPROG: go-cache-plugin --cache-dir=/tmp/gocache + AWS_ACCESS_KEY_ID: + from_secret: GOCACHE_AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY: + from_secret: GOCACHE_AWS_SECRET_ACCESS_KEY commands: - make build backend_options: diff --git a/.woodpecker/integration.yaml b/.woodpecker/integration.yaml index 167558a..0fa47d2 100644 --- a/.woodpecker/integration.yaml +++ b/.woodpecker/integration.yaml @@ -5,16 +5,26 @@ when: # stay exactly what they were; this one needs a Vault next to it. steps: - name: integration - image: golang:1.25 + image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/gobuilder:0.1.2-alma9 environment: + GOCACHE_S3_BUCKET: gocache + GOCACHE_S3_REGION: us-east-1 + GOCACHE_S3_ENDPOINT_URL: https://s3.ceph.unkin.net + GOCACHE_S3_PATH_STYLE: "true" + GOCACHE_KEY_PREFIX: ci-sshsignhost + GOCACHE_METRICS: "true" + GOCACHEPROG: go-cache-plugin --cache-dir=/tmp/gocache + AWS_ACCESS_KEY_ID: + from_secret: GOCACHE_AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY: + from_secret: GOCACHE_AWS_SECRET_ACCESS_KEY VAULT_VERSION: 1.20.4 VAULT_SHA256: fc5fb5d01d192f1216b139fb5c6af17e3af742aaeffc289fd861920ec55f2c9c SSHSIGNHOST_TEST_VAULT_ADDR: http://127.0.0.1:8200 # Throwaway dev-mode server on loopback; this token grants nothing. VAULT_TOKEN: dev-root-token commands: - # The golang image does not trust the estate's internal CA, so artifactapi - # is fetched over http and the archive is pinned by checksum instead. + # Fetched over http and pinned by checksum rather than relying on TLS trust. - curl -fsSL -o /tmp/vault.zip "http://artifactapi.k8s.syd1.au.unkin.net/api/v1/remote/hashicorp-releases/vault/$${VAULT_VERSION}/vault_$${VAULT_VERSION}_linux_amd64.zip" - echo "$${VAULT_SHA256} /tmp/vault.zip" | sha256sum -c - - python3 -m zipfile -e /tmp/vault.zip /usr/local/bin/ diff --git a/.woodpecker/pre-commit.yaml b/.woodpecker/pre-commit.yaml index d57b508..710c327 100644 --- a/.woodpecker/pre-commit.yaml +++ b/.woodpecker/pre-commit.yaml @@ -3,7 +3,19 @@ when: steps: - name: pre-commit - image: git.unkin.net/unkin/almalinux9-gobuilder:20260606 + image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/gobuilder:0.1.2-alma9 + environment: + GOCACHE_S3_BUCKET: gocache + GOCACHE_S3_REGION: us-east-1 + GOCACHE_S3_ENDPOINT_URL: https://s3.ceph.unkin.net + GOCACHE_S3_PATH_STYLE: "true" + GOCACHE_KEY_PREFIX: ci-sshsignhost + GOCACHE_METRICS: "true" + GOCACHEPROG: go-cache-plugin --cache-dir=/tmp/gocache + AWS_ACCESS_KEY_ID: + from_secret: GOCACHE_AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY: + from_secret: GOCACHE_AWS_SECRET_ACCESS_KEY commands: - uvx pre-commit run --all-files backend_options: diff --git a/.woodpecker/release.yaml b/.woodpecker/release.yaml index d0d6672..fa05ea2 100644 --- a/.woodpecker/release.yaml +++ b/.woodpecker/release.yaml @@ -12,7 +12,19 @@ clone: steps: - name: test - image: golang:1.25 + image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/gobuilder:0.1.2-alma9 + environment: + GOCACHE_S3_BUCKET: gocache + GOCACHE_S3_REGION: us-east-1 + GOCACHE_S3_ENDPOINT_URL: https://s3.ceph.unkin.net + GOCACHE_S3_PATH_STYLE: "true" + GOCACHE_KEY_PREFIX: ci-sshsignhost + GOCACHE_METRICS: "true" + GOCACHEPROG: go-cache-plugin --cache-dir=/tmp/gocache + AWS_ACCESS_KEY_ID: + from_secret: GOCACHE_AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY: + from_secret: GOCACHE_AWS_SECRET_ACCESS_KEY commands: - go test -race ./... backend_options: @@ -29,11 +41,22 @@ steps: # One driver for both artifact types: the RPM Puppet installs via dnf and the # raw binaries the puppetserver-compiler initContainer fetches by URL. - name: goreleaser - image: golang:1.26 + image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/gobuilder:0.1.2-alma9 environment: GORELEASER_VERSION: v2.17.0 GITEA_TOKEN: from_secret: RELEASER_TOKEN + GOCACHE_S3_BUCKET: gocache + GOCACHE_S3_REGION: us-east-1 + GOCACHE_S3_ENDPOINT_URL: https://s3.ceph.unkin.net + GOCACHE_S3_PATH_STYLE: "true" + GOCACHE_KEY_PREFIX: ci-sshsignhost + GOCACHE_METRICS: "true" + GOCACHEPROG: go-cache-plugin --cache-dir=/tmp/gocache + AWS_ACCESS_KEY_ID: + from_secret: GOCACHE_AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY: + from_secret: GOCACHE_AWS_SECRET_ACCESS_KEY commands: - go install github.com/goreleaser/goreleaser/v2@$${GORELEASER_VERSION} - goreleaser release --clean diff --git a/.woodpecker/test.yaml b/.woodpecker/test.yaml index 5e179a7..d5d78e8 100644 --- a/.woodpecker/test.yaml +++ b/.woodpecker/test.yaml @@ -18,7 +18,19 @@ steps: cpu: 2 - name: test - image: golang:1.25 + image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/gobuilder:0.1.2-alma9 + environment: + GOCACHE_S3_BUCKET: gocache + GOCACHE_S3_REGION: us-east-1 + GOCACHE_S3_ENDPOINT_URL: https://s3.ceph.unkin.net + GOCACHE_S3_PATH_STYLE: "true" + GOCACHE_KEY_PREFIX: ci-sshsignhost + GOCACHE_METRICS: "true" + GOCACHEPROG: go-cache-plugin --cache-dir=/tmp/gocache + AWS_ACCESS_KEY_ID: + from_secret: GOCACHE_AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY: + from_secret: GOCACHE_AWS_SECRET_ACCESS_KEY commands: - go test -v -race ./... backend_options: