Skip to content

Commit

Permalink
Also include the edition into the alternatives paths, although it is …
Browse files Browse the repository at this point in the history
…currently hardcoded to generic.
  • Loading branch information
blaubaer committed Oct 18, 2024
1 parent 975e972 commit 415225d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions docs/reference/alternatives.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Especially if a containerized environment (like [Docker environment](environment

## Properties

<<property("downloadUrl", "URL", "data-type.md#url", template_context="context/alternative-binary.md", default="https://github.com/engity-com/bifroest/releases/download/v{{.version}}/bifroest-{{.os}}-{{.arch}}-generic{{.packageExt}}")>>
<<property("downloadUrl", "URL", "data-type.md#url", template_context="context/alternative-binary.md", default="https://github.com/engity-com/bifroest/releases/download/v{{.version}}/bifroest-{{.os}}-{{.arch}}-{{.edition}}{{.packageExt}}")>>
URL where to download the alternative version of Bifröst. Usually we simply will get this from [the GitHub Releases of Bifröst](https://github.com/engity-com/bifroest/releases).

<<property("location", "File Path", "data-type.md#file-path", template_context="context/alternative-binary.md", default="<os specific>")>>
Expand All @@ -22,5 +22,5 @@ A file that already exists, will not be downloaded again.

The default value is different, depending on the platform Bifröst runs on:

* Linux: `/var/lib/engity/bifroest/binaries/{{.version}}/{{.os}}-{{.arch}}{{.ext}}`
* Window: `C:\ProgramData\Engity\Bifroest\binaries\{{.version}}\{{.os}}-{{.arch}}{{.ext}}`
* Linux: `/var/lib/engity/bifroest/binaries/{{.version}}/{{.os}}-{{.arch}}-{{.edition}}{{.ext}}`
* Window: `C:\ProgramData\Engity\Bifroest\binaries\{{.version}}\{{.os}}-{{.arch}}-{{.edition}}{{.ext}}`
2 changes: 2 additions & 0 deletions pkg/alternatives/binaries.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ func (this alternativeResolutionContext) GetField(name string) (any, bool, error
return this.Architecture, true, nil
case "version":
return this.Version, true, nil
case "edition":
return "generic", true, nil
case "ext":
return this.Ext(), true, nil
case "packageExt":
Expand Down
2 changes: 1 addition & 1 deletion pkg/configuration/alternatives.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

var (
DefaultAlternativesDownloadUrl = template.MustNewUrl("https://github.com/engity-com/bifroest/releases/download/v{{.version}}/bifroest-{{.os}}-{{.arch}}-generic{{.packageExt}}")
DefaultAlternativesDownloadUrl = template.MustNewUrl("https://github.com/engity-com/bifroest/releases/download/v{{.version}}/bifroest-{{.os}}-{{.arch}}-{{.edition}}{{.packageExt}}")
DefaultAlternativesLocation = template.MustNewString(defaultAlternativesLocation)
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/configuration/alternatives_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
package configuration

var (
defaultAlternativesLocation = `/var/lib/engity/bifroest/binaries/{{.version}}/{{.os}}-{{.arch}}{{.ext}}`
defaultAlternativesLocation = `/var/lib/engity/bifroest/binaries/{{.version}}/{{.os}}-{{.arch}}-{{.edition}}{{.ext}}`
)
2 changes: 1 addition & 1 deletion pkg/configuration/alternatives_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
package configuration

var (
defaultAlternativesLocation = `C:\ProgramData\Engity\Bifroest\binaries\{{.version}}\{{.os}}-{{.arch}}{{.ext}}`
defaultAlternativesLocation = `C:\ProgramData\Engity\Bifroest\binaries\{{.version}}\{{.os}}-{{.arch}}-{{.edition}}{{.ext}}`
)

0 comments on commit 415225d

Please sign in to comment.