From 69892efcf462faf10492f837bb8d40c45b9c5b0d Mon Sep 17 00:00:00 2001 From: Manuel Buil Date: Tue, 27 Feb 2024 09:11:39 +0100 Subject: [PATCH] Use updatecli to update the build base image Signed-off-by: Manuel Buil --- updatecli/updatecli.d/updatebuildbase.yaml | 78 ++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 updatecli/updatecli.d/updatebuildbase.yaml diff --git a/updatecli/updatecli.d/updatebuildbase.yaml b/updatecli/updatecli.d/updatebuildbase.yaml new file mode 100644 index 0000000..de7cf1f --- /dev/null +++ b/updatecli/updatecli.d/updatebuildbase.yaml @@ -0,0 +1,78 @@ +--- +name: "Update build base version" + +sources: + gomod: + name: Get latest Golang version based on go.mod + kind: file + spec: + file: https://raw.githubusercontent.com/kubernetes-sigs/cluster-proportional-autoscaler/master/go.mod + matchpattern: 'go ([0-9]+\.[0-9]+)' + transformers: + - trimprefix: "go " + + buildbase: + name: Get build base version + kind: githubrelease + dependson: + - "gomod" + spec: + owner: rancher + repository: image-build-base + token: '{{ requiredEnv .github.token }}' + typefilter: + release: true + draft: false + prerelease: false + versionfilter: + kind: regex + pattern: '{{ source "gomod"}}\.\S+' + +targets: + dockerfile: + name: "Bump to latest build base version in Dockerfile" + kind: dockerfile + scmid: default + sourceid: buildbase + spec: + file: Dockerfile + instruction: + keyword: ARG + matcher: "GO_IMAGE" + transformers: + - addprefix: "rancher/hardened-build-base:" + + drone: + name: "Bump to latest build base version in Dockerfile" + kind: file + scmid: default + disablesourceinput: true + spec: + file: .drone.yml + matchpattern: '(?m)^ image: rancher/hardened-build-base:(.*)' + replacepattern: ' image: rancher/hardened-build-base:{{ source "buildbase" }}' + +scms: + default: + kind: github + spec: + token: '{{ requiredEnv .github.token }}' + username: '{{ .github.username }}' + user: '{{ .github.user }}' + email: '{{ .github.email }}' + owner: '{{ .github.owner }}' + repository: '{{ .github.repository }}' + branch: '{{ .github.branch }}' + +actions: + default: + title: 'Bump build base version to {{ source "buildbase" }}' + kind: github/pullrequest + spec: + automerge: false + labels: + - chore + - skip-changelog + - status/auto-created + scmid: default +