2 Commits

Author SHA1 Message Date
unkinben d49667c471 feat: update etcd to 3.6.10 (#140)
ci/woodpecker/push/deploy-fedora43 Pipeline was successful
ci/woodpecker/push/deploy-fedora42 Pipeline was successful
ci/woodpecker/push/deploy-fedora44 Pipeline was successful
ci/woodpecker/push/deploy-almalinux8 Pipeline was successful
ci/woodpecker/push/deploy-almalinux9 Pipeline was successful
Automated version bump: 3.6.7 → 3.6.10

Reviewed-on: #140
Co-authored-by: Ben Vincent <ben@unkin.net>
Co-committed-by: Ben Vincent <ben@unkin.net>
2026-07-18 17:04:24 +10:00
unkinben 8c0d23afae Publish RPMs to artifactapi rpm-vendor repos (#169)
Why: vendored RPMs currently upload to Gitea's per-distro RPM registry. Publish them instead to the artifactapi per-distro rpm-vendor local repos (real yum repos; repodata regenerates automatically), keeping them separate from in-house software (rpm-internal). The existing per-distro build-all build jobs are unchanged.

Changes:
- .woodpecker/deploy-*.yaml: retarget the deploy-rpms step from git.unkin.net/api/packages/... to a PUT against artifactapi /api/v2/remotes/rpm-vendor-<distro>/files/ (unauthenticated, like the other repos), with an existence probe to skip re-uploads. Drops the DRONECI_PASSWORD secret.
- tools/build: repoint check_package_exists from the Gitea packages API to the artifactapi rpm-vendor repo so build-all's skip check matches the real publish target; verify artifactapi's internal TLS cert against the OS CA bundle; carry arch on PackageInfo so the probed filename matches the built RPM.

Depends on the already-merged rpm-vendor repos (terraform-artifactapi) and pairs with puppet-prod rpm-vendor yumrepo.

Reviewed-on: #169
Co-authored-by: Ben Vincent <ben@unkin.net>
Co-committed-by: Ben Vincent <ben@unkin.net>
2026-07-18 16:00:11 +10:00
13 changed files with 106 additions and 597 deletions
+7 -77
View File
@@ -1,88 +1,13 @@
# Generated by tools/gen-pipelines - do not edit by hand.
when: when:
- event: pull_request - event: pull_request
matrix:
PACKAGE:
- act_runner
- bind_exporter
- boilerplate
- claude-code
- cni-plugins
- code-server
- consul
- consul-cni
- etcd
- exportarr
- frr_exporter
- g10k
- git-delta
- hadolint
- helm
- helmfile
- jellyfin-ffmpeg-bin
- jellyfin-server
- jellyfin-web
- jsonnet
- jsonnet-language-server
- jsonnet-lint
- kubecolor
- kubeconform
- kubectx
- kustomize
- lazydocker
- libfoundationdb
- neovim
- neovim-glibc-2.17
- nfpm
- node_exporter
- nomad
- nomad-autoscaler
- nzbget
- nzbget_exporter
- openbao-plugin-secret-consul
- openbao-plugin-secret-nomad
- openbao-plugins
- packer
- pgbouncer_exporter
- postgres_exporter
- puppet-initial
- puppetdb_exporter
- ruff
- sops
- stalwart
- stalwart-cli
- stalwart-foundationdb
- starship
- stern
- tea
- terraform
- terragrunt
- tflint
- unkin-ca-certificates
- unkin-undionly-kpxe
- unrar
- uv
- vals
- vault
- victoria-logs
- vlutils
- vmagent
- vmalert
- vminsert
- vmselect
- vmstorage
- vmutils
- xh
- yq
steps: steps:
- name: build - name: build rpms
image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest
commands: commands:
- mkdir -p /woodpecker/rpms - mkdir -p /woodpecker/rpms
- ln -s /woodpecker/rpms /workspace - ln -s /woodpecker/rpms /workspace
- ./tools/build build --distro almalinux/el8 --buildah "$PACKAGE" - ./tools/build build-all --distro almalinux/el8 --buildah
privileged: true privileged: true
backend_options: backend_options:
kubernetes: kubernetes:
@@ -94,3 +19,8 @@ steps:
limits: limits:
memory: 2Gi memory: 2Gi
cpu: 2 cpu: 2
- name: show rpms
image: git.unkin.net/unkin/almalinux8-base:latest
commands:
- find /woodpecker/src/git.unkin.net/unkin/rpmbuilder/ -type f -name "*.rpm"
+7 -78
View File
@@ -1,89 +1,13 @@
# Generated by tools/gen-pipelines - do not edit by hand.
when: when:
- event: pull_request - event: pull_request
matrix:
PACKAGE:
- act_runner
- bind_exporter
- boilerplate
- claude-code
- cni-plugins
- code-server
- consul
- consul-cni
- etcd
- exportarr
- frr_exporter
- g10k
- git-delta
- hadolint
- helm
- helmfile
- incus
- jellyfin-ffmpeg-bin
- jellyfin-server
- jellyfin-web
- jsonnet
- jsonnet-language-server
- jsonnet-lint
- kubecolor
- kubeconform
- kubectx
- kustomize
- lazydocker
- libfoundationdb
- neovim
- neovim-glibc-2.17
- nfpm
- node_exporter
- nomad
- nomad-autoscaler
- nzbget
- nzbget_exporter
- openbao-plugin-secret-consul
- openbao-plugin-secret-nomad
- openbao-plugins
- packer
- pgbouncer_exporter
- postgres_exporter
- puppet-initial
- puppetdb_exporter
- ruff
- sops
- stalwart
- stalwart-cli
- stalwart-foundationdb
- starship
- stern
- tea
- terraform
- terragrunt
- tflint
- unkin-ca-certificates
- unkin-undionly-kpxe
- unrar
- uv
- vals
- vault
- victoria-logs
- vlutils
- vmagent
- vmalert
- vminsert
- vmselect
- vmstorage
- vmutils
- xh
- yq
steps: steps:
- name: build - name: build rpms
image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest
commands: commands:
- mkdir -p /woodpecker/rpms - mkdir -p /woodpecker/rpms
- ln -s /woodpecker/rpms /workspace - ln -s /woodpecker/rpms /workspace
- ./tools/build build --distro almalinux/el9 --buildah "$PACKAGE" - ./tools/build build-all --distro almalinux/el9 --buildah
privileged: true privileged: true
backend_options: backend_options:
kubernetes: kubernetes:
@@ -95,3 +19,8 @@ steps:
limits: limits:
memory: 2Gi memory: 2Gi
cpu: 2 cpu: 2
- name: show rpms
image: git.unkin.net/unkin/almalinux9-base:latest
commands:
- find /woodpecker/src/git.unkin.net/unkin/rpmbuilder/ -type f -name "*.rpm"
+7 -14
View File
@@ -1,25 +1,13 @@
# Generated by tools/gen-pipelines - do not edit by hand.
when: when:
- event: pull_request - event: pull_request
matrix:
PACKAGE:
- consul
- nfpm
- tea
- unkin-ca-certificates
- uv
- vault
- xh
- yq
steps: steps:
- name: build - name: build rpms
image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest
commands: commands:
- mkdir -p /woodpecker/rpms - mkdir -p /woodpecker/rpms
- ln -s /woodpecker/rpms /workspace - ln -s /woodpecker/rpms /workspace
- ./tools/build build --distro fedora/42 --buildah "$PACKAGE" - ./tools/build build-all --distro fedora/42 --buildah
privileged: true privileged: true
backend_options: backend_options:
kubernetes: kubernetes:
@@ -31,3 +19,8 @@ steps:
limits: limits:
memory: 2Gi memory: 2Gi
cpu: 2 cpu: 2
- name: show rpms
image: git.unkin.net/unkin/fedora42-base:latest
commands:
- find /woodpecker/src/git.unkin.net/unkin/rpmbuilder/ -type f -name "*.rpm"
+7 -14
View File
@@ -1,25 +1,13 @@
# Generated by tools/gen-pipelines - do not edit by hand.
when: when:
- event: pull_request - event: pull_request
matrix:
PACKAGE:
- consul
- nfpm
- tea
- unkin-ca-certificates
- uv
- vault
- xh
- yq
steps: steps:
- name: build - name: build rpms
image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest
commands: commands:
- mkdir -p /woodpecker/rpms - mkdir -p /woodpecker/rpms
- ln -s /woodpecker/rpms /workspace - ln -s /woodpecker/rpms /workspace
- ./tools/build build --distro fedora/43 --buildah "$PACKAGE" - ./tools/build build-all --distro fedora/43 --buildah
privileged: true privileged: true
backend_options: backend_options:
kubernetes: kubernetes:
@@ -31,3 +19,8 @@ steps:
limits: limits:
memory: 2Gi memory: 2Gi
cpu: 2 cpu: 2
- name: show rpms
image: git.unkin.net/unkin/fedora43-base:latest
commands:
- find /woodpecker/src/git.unkin.net/unkin/rpmbuilder/ -type f -name "*.rpm"
+7 -14
View File
@@ -1,25 +1,13 @@
# Generated by tools/gen-pipelines - do not edit by hand.
when: when:
- event: pull_request - event: pull_request
matrix:
PACKAGE:
- consul
- nfpm
- tea
- unkin-ca-certificates
- uv
- vault
- xh
- yq
steps: steps:
- name: build - name: build rpms
image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest
commands: commands:
- mkdir -p /woodpecker/rpms - mkdir -p /woodpecker/rpms
- ln -s /woodpecker/rpms /workspace - ln -s /woodpecker/rpms /workspace
- ./tools/build build --distro fedora/44 --buildah "$PACKAGE" - ./tools/build build-all --distro fedora/44 --buildah
privileged: true privileged: true
backend_options: backend_options:
kubernetes: kubernetes:
@@ -31,3 +19,8 @@ steps:
limits: limits:
memory: 2Gi memory: 2Gi
cpu: 2 cpu: 2
- name: show rpms
image: git.unkin.net/unkin/fedora44-base:latest
commands:
- find /woodpecker/src/git.unkin.net/unkin/rpmbuilder/ -type f -name "*.rpm"
+13 -86
View File
@@ -1,89 +1,14 @@
# Generated by tools/gen-pipelines - do not edit by hand.
when: when:
- event: push - event: push
branch: master branch: master
matrix:
PACKAGE:
- act_runner
- bind_exporter
- boilerplate
- claude-code
- cni-plugins
- code-server
- consul
- consul-cni
- etcd
- exportarr
- frr_exporter
- g10k
- git-delta
- hadolint
- helm
- helmfile
- jellyfin-ffmpeg-bin
- jellyfin-server
- jellyfin-web
- jsonnet
- jsonnet-language-server
- jsonnet-lint
- kubecolor
- kubeconform
- kubectx
- kustomize
- lazydocker
- libfoundationdb
- neovim
- neovim-glibc-2.17
- nfpm
- node_exporter
- nomad
- nomad-autoscaler
- nzbget
- nzbget_exporter
- openbao-plugin-secret-consul
- openbao-plugin-secret-nomad
- openbao-plugins
- packer
- pgbouncer_exporter
- postgres_exporter
- puppet-initial
- puppetdb_exporter
- ruff
- sops
- stalwart
- stalwart-cli
- stalwart-foundationdb
- starship
- stern
- tea
- terraform
- terragrunt
- tflint
- unkin-ca-certificates
- unkin-undionly-kpxe
- unrar
- uv
- vals
- vault
- victoria-logs
- vlutils
- vmagent
- vmalert
- vminsert
- vmselect
- vmstorage
- vmutils
- xh
- yq
steps: steps:
- name: build - name: build-rpms
image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest
commands: commands:
- mkdir -p /woodpecker/rpms - mkdir -p /woodpecker/rpms
- ln -s /woodpecker/rpms /workspace - ln -s /woodpecker/rpms /workspace
- ./tools/build build --distro almalinux/el8 --buildah "$PACKAGE" - ./tools/build build-all --distro almalinux/el8 --buildah
privileged: true privileged: true
backend_options: backend_options:
kubernetes: kubernetes:
@@ -96,27 +21,28 @@ steps:
memory: 2Gi memory: 2Gi
cpu: 2 cpu: 2
- name: upload - name: show-rpms
image: git.unkin.net/unkin/almalinux9-base:latest image: git.unkin.net/unkin/almalinux9-base:latest
commands:
- find /woodpecker/src/git.unkin.net/unkin/rpmbuilder/ -type f -name "*.rpm"
depends_on: [build-rpms]
- name: deploy-rpms
image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest
commands: commands:
- | - |
HOST="https://artifactapi.k8s.syd1.au.unkin.net" HOST="https://artifactapi.k8s.syd1.au.unkin.net"
REPO="rpm-vendor-el8" REPO="rpm-vendor-el8"
for rpm in $(find dist -type f -name '*.rpm'); do for rpm in $(find /woodpecker/src/git.unkin.net/unkin/rpmbuilder/ -type f -name "*.rpm"); do
FILE=$$(basename "$$rpm") FILE=$$(basename "$$rpm")
# artifactapi has no HEAD route (405); probe the served Packages path. # artifactapi has no HEAD route (405); probe the served Packages path.
code=$$(curl -s -o /dev/null -w '%{http_code}' "$$HOST/api/v2/remotes/$$REPO/files/Packages/$$FILE" || true) code=$$(curl -s -o /dev/null -w '%{http_code}' "$$HOST/api/v2/remotes/$$REPO/files/Packages/$$FILE" || true)
if [ "$$code" = "200" ]; then if [ "$$code" = "200" ]; then
echo "$$FILE already exists in $$REPO (HTTP $$code); skipping upload" echo "$$FILE already exists in $$REPO; skipping"
continue continue
fi fi
echo "Uploading $$FILE to $$REPO (existence probe returned $$code)" curl -f -X PUT "$$HOST/api/v2/remotes/$$REPO/files/$$FILE" -H "Content-Type: application/x-rpm" --data-binary @"$$rpm"
curl -f -X PUT \
"$$HOST/api/v2/remotes/$$REPO/files/$$FILE" \
-H "Content-Type: application/x-rpm" \
--data-binary @"$$rpm"
done done
depends_on: [build]
backend_options: backend_options:
kubernetes: kubernetes:
serviceAccountName: default serviceAccountName: default
@@ -127,3 +53,4 @@ steps:
limits: limits:
memory: 512Mi memory: 512Mi
cpu: 500m cpu: 500m
depends_on: [build-rpms, show-rpms]
+13 -87
View File
@@ -1,90 +1,14 @@
# Generated by tools/gen-pipelines - do not edit by hand.
when: when:
- event: push - event: push
branch: master branch: master
matrix:
PACKAGE:
- act_runner
- bind_exporter
- boilerplate
- claude-code
- cni-plugins
- code-server
- consul
- consul-cni
- etcd
- exportarr
- frr_exporter
- g10k
- git-delta
- hadolint
- helm
- helmfile
- incus
- jellyfin-ffmpeg-bin
- jellyfin-server
- jellyfin-web
- jsonnet
- jsonnet-language-server
- jsonnet-lint
- kubecolor
- kubeconform
- kubectx
- kustomize
- lazydocker
- libfoundationdb
- neovim
- neovim-glibc-2.17
- nfpm
- node_exporter
- nomad
- nomad-autoscaler
- nzbget
- nzbget_exporter
- openbao-plugin-secret-consul
- openbao-plugin-secret-nomad
- openbao-plugins
- packer
- pgbouncer_exporter
- postgres_exporter
- puppet-initial
- puppetdb_exporter
- ruff
- sops
- stalwart
- stalwart-cli
- stalwart-foundationdb
- starship
- stern
- tea
- terraform
- terragrunt
- tflint
- unkin-ca-certificates
- unkin-undionly-kpxe
- unrar
- uv
- vals
- vault
- victoria-logs
- vlutils
- vmagent
- vmalert
- vminsert
- vmselect
- vmstorage
- vmutils
- xh
- yq
steps: steps:
- name: build - name: build-rpms
image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest
commands: commands:
- mkdir -p /woodpecker/rpms - mkdir -p /woodpecker/rpms
- ln -s /woodpecker/rpms /workspace - ln -s /woodpecker/rpms /workspace
- ./tools/build build --distro almalinux/el9 --buildah "$PACKAGE" - ./tools/build build-all --distro almalinux/el9 --buildah
privileged: true privileged: true
backend_options: backend_options:
kubernetes: kubernetes:
@@ -97,27 +21,28 @@ steps:
memory: 2Gi memory: 2Gi
cpu: 2 cpu: 2
- name: upload - name: show-rpms
image: git.unkin.net/unkin/almalinux9-base:latest image: git.unkin.net/unkin/almalinux9-base:latest
commands:
- find /woodpecker/src/git.unkin.net/unkin/rpmbuilder/ -type f -name "*.rpm"
depends_on: [build-rpms]
- name: deploy-rpms
image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest
commands: commands:
- | - |
HOST="https://artifactapi.k8s.syd1.au.unkin.net" HOST="https://artifactapi.k8s.syd1.au.unkin.net"
REPO="rpm-vendor-el9" REPO="rpm-vendor-el9"
for rpm in $(find dist -type f -name '*.rpm'); do for rpm in $(find /woodpecker/src/git.unkin.net/unkin/rpmbuilder/ -type f -name "*.rpm"); do
FILE=$$(basename "$$rpm") FILE=$$(basename "$$rpm")
# artifactapi has no HEAD route (405); probe the served Packages path. # artifactapi has no HEAD route (405); probe the served Packages path.
code=$$(curl -s -o /dev/null -w '%{http_code}' "$$HOST/api/v2/remotes/$$REPO/files/Packages/$$FILE" || true) code=$$(curl -s -o /dev/null -w '%{http_code}' "$$HOST/api/v2/remotes/$$REPO/files/Packages/$$FILE" || true)
if [ "$$code" = "200" ]; then if [ "$$code" = "200" ]; then
echo "$$FILE already exists in $$REPO (HTTP $$code); skipping upload" echo "$$FILE already exists in $$REPO; skipping"
continue continue
fi fi
echo "Uploading $$FILE to $$REPO (existence probe returned $$code)" curl -f -X PUT "$$HOST/api/v2/remotes/$$REPO/files/$$FILE" -H "Content-Type: application/x-rpm" --data-binary @"$$rpm"
curl -f -X PUT \
"$$HOST/api/v2/remotes/$$REPO/files/$$FILE" \
-H "Content-Type: application/x-rpm" \
--data-binary @"$$rpm"
done done
depends_on: [build]
backend_options: backend_options:
kubernetes: kubernetes:
serviceAccountName: default serviceAccountName: default
@@ -128,3 +53,4 @@ steps:
limits: limits:
memory: 512Mi memory: 512Mi
cpu: 500m cpu: 500m
depends_on: [build-rpms, show-rpms]
+14 -24
View File
@@ -1,26 +1,14 @@
# Generated by tools/gen-pipelines - do not edit by hand.
when: when:
- event: push - event: push
branch: master branch: master
matrix:
PACKAGE:
- consul
- nfpm
- tea
- unkin-ca-certificates
- uv
- vault
- xh
- yq
steps: steps:
- name: build - name: build-rpms
image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest
commands: commands:
- mkdir -p /woodpecker/rpms - mkdir -p /woodpecker/rpms
- ln -s /woodpecker/rpms /workspace - ln -s /woodpecker/rpms /workspace
- ./tools/build build --distro fedora/42 --buildah "$PACKAGE" - ./tools/build build-all --distro fedora/42 --buildah
privileged: true privileged: true
backend_options: backend_options:
kubernetes: kubernetes:
@@ -33,27 +21,28 @@ steps:
memory: 2Gi memory: 2Gi
cpu: 2 cpu: 2
- name: upload - name: show-rpms
image: git.unkin.net/unkin/almalinux9-base:latest image: git.unkin.net/unkin/fedora42-rpmbuilder:latest
commands:
- find /woodpecker/src/git.unkin.net/unkin/rpmbuilder/ -type f -name "*.rpm"
depends_on: [build-rpms]
- name: deploy-rpms
image: git.unkin.net/unkin/fedora42-rpmbuilder:latest
commands: commands:
- | - |
HOST="https://artifactapi.k8s.syd1.au.unkin.net" HOST="https://artifactapi.k8s.syd1.au.unkin.net"
REPO="rpm-vendor-f42" REPO="rpm-vendor-f42"
for rpm in $(find dist -type f -name '*.rpm'); do for rpm in $(find /woodpecker/src/git.unkin.net/unkin/rpmbuilder/ -type f -name "*.rpm"); do
FILE=$$(basename "$$rpm") FILE=$$(basename "$$rpm")
# artifactapi has no HEAD route (405); probe the served Packages path. # artifactapi has no HEAD route (405); probe the served Packages path.
code=$$(curl -s -o /dev/null -w '%{http_code}' "$$HOST/api/v2/remotes/$$REPO/files/Packages/$$FILE" || true) code=$$(curl -s -o /dev/null -w '%{http_code}' "$$HOST/api/v2/remotes/$$REPO/files/Packages/$$FILE" || true)
if [ "$$code" = "200" ]; then if [ "$$code" = "200" ]; then
echo "$$FILE already exists in $$REPO (HTTP $$code); skipping upload" echo "$$FILE already exists in $$REPO; skipping"
continue continue
fi fi
echo "Uploading $$FILE to $$REPO (existence probe returned $$code)" curl -f -X PUT "$$HOST/api/v2/remotes/$$REPO/files/$$FILE" -H "Content-Type: application/x-rpm" --data-binary @"$$rpm"
curl -f -X PUT \
"$$HOST/api/v2/remotes/$$REPO/files/$$FILE" \
-H "Content-Type: application/x-rpm" \
--data-binary @"$$rpm"
done done
depends_on: [build]
backend_options: backend_options:
kubernetes: kubernetes:
serviceAccountName: default serviceAccountName: default
@@ -64,3 +53,4 @@ steps:
limits: limits:
memory: 512Mi memory: 512Mi
cpu: 500m cpu: 500m
depends_on: [build-rpms, show-rpms]
+14 -24
View File
@@ -1,26 +1,14 @@
# Generated by tools/gen-pipelines - do not edit by hand.
when: when:
- event: push - event: push
branch: master branch: master
matrix:
PACKAGE:
- consul
- nfpm
- tea
- unkin-ca-certificates
- uv
- vault
- xh
- yq
steps: steps:
- name: build - name: build-rpms
image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest
commands: commands:
- mkdir -p /woodpecker/rpms - mkdir -p /woodpecker/rpms
- ln -s /woodpecker/rpms /workspace - ln -s /woodpecker/rpms /workspace
- ./tools/build build --distro fedora/43 --buildah "$PACKAGE" - ./tools/build build-all --distro fedora/43 --buildah
privileged: true privileged: true
backend_options: backend_options:
kubernetes: kubernetes:
@@ -33,27 +21,28 @@ steps:
memory: 2Gi memory: 2Gi
cpu: 2 cpu: 2
- name: upload - name: show-rpms
image: git.unkin.net/unkin/almalinux9-base:latest image: git.unkin.net/unkin/fedora43-rpmbuilder:latest
commands:
- find /woodpecker/src/git.unkin.net/unkin/rpmbuilder/ -type f -name "*.rpm"
depends_on: [build-rpms]
- name: deploy-rpms
image: git.unkin.net/unkin/fedora43-rpmbuilder:latest
commands: commands:
- | - |
HOST="https://artifactapi.k8s.syd1.au.unkin.net" HOST="https://artifactapi.k8s.syd1.au.unkin.net"
REPO="rpm-vendor-f43" REPO="rpm-vendor-f43"
for rpm in $(find dist -type f -name '*.rpm'); do for rpm in $(find /woodpecker/src/git.unkin.net/unkin/rpmbuilder/ -type f -name "*.rpm"); do
FILE=$$(basename "$$rpm") FILE=$$(basename "$$rpm")
# artifactapi has no HEAD route (405); probe the served Packages path. # artifactapi has no HEAD route (405); probe the served Packages path.
code=$$(curl -s -o /dev/null -w '%{http_code}' "$$HOST/api/v2/remotes/$$REPO/files/Packages/$$FILE" || true) code=$$(curl -s -o /dev/null -w '%{http_code}' "$$HOST/api/v2/remotes/$$REPO/files/Packages/$$FILE" || true)
if [ "$$code" = "200" ]; then if [ "$$code" = "200" ]; then
echo "$$FILE already exists in $$REPO (HTTP $$code); skipping upload" echo "$$FILE already exists in $$REPO; skipping"
continue continue
fi fi
echo "Uploading $$FILE to $$REPO (existence probe returned $$code)" curl -f -X PUT "$$HOST/api/v2/remotes/$$REPO/files/$$FILE" -H "Content-Type: application/x-rpm" --data-binary @"$$rpm"
curl -f -X PUT \
"$$HOST/api/v2/remotes/$$REPO/files/$$FILE" \
-H "Content-Type: application/x-rpm" \
--data-binary @"$$rpm"
done done
depends_on: [build]
backend_options: backend_options:
kubernetes: kubernetes:
serviceAccountName: default serviceAccountName: default
@@ -64,3 +53,4 @@ steps:
limits: limits:
memory: 512Mi memory: 512Mi
cpu: 500m cpu: 500m
depends_on: [build-rpms, show-rpms]
+14 -24
View File
@@ -1,26 +1,14 @@
# Generated by tools/gen-pipelines - do not edit by hand.
when: when:
- event: push - event: push
branch: master branch: master
matrix:
PACKAGE:
- consul
- nfpm
- tea
- unkin-ca-certificates
- uv
- vault
- xh
- yq
steps: steps:
- name: build - name: build-rpms
image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest
commands: commands:
- mkdir -p /woodpecker/rpms - mkdir -p /woodpecker/rpms
- ln -s /woodpecker/rpms /workspace - ln -s /woodpecker/rpms /workspace
- ./tools/build build --distro fedora/44 --buildah "$PACKAGE" - ./tools/build build-all --distro fedora/44 --buildah
privileged: true privileged: true
backend_options: backend_options:
kubernetes: kubernetes:
@@ -33,27 +21,28 @@ steps:
memory: 2Gi memory: 2Gi
cpu: 2 cpu: 2
- name: upload - name: show-rpms
image: git.unkin.net/unkin/almalinux9-base:latest image: git.unkin.net/unkin/fedora44-rpmbuilder:latest
commands:
- find /woodpecker/src/git.unkin.net/unkin/rpmbuilder/ -type f -name "*.rpm"
depends_on: [build-rpms]
- name: deploy-rpms
image: git.unkin.net/unkin/fedora44-rpmbuilder:latest
commands: commands:
- | - |
HOST="https://artifactapi.k8s.syd1.au.unkin.net" HOST="https://artifactapi.k8s.syd1.au.unkin.net"
REPO="rpm-vendor-f44" REPO="rpm-vendor-f44"
for rpm in $(find dist -type f -name '*.rpm'); do for rpm in $(find /woodpecker/src/git.unkin.net/unkin/rpmbuilder/ -type f -name "*.rpm"); do
FILE=$$(basename "$$rpm") FILE=$$(basename "$$rpm")
# artifactapi has no HEAD route (405); probe the served Packages path. # artifactapi has no HEAD route (405); probe the served Packages path.
code=$$(curl -s -o /dev/null -w '%{http_code}' "$$HOST/api/v2/remotes/$$REPO/files/Packages/$$FILE" || true) code=$$(curl -s -o /dev/null -w '%{http_code}' "$$HOST/api/v2/remotes/$$REPO/files/Packages/$$FILE" || true)
if [ "$$code" = "200" ]; then if [ "$$code" = "200" ]; then
echo "$$FILE already exists in $$REPO (HTTP $$code); skipping upload" echo "$$FILE already exists in $$REPO; skipping"
continue continue
fi fi
echo "Uploading $$FILE to $$REPO (existence probe returned $$code)" curl -f -X PUT "$$HOST/api/v2/remotes/$$REPO/files/$$FILE" -H "Content-Type: application/x-rpm" --data-binary @"$$rpm"
curl -f -X PUT \
"$$HOST/api/v2/remotes/$$REPO/files/$$FILE" \
-H "Content-Type: application/x-rpm" \
--data-binary @"$$rpm"
done done
depends_on: [build]
backend_options: backend_options:
kubernetes: kubernetes:
serviceAccountName: default serviceAccountName: default
@@ -64,3 +53,4 @@ steps:
limits: limits:
memory: 512Mi memory: 512Mi
cpu: 500m cpu: 500m
depends_on: [build-rpms, show-rpms]
+1 -6
View File
@@ -11,14 +11,9 @@ DISTRO ?= almalinux/el9
PACKAGES := $(shell find $(ROOT_DIR)/rpms -mindepth 1 -maxdepth 1 -type d -exec test -f {}/metadata.yaml \; -print | xargs -n1 basename | sort) PACKAGES := $(shell find $(ROOT_DIR)/rpms -mindepth 1 -maxdepth 1 -type d -exec test -f {}/metadata.yaml \; -print | xargs -n1 basename | sort)
# Default target to build all packages # Default target to build all packages
.PHONY: all list build clean test pipelines .PHONY: all list build clean test
all: build-all all: build-all
# Regenerate the per-distro Woodpecker matrix pipelines from rpms/*/metadata.yaml
pipelines:
@echo "Regenerating .woodpecker pipelines..."
$(ROOT_DIR)/tools/gen-pipelines
# List all available packages # List all available packages
list: list:
@echo "Available packages:" @echo "Available packages:"
+2 -2
View File
@@ -13,9 +13,9 @@ builds:
- almalinux/el8 - almalinux/el8
image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest image: git.unkin.net/unkin/almalinux8-rpmbuilder:latest
release: 1 release: 1
version: 3.6.7 version: 3.6.10
- repository: - repository:
- almalinux/el9 - almalinux/el9
image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest
release: 1 release: 1
version: 3.6.7 version: 3.6.10
-147
View File
@@ -1,147 +0,0 @@
#!/usr/bin/env -S uv run --script
# /// script
# dependencies = [
# "pyyaml",
# ]
# ///
# vim: filetype=python
"""
Generate Woodpecker pipelines for rpmbuilder.
One pipeline file per distro (build-<distro>.yaml for pull_request checks and
deploy-<distro>.yaml for master pushes). Each pipeline uses a Woodpecker matrix
over the packages that target that distro, so every vendor package builds in its
own job. Deploy jobs publish to the distro's artifactapi rpm-vendor local repo.
The matrix package lists are derived from each rpms/*/metadata.yaml, so this
script is the source of truth: run `make pipelines` (or ./tools/gen-pipelines)
after adding/removing a package or changing its target distros, and commit the
regenerated .woodpecker/*.yaml.
"""
import glob
from pathlib import Path
import yaml
ROOT = Path(__file__).resolve().parent.parent
WOODPECKER = ROOT / ".woodpecker"
# Distro -> pipeline settings. `builder` runs buildah/the build tool (the actual
# RPM build happens in a nested container using each package's metadata image);
# `upload` only needs curl. rpm-vendor-<suffix> mirrors the artifactapi repos.
DISTROS = [
{"key": "almalinux8", "distro": "almalinux/el8", "repo": "rpm-vendor-el8"},
{"key": "almalinux9", "distro": "almalinux/el9", "repo": "rpm-vendor-el9"},
{"key": "fedora42", "distro": "fedora/42", "repo": "rpm-vendor-f42"},
{"key": "fedora43", "distro": "fedora/43", "repo": "rpm-vendor-f43"},
{"key": "fedora44", "distro": "fedora/44", "repo": "rpm-vendor-f44"},
]
BUILDER_IMAGE = "git.unkin.net/unkin/almalinux9-rpmbuilder:latest"
UPLOAD_IMAGE = "git.unkin.net/unkin/almalinux9-base:latest"
ARTIFACTAPI = "https://artifactapi.k8s.syd1.au.unkin.net"
HEADER = "# Generated by tools/gen-pipelines - do not edit by hand.\n"
def packages_for(distro: str) -> list[str]:
names = []
for mf in sorted(glob.glob(str(ROOT / "rpms" / "*" / "metadata.yaml"))):
meta = yaml.safe_load(open(mf)) or {}
distros = {
repo
for build in meta.get("builds", [])
for repo in build.get("repository", [])
}
if distro in distros:
names.append(meta.get("name", Path(mf).parent.name))
return sorted(names)
def matrix_block(packages: list[str]) -> str:
lines = "\n".join(f" - {p}" for p in packages)
return f"matrix:\n PACKAGE:\n{lines}\n"
def build_step() -> str:
return f""" - name: build
image: {BUILDER_IMAGE}
commands:
- mkdir -p /woodpecker/rpms
- ln -s /woodpecker/rpms /workspace
- ./tools/build build --distro DISTRO --buildah "$PACKAGE"
privileged: true
backend_options:
kubernetes:
serviceAccountName: default
resources:
requests:
memory: 512Mi
cpu: 1
limits:
memory: 2Gi
cpu: 2
"""
def upload_step(repo: str) -> str:
return f""" - name: upload
image: {UPLOAD_IMAGE}
commands:
- |
HOST="{ARTIFACTAPI}"
REPO="{repo}"
for rpm in $(find dist -type f -name '*.rpm'); do
FILE=$$(basename "$$rpm")
# artifactapi has no HEAD route (405); probe the served Packages path.
code=$$(curl -s -o /dev/null -w '%{{http_code}}' "$$HOST/api/v2/remotes/$$REPO/files/Packages/$$FILE" || true)
if [ "$$code" = "200" ]; then
echo "$$FILE already exists in $$REPO (HTTP $$code); skipping upload"
continue
fi
echo "Uploading $$FILE to $$REPO (existence probe returned $$code)"
curl -f -X PUT \\
"$$HOST/api/v2/remotes/$$REPO/files/$$FILE" \\
-H "Content-Type: application/x-rpm" \\
--data-binary @"$$rpm"
done
depends_on: [build]
backend_options:
kubernetes:
serviceAccountName: default
resources:
requests:
memory: 128Mi
cpu: 100m
limits:
memory: 512Mi
cpu: 500m
"""
def render(distro_cfg: dict, deploy: bool) -> str:
packages = packages_for(distro_cfg["distro"])
if deploy:
when = "when:\n - event: push\n branch: master\n"
else:
when = "when:\n - event: pull_request\n"
body = HEADER + when + "\n" + matrix_block(packages) + "\nsteps:\n"
body += build_step().replace("DISTRO", distro_cfg["distro"])
if deploy:
body += "\n" + upload_step(distro_cfg["repo"])
return body
def main() -> None:
for cfg in DISTROS:
(WOODPECKER / f"build-{cfg['key']}.yaml").write_text(render(cfg, deploy=False))
(WOODPECKER / f"deploy-{cfg['key']}.yaml").write_text(render(cfg, deploy=True))
print(f"generated build-{cfg['key']}.yaml deploy-{cfg['key']}.yaml "
f"({len(packages_for(cfg['distro']))} packages)")
if __name__ == "__main__":
main()