Skip to content

Commit

Permalink
Add support for Launchpad URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
tianon committed Sep 1, 2022
1 parent c84b4f2 commit 8090620
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .template-helpers/generate-dockerfile-links-partial.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ This template defines the "Supported tags and Dockerfile links" portion of an im
{{- $url := hasPrefix "https://github.com/" $repoUrlBase | ternary (join "/" $repoUrlBase "blob" $gitCommit $dockerfilePath) "" -}}
{{- /* handle https://gitlab.../.../... style URLs (by reasonably assuming they're a gitlab instance) */ -}}
{{- $url = $url | ternary $url (hasPrefix "https://gitlab." $repoUrlBase | ternary (join "/" $repoUrlBase "-/blob" $gitCommit $dockerfilePath) "") -}}
{{- /* handle https://git.launchpad.net/ URLs */ -}}
{{- $url = $url | ternary $url (hasPrefix "https://git.launchpad.net/" $repoUrlBase | ternary (print $repoUrlBase "/tree/" $dockerfilePath "?h=" ($e.ArchGitFetch $arch) "&id=" $gitCommit) "") -}}
{{- /* TODO decide what to do (if anything) about other non-GitHub repos with respect to URL */ -}}

{{- if $i -}}
Expand Down Expand Up @@ -68,6 +70,8 @@ This template defines the "Supported tags and Dockerfile links" portion of an im
{{- $url := hasPrefix "https://github.com/" $repoUrlBase | ternary (join "/" $repoUrlBase "blob" $gitCommit $dockerfilePath) "" -}}
{{- /* handle https://gitlab.../.../... style URLs (by reasonably assuming they're a gitlab instance) */ -}}
{{- $url = $url | ternary $url (hasPrefix "https://gitlab." $repoUrlBase | ternary (join "/" $repoUrlBase "-/blob" $gitCommit $dockerfilePath) "") -}}
{{- /* handle https://git.launchpad.net/ URLs */ -}}
{{- $url = $url | ternary $url (hasPrefix "https://git.launchpad.net/" $repoUrlBase | ternary (print $repoUrlBase "/tree/" $dockerfilePath "?h=" ($e.ArchGitFetch $arch) "&id=" $gitCommit) "") -}}
{{- /* TODO decide what to do (if anything) about other non-GitHub repos with respect to URL */ -}}

{{- "\t-\t" -}}
Expand Down

0 comments on commit 8090620

Please sign in to comment.