Skip to content

Commit

Permalink
chore(updatecli) add a manifest to bump kubectl with pattern (#1046)
Browse files Browse the repository at this point in the history
* chore(updatecli) add a manifest to bump kubectl with pattern

* kubectl in lowercase

---------

Co-authored-by: Hervé Le Meur <[email protected]>
  • Loading branch information
smerle33 and lemeurherve authored Feb 13, 2024
1 parent 3929ef4 commit 242a705
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions updatecli/updatecli.d/kubectl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
name: Bump `kubectl` version

scms:
default:
kind: github
spec:
user: "{{ .github.user }}"
email: "{{ .github.email }}"
owner: "{{ .github.owner }}"
repository: "{{ .github.repository }}"
token: "{{ requiredEnv .github.token }}"
username: "{{ .github.username }}"
branch: "{{ .github.branch }}"

sources:
lastReleaseVersion:
kind: githubrelease
name: Get latest `kubectl` CLI version
transformers:
- trimprefix: "kubernetes-"
spec:
owner: "kubernetes"
repository: "kubectl"
token: "{{ requiredEnv .github.token }}"
username: "{{ .github.username }}"
versionfilter:
kind: regex
pattern: "^kubernetes-1.26.(\\d*)$"

targets:
updateVersion:
name: "Update `kubectl` version in the tools-versions.yml file"
sourceid: lastReleaseVersion
kind: yaml
spec:
file: provisioning/tools-versions.yml
key: $.kubectl_version
scmid: default
updateVersionInGoss:
name: Update `kubectl` version in the goss test
kind: yaml
spec:
file: goss/goss-common.yaml
key: $.command.kubectl.stdout[0]
scmid: default

actions:
default:
kind: github/pullrequest
title: Bump `kubectl` version to {{ source "lastReleaseVersion" }}
scmid: default
spec:
labels:
- dependencies
- kubectl

0 comments on commit 242a705

Please sign in to comment.