Skip to content

Commit

Permalink
Merge pull request #29 from manuelbuil/updatecli
Browse files Browse the repository at this point in the history
Add updatecli policy
  • Loading branch information
manuelbuil authored May 22, 2024
2 parents 71d73c4 + f02bbc2 commit 149dba6
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
68 changes: 68 additions & 0 deletions updatecli/updatecli.d/updatebuildbase.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
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/cri-tools/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:"

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

3 changes: 3 additions & 0 deletions updatecli/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ github:
email: "41898282+github-actions[bot]@users.noreply.github.com"
username: "UPDATECLI_GITHUB_ACTOR"
token: "UPDATECLI_GITHUB_TOKEN"
repository: "image-build-crictl"
branch: "master"
owner: "rancher"

0 comments on commit 149dba6

Please sign in to comment.