forked from updatecli/updatecli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmanifestTemplate.go
More file actions
65 lines (63 loc) · 1.86 KB
/
manifestTemplate.go
File metadata and controls
65 lines (63 loc) · 1.86 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
package pyproject
// manifestTemplate is the Go text/template used to generate updatecli manifests
// for Python dependency updates discovered via pyproject.toml.
var manifestTemplate = `name: '{{ .ManifestName }}'
{{- if .ActionID }}
actions:
{{ .ActionID }}:
title: '{{ .TargetName }}'
{{ end }}
sources:
{{ .SourceID }}:
name: '{{ .SourceName }}'
kind: 'pypi'
spec:
name: '{{ .DependencyName }}'
{{- if .IndexURL }}
url: '{{ .IndexURL }}'
{{- end }}
versionfilter:
kind: '{{ .SourceVersionFilterKind }}'
pattern: '{{ .SourceVersionFilterPattern }}'
{{- if or (eq .SourceVersionFilterKind "regex/semver") (eq .SourceVersionFilterKind "regex/time") }}
regex: '{{ .SourceVersionFilterRegex }}'
{{- end }}
{{- if .UvEnabled }}
targets:
{{ .TargetID }}:
name: '{{ .TargetName }}'
{{- if .ScmID }}
scmid: '{{ .ScmID }}'
{{- end }}
kind: 'shell'
spec:
command: 'uv lock --upgrade-package {{ .DependencyName }}=={{ "{{" }} source "{{ .SourceID }}" {{ "}}" }}'
changedif:
kind: file/checksum
spec:
files:
- "{{ .LockFile }}"
environments:
- name: PATH
workdir: '{{ .Workdir }}'
disablesourceinput: true
{{- end }}
`
// manifestTemplateParams holds the values injected into manifestTemplate.
type manifestTemplateParams struct {
ManifestName string
ActionID string
SourceID string
SourceName string
SourceVersionFilterKind string
SourceVersionFilterPattern string
SourceVersionFilterRegex string
DependencyName string
IndexURL string
TargetID string
TargetName string
ScmID string
UvEnabled bool
LockFile string
Workdir string
}