From 327a7c367a3e2a8468acc8e5f05d07fbe01eb9d5 Mon Sep 17 00:00:00 2001 From: unkin-agent Date: Sat, 19 Sep 2026 17:09:12 +1000 Subject: [PATCH] feat: add argocd CLI (#173) The ArgoCD CLI is not packaged, so nodes have no supported way to install it alongside the other vendored kubernetes tools. Pin it to the 3.3 series to track the deployed server (v3.3.2). - Add `argocd` 3.3.14 for almalinux/el9 and fedora 42/43/44 - Fetch the linux-amd64 binary through the artifactapi github remote and verify it against upstream `cli_checksums.txt` - Generate and package bash, zsh and fish completions - Hold `update-gh` on the 3.3 series via `github_release_pattern` Depends on terraform-artifactapi#46; builds 403 until that is merged and applied. Reviewed-on: https://git.unkin.net/unkin/rpmbuilder/pulls/173 Co-authored-by: unkin-agent Co-committed-by: unkin-agent --- rpms/argocd/metadata.yaml | 24 +++++++++++++++++ rpms/argocd/resources/build.sh | 22 +++++++++++++++ rpms/argocd/resources/nfpm.yaml | 48 +++++++++++++++++++++++++++++++++ 3 files changed, 94 insertions(+) create mode 100644 rpms/argocd/metadata.yaml create mode 100755 rpms/argocd/resources/build.sh create mode 100644 rpms/argocd/resources/nfpm.yaml diff --git a/rpms/argocd/metadata.yaml b/rpms/argocd/metadata.yaml new file mode 100644 index 0000000..b48a9d7 --- /dev/null +++ b/rpms/argocd/metadata.yaml @@ -0,0 +1,24 @@ +name: argocd +github: argoproj/argo-cd +github_release_pattern: ^v3\.3\. +description: Declarative GitOps continuous delivery for Kubernetes - command line + client. +arch: amd64 +platform: linux +maintainer: Argo Project +homepage: https://github.com/argoproj/argo-cd +license: Apache-2.0 +dist_tag: true +builds: +- repository: + - almalinux/el9 + image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: 1 + version: 3.3.14 +- repository: + - fedora/42 + - fedora/43 + - fedora/44 + image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest + release: 1 + version: 3.3.14 diff --git a/rpms/argocd/resources/build.sh b/rpms/argocd/resources/build.sh new file mode 100755 index 0000000..9b37ad2 --- /dev/null +++ b/rpms/argocd/resources/build.sh @@ -0,0 +1,22 @@ +#!/usr/bin/bash + +set -e + +BASE_URL="https://artifactapi.k8s.syd1.au.unkin.net/api/v1/remote/github/argoproj/argo-cd/releases/download/v${PACKAGE_VERSION}" + +wget -O /app/argocd "${BASE_URL}/argocd-linux-amd64" +wget -O /app/cli_checksums.txt "${BASE_URL}/cli_checksums.txt" + +# Upstream lists the asset name; check it against the local filename. +cd /app +grep ' argocd-linux-amd64$' cli_checksums.txt | sed 's/argocd-linux-amd64$/argocd/' | sha256sum --check --strict - +chmod +x /app/argocd + +mkdir -p /app/completions +/app/argocd completion bash > /app/completions/argocd +/app/argocd completion zsh > /app/completions/_argocd +/app/argocd completion fish > /app/completions/argocd.fish + +envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml + +nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm diff --git a/rpms/argocd/resources/nfpm.yaml b/rpms/argocd/resources/nfpm.yaml new file mode 100644 index 0000000..2021880 --- /dev/null +++ b/rpms/argocd/resources/nfpm.yaml @@ -0,0 +1,48 @@ +# nfpm.yaml + +name: ${PACKAGE_NAME} +version: ${PACKAGE_VERSION} +release: ${PACKAGE_RELEASE} +arch: ${PACKAGE_ARCH} +platform: ${PACKAGE_PLATFORM} +section: default +priority: extra +description: "${PACKAGE_DESCRIPTION}" + +maintainer: ${PACKAGE_MAINTAINER} +homepage: ${PACKAGE_HOMEPAGE} +license: ${PACKAGE_LICENSE} + +disable_globbing: false + +replaces: + - argocd + +provides: + - argocd + +contents: + - src: /app/argocd + dst: /usr/bin/argocd + file_info: + mode: 0755 + owner: root + group: root + - src: /app/completions/argocd + dst: /usr/share/bash-completion/completions/argocd + file_info: + mode: 0644 + owner: root + group: root + - src: /app/completions/_argocd + dst: /usr/share/zsh/site-functions/_argocd + file_info: + mode: 0644 + owner: root + group: root + - src: /app/completions/argocd.fish + dst: /usr/share/fish/vendor_completions.d/argocd.fish + file_info: + mode: 0644 + owner: root + group: root