-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwerf-version-map.yaml
52 lines (44 loc) · 1.25 KB
/
werf-version-map.yaml
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
---
image: version-map-artifact
from: {{ .Images.BASE_ALPINE }}
final: false
import:
- image: common/yq4-artifact
add: /usr/local/bin/yq
to: /usr/local/bin/yq
before: install
git:
- add: /
to: /
stageDependencies:
setup:
{{- range $_, $edition := $.Editions }}
{{- if $edition.versionMapFile }}
- {{ $edition.versionMapFile }}
{{- end }}
{{- end }}
includePaths:
{{- range $_, $edition := $.Editions }}
{{- if $edition.versionMapFile }}
- {{ $edition.versionMapFile }}
{{- end }}
{{- end }}
shell:
setup:
{{- $previousEditionFile := "" }}
{{- range $_, $edition := $.Editions }}
{{- $curEditionFile := printf "/version_map_%s.yml" $edition.name }}
{{- if $edition.versionMapFile }}
{{- $tmpEditionFile := printf "%s.tmp" $curEditionFile }}
{{- if $previousEditionFile }}
- cp {{ $edition.versionMapFile }} {{ $tmpEditionFile }}
- yq eval-all 'select(fileIndex == 0) * select(fileIndex == 1)' {{ $previousEditionFile }} {{ $tmpEditionFile }} > {{ $curEditionFile }}
{{- else }}
- cp {{ $edition.versionMapFile }} {{ $curEditionFile }}
{{- end }}
{{- else }}
- cp {{ $previousEditionFile }} {{ $curEditionFile }}
{{- end }}
{{- $previousEditionFile = $curEditionFile }}
{{- end }}
---