-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwerf.yaml
106 lines (93 loc) · 3.88 KB
/
werf.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
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
---
project: deckhouse
configVersion: 1
gitWorktree:
forceShallowClone: true
cleanup:
disableGitHistoryBasedPolicy: {{ env "WERF_DISABLE_META_TAGS" "false" }}
---
{{- $_ := set . "DistroPackagesProxy" (env "DISTRO_PACKAGES_PROXY" "") }}
{{- $_ := set . "CargoProxy" (env "CARGO_PROXY" "") }}
---
# revisions settings
{{- $editionsSettings := (.Files.Get "editions.yaml" | fromYaml) }}
{{- $_ := set . "Editions" $editionsSettings.editions }}
# checks redactions list
{{- if not $.Editions }}
{{ fail "Editions list is empty" }}
{{- end }}
{{- $editionsDict := dict }}
{{- range $_, $edition := $.Editions }}
{{- if not $edition.name }}
{{ fail printf "Editions name is empty" }}
{{- end }}
{{- $_ := set $editionsDict $edition.name "" }}
{{- end }}
{{- if not (hasKey $editionsDict .Env) }}
{{ fail (printf "Editions name not found %v" .Env) }}
{{- end }}
---
# Base Images
{{- $_ := set . "Images" (.Files.Get "candi/image_versions.yml" | fromYaml) }}
{{- range $k, $v := .Images }}
{{ $baseImagePath := (printf "%s%s" $.Images.REGISTRY_PATH (trimSuffix "/" $v)) }}
{{- if ne $k "REGISTRY_PATH" }}
{{- $_ := set $.Images $k $baseImagePath }}
{{- end }}
{{- end }}
---
# Version Map
{{- $versionMap := dict }}
{{- range $_, $edition := $.Editions }}
{{- if $edition.versionMapFile }}
{{- $versionMap = (merge $versionMap ($.Files.Get $edition.versionMapFile | fromYaml) )}}
{{- end }}
{{- if eq $.Env $edition.name }}
{{- break -}}
{{- end }}
{{- end }}
{{- $_ := set . "CandiVersionMap" $versionMap }}
{{- $_ := set . "kubectlForBaseComponents" (list "1.27" "1.30") }}
---
# Terraform Versions
{{- $_ := set . "TF" (.Files.Get "candi/terraform_versions.yml" | fromYaml) }}
# Source repo settings
{{- $_ := set . "SOURCE_REPO" (env "SOURCE_REPO" | default "https://github.com") }}
# source repo with protected cloud providers
# use example.com as default because we can fail build without env
{{- $_ := set . "CLOUD_PROVIDERS_SOURCE_REPO" (env "CLOUD_PROVIDERS_SOURCE_REPO" | default "https://example.com") }}
# Source repo with observability private code
{{- $_ := set . "OBSERVABILITY_SOURCE_REPO" (env "OBSERVABILITY_SOURCE_REPO" | default "https://example.com") }}
# Stronghold repo access for building d8 cli
{{- $_ := set . "STRONGHOLD_PULL_TOKEN" (env "STRONGHOLD_PULL_TOKEN") }}
{{- $_ := set . "DECKHOUSE_PRIVATE_REPO" (env "DECKHOUSE_PRIVATE_REPO") }}
{{- $_ := set . "CI_COMMIT_TAG" (env "CI_COMMIT_TAG" "dev") }}
# goproxy settings
{{- $_ := set . "GOPROXY" (env "GOPROXY") }}
---
# render ssh-static
{{ include "ssh_static_artifact" (dict "Images" .Images "SOURCE_REPO" .SOURCE_REPO) }}
---
{{ include "common_base_image" (dict "rootContext" . "k8sVersions" .kubectlForBaseComponents "CandiVersionMap" $.CandiVersionMap "prefix" "") }}
---
{{ include "base_for_go_image" (dict "rootContext" . "k8sVersions" .kubectlForBaseComponents "CandiVersionMap" $.CandiVersionMap "prefix" "") }}
---
{{ include "dhctl_src_artifact" (dict "gitPrefix" "") }}
---
{{ include "dhctl_artifact" (dict "GOPROXY" .GOPROXY "CI_COMMIT_TAG" .CI_COMMIT_TAG ) }}
---
# render images and artifact from .werf
# WARNING! new images and artifacts should be placed in .werf/werf-YOUR-MAGIC-IMAGES-GROUP.yaml
# common parts of images and/or images should be placed in .werf/defines directory in define templates
# and should include in werf.yaml (see include dhctl_artifact) ar include in .werf/werf-YOUR-MAGIC-IMAGES-GROUP.yaml
#
# we separate defines and images in separated files for logical separation
# why didn't we move all images in defines and include it defines directly in werf.yaml?
# 1. We have different images building between CSE and OSS
# 2. Logical separation
# 3. That separation can find defines used in images in one place and images itself in different place
# This may be revised in the future
{{ range $path, $content := .Files.Glob ".werf/werf-**.yaml" }}
{{ tpl $content $ }}
{{ end }}
---