Skip to content

Commit 69758ac

Browse files
authored
mount points (#16)
Signed-off-by: YuryLysov <yuriy.lysov@flant.com>
1 parent 9d7a460 commit 69758ac

File tree

9 files changed

+36
-0
lines changed

9 files changed

+36
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# add mount points from file mount_points.yaml in the build dir
2+
3+
{{- define "image mount points" }}
4+
{{- $mountPoints := ($.Files.Get (printf "images/%s/mount-points.yaml" $.ImageName) | fromYaml) }}
5+
{{- range $v := $mountPoints.dirs }}
6+
- add: /tools/mounts/mountdir
7+
to: {{ $v }}
8+
owner: 64535
9+
group: 64535
10+
stageDependencies:
11+
install:
12+
- "**/*"
13+
{{- end }}
14+
{{- range $v := $mountPoints.files }}
15+
- add: /tools/mounts/mountfile
16+
to: {{ $v }}
17+
owner: 64535
18+
group: 64535
19+
stageDependencies:
20+
install:
21+
- "**/*"
22+
{{- end }}
23+
{{- end }}

.werf/images.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
{{- $_ := set $ctx "GOPROXY" (env "GOPROXY" "https://proxy.golang.org,direct") }}
2020
{{- $_ := set $ctx "Commit" $Root.Commit }}
2121
{{- $_ := set $ctx "ProjectName" (printf "%s/%s" $ctx.SVACE_PROJECT_PREFIX $ctx.ImageName ) }}
22+
{{- $_ := set $ctx "Files" $.Files }}
2223

2324
---
2425
{{- /* For Dockerfile just render it from the folder. */ -}}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dirs:
2+
- /etc/snapshot-validation-webhook/certs

images/snapshot-validation-webhook/werf.inc.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ shell:
6262
---
6363
image: {{ .ModuleNamePrefix }}{{ .ImageName }}
6464
fromImage: base/distroless
65+
git:
66+
{{- include "image mount points" . }}
6567
import:
6668
- image: {{ .ModuleNamePrefix }}{{ .ImageName }}-golang-artifact
6769
add: /{{ $.ImageName }}

images/webhooks/mount-points.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dirs:
2+
- /etc/webhook/certs

images/webhooks/werf.inc.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ shell:
4949
image: {{ .ModuleNamePrefix }}{{ .ImageName }}
5050
fromImage: base/distroless
5151

52+
git:
53+
{{- include "image mount points" . }}
54+
5255
import:
5356
- image: {{ .ModuleNamePrefix }}{{ .ImageName }}-golang-artifact
5457
add: /{{ $.ImageName }}

tools/mounts/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Mount primitives
2+
3+
This dir contains empty dir and empty file to use as mountpoints in the images.

tools/mounts/mountdir/.placeholder

Whitespace-only changes.

tools/mounts/mountfile

Whitespace-only changes.

0 commit comments

Comments
 (0)