anchore / binny

Manage a directory of binaries without a package manager
Apache License 2.0
21 stars 1 forks source link

Templated URL installs #29

Open kzantow opened 1 month ago

kzantow commented 1 month ago

In the case that binaries exist but are not hosted on Github releases, such as Helm, it might require downloading an archive and extracting a binary asset from the archive. By default, if there is a single binary, Binny could detect this and extract it to a file with the given name. An example might look something like this:

  - name: helm
    version:
      want: v3.15.3
    method: archive
    with:
      url: "https://get.helm.sh/helm-{{.Version}}-{{.Platform}}.{{.Extension}}"
      overrides:
        arm64:
          Platform: aarch64
        win32:
          Extension: zip

Coupled with https://github.com/anchore/binny/issues/28, this would provide a lot of flexibility to support more tools.

kzantow commented 1 month ago

The example suggestion is a modified version from an offline discussion:

# is there another method we want which is templated url
  # potential binary content detetor
  - name: helm
    version:
      want: v3.15.3
    method: archive-url
    with:
      target: helm # what target within the archive to get
      url: "https://get.helm.sh/helm-{{this comes from version want}}-{{this is platform magic}}.tar.gz"
      architecture-override:
        arm64: ["any and all file names people use"]