@@ -21,22 +21,24 @@ This template defines the "Supported tags and Dockerfile links" portion of an im
21
21
{{- $froms := $.ArchDockerFroms $arch $e -}}
22
22
23
23
{{- $gitRepo := $e.ArchGitRepo $arch -}}
24
+ {{- $gitCommit := $e.ArchGitCommit $arch -}}
25
+ {{- $dir := .ArchDirectory $arch -}}
26
+ {{- $dockerfile := .ArchFile $arch -}}
27
+ {{- $dockerfilePath := eq $dir "." | ternary $dockerfile (join "/" $dir $dockerfile) -}}
24
28
{{- $repoUrlBase := $gitRepo | replace "git://" "https://" | trimSuffixes ".git" -}}
25
- {{- $isGitHub := hasPrefix "https://github.com/" $repoUrlBase -}}
29
+ {{- $url := hasPrefix "https://github.com/" $repoUrlBase | ternary (join "/" $repoUrlBase "blob" $gitCommit $dockerfilePath) "" -}}
30
+ {{- /* handle https://gitlab.../.../... style URLs (by reasonably assuming they're a gitlab instance) */ -}}
31
+ {{- $url = $url | ternary $url (hasPrefix "https://gitlab." $repoUrlBase | ternary (join "/" $repoUrlBase "-/blob" $gitCommit $dockerfilePath) "") -}}
32
+ {{- /* TODO decide what to do (if anything) about other non-GitHub repos with respect to URL */ -}}
26
33
27
34
{{- if $i -}}
28
35
{{- "\n" -}}
29
36
{{- end -}}
30
37
31
38
- {{- "\t" -}}
32
- {{- if $isGitHub -}} [ {{- end -}}
33
- {{- $dir := .ArchDirectory $arch -}}
34
- {{- $dockerfile := .ArchFile $arch -}}
35
- {{- $dockerfilePath := eq $dir "." | ternary $dockerfile (join "/" $dir $dockerfile) -}}
39
+ {{- if $url -}} [ {{- end -}}
36
40
` {{- $e.Tags | join "`, `" -}} `
37
- {{- $gitCommit := $e.ArchGitCommit $arch -}}
38
- {{- if $isGitHub -}} ]( {{- $repoUrlBase -}} /blob/ {{- $gitCommit -}} / {{- $dockerfilePath -}} ) {{- end -}}
39
- {{- /* TODO decide what to do (if anything) about non-GitHub repos with respect to URL */ -}}
41
+ {{- if $url -}} ]( {{- $url -}} ) {{- end -}}
40
42
{{- end -}}
41
43
{{- "\n\n" -}}
42
44
@@ -58,18 +60,20 @@ This template defines the "Supported tags and Dockerfile links" portion of an im
58
60
{{- $froms := $.ArchDockerFroms $arch $e -}}
59
61
60
62
{{- $gitRepo := $e.ArchGitRepo $arch -}}
61
- {{- $repoUrlBase := $gitRepo | replace "git://" "https://" | trimSuffixes ".git" -}}
62
- {{- $isGitHub := hasPrefix "https://github.com/" $repoUrlBase -}}
63
-
64
- {{- "\t-\t" -}}
65
- {{- if $isGitHub -}} [ {{- end -}}
63
+ {{- $gitCommit := $e.ArchGitCommit $arch -}}
66
64
{{- $dir := .ArchDirectory $arch -}}
67
65
{{- $dockerfile := .ArchFile $arch -}}
68
66
{{- $dockerfilePath := eq $dir "." | ternary $dockerfile (join "/" $dir $dockerfile) -}}
67
+ {{- $repoUrlBase := $gitRepo | replace "git://" "https://" | trimSuffixes ".git" -}}
68
+ {{- $url := hasPrefix "https://github.com/" $repoUrlBase | ternary (join "/" $repoUrlBase "blob" $gitCommit $dockerfilePath) "" -}}
69
+ {{- /* handle https://gitlab.../.../... style URLs (by reasonably assuming they're a gitlab instance) */ -}}
70
+ {{- $url = $url | ternary $url (hasPrefix "https://gitlab." $repoUrlBase | ternary (join "/" $repoUrlBase "-/blob" $gitCommit $dockerfilePath) "") -}}
71
+ {{- /* TODO decide what to do (if anything) about other non-GitHub repos with respect to URL */ -}}
72
+
73
+ {{- "\t-\t" -}}
74
+ {{- if $url -}} [ {{- end -}}
69
75
` {{- $e.Tags | first -}} `
70
- {{- $gitCommit := $e.ArchGitCommit $arch -}}
71
- {{- if $isGitHub -}} ]( {{- $repoUrlBase -}} /blob/ {{- $gitCommit -}} / {{- $dockerfilePath -}} ) {{- end -}}
72
- {{- /* TODO decide what to do (if anything) about non-GitHub repos with respect to URL */ -}}
76
+ {{- if $url -}} ]( {{- $url -}} ) {{- end -}}
73
77
74
78
{{- "\n" -}}
75
79
{{- end -}}
0 commit comments