-
Notifications
You must be signed in to change notification settings - Fork 75
/
stackbrew.tmpl
42 lines (38 loc) · 1.78 KB
/
stackbrew.tmpl
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
# this file is generated with gomplate:
# template: https://github.com/caddyserver/caddy-docker/blob/{{ fileCommit "stackbrew.tmpl"}}/stackbrew.tmpl
# config context: https://github.com/caddyserver/caddy-docker/blob/{{ fileCommit "stackbrew-config.yaml"}}/stackbrew-config.yaml
Maintainers: Dave Henderson (@hairyhenderson),
Francis Lavoie (@francislavoie)
{{ range $version := .config.versions }}
{{- $minor := $version.caddy_version | regexp.Replace `([0-9]+\.[0-9]+).*$` `$1` }}
{{- $major := $minor | regexp.Replace `([0-9]+).*$` `$1` }}
{{- range $variant := $.config.variants }}
{{- $dir := filepath.Join $minor $variant.dir }}
{{- if and (file.IsDir $dir) (file.Exists (filepath.Join $dir "Dockerfile")) }}
Tags: {{ range $variant.tags }}
{{- print $version.caddy_version "-" . }}, {{ print $minor "-" . }}
{{- if $version.is_major }}, {{ print $major "-" . }}{{ end }}
{{- if $version.is_latest }}, {{ . }}{{ end }}
{{- end }}
{{- if has $variant "shared_tags" }}
SharedTags: {{ range $i, $tag := $variant.shared_tags }}
{{- if eq "latest" $tag }}
{{- $version.caddy_version }}, {{ $minor }}
{{- if $version.is_major }}, {{ $major }}{{ end }}
{{- else }}
{{- print $version.caddy_version "-" $tag }}, {{ print $minor "-" $tag }}
{{- if $version.is_major }}, {{ print $major "-" $tag }}{{ end }}
{{- end }}
{{- if $version.is_latest }}, {{ $tag }}{{ end -}}
{{ if lt (add 1 $i) (len $variant.shared_tags) }}, {{end}}
{{- end }}
{{- end }}
GitRepo: https://github.com/caddyserver/caddy-docker.git
Directory: {{ $dir }}
GitCommit: {{ fileCommit $dir }}
Architectures: {{ join $variant.architectures ", " }}
{{- if has $variant "constraints" }}
Constraints: {{ join $variant.constraints ", " }}
{{- end }}
{{ end }}{{ end -}}
{{ end }}