forked from rancher/scc-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdatebuildbase.yaml
More file actions
83 lines (78 loc) · 2.29 KB
/
Copy pathupdatebuildbase.yaml
File metadata and controls
83 lines (78 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
name: "Update build base version"
sources:
# Read the current version from the Dockerfile
current_minor:
name: Get current build base minor version from Dockerfile
kind: dockerfile
spec:
file: Dockerfile
instruction:
keyword: ARG
matcher: GO_IMAGE
transformers:
# Value is "rancher/hardened-build-base:v1.24.9b1"
# Trim prefix to get "v1.24.9b1"
- trimprefix: "rancher/hardened-build-base:"
# Trim 'v' prefix to get "1.24.9b1"
- trimprefix: "v"
# This regex captures the major.minor to get "1.24"
# but it will be a list that will be handled in the next step
- findsubmatch:
pattern: '^([0-9]+\.[0-9]+)'
# Select the last element from the list
- kind: lastelement
# Find the latest release matching that minor version
latest_patch:
name: Get latest build base patch for that minor
kind: githubrelease
dependson:
- "current_minor"
spec:
owner: rancher
repository: image-build-base
token: '{{ requiredEnv .github.token }}'
typefilter:
release: true
draft: false
prerelease: false
versionfilter:
kind: regex
# This searches for tags "v1.24.*"
# using the "1.24" value from the 'current_minor' source
pattern: 'v{{ source "current_minor" }}\.\S+'
targets:
dockerfile:
name: "Bump to latest build base version in Dockerfile"
kind: dockerfile
scmid: default
sourceid: latest_patch
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: '{{ requiredEnv .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 "latest_patch" }}'
kind: github/pullrequest
spec:
automerge: false
labels:
- chore
- skip-changelog
- status/auto-created
scmid: default