hashicorp / hc-install

Go module for downloading or locating HashiCorp binaries, verifying signatures and checksums, and asserting version constraints.

Home Page:https://pkg.go.dev/github.com/hashicorp/hc-install

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generalise GitGetters by including build command in product object

kmoe opened this issue · comments

commented

Currently, both GitGetters run go build to compile the binary from the git repo: https://github.com/hashicorp/hcinstall/blob/main/gitref.go#L84

We probably want to customise this for some products, so perhaps add a BuildCommand to Product, and perhaps BuildFlags. It's safest not to build the product if it doesn't have BuildCommand specified.

This was done as part of #12

BuildInstructions: &BuildInstructions{
GitRepoURL: "https://github.com/hashicorp/terraform.git",
PreCloneCheck: &build.GoIsInstalled{},
Build: &build.GoBuild{DetectVendoring: true},
},

BuildInstructions: &BuildInstructions{
GitRepoURL: "https://github.com/hashicorp/consul.git",
PreCloneCheck: &build.GoIsInstalled{},
Build: &build.GoBuild{Version: v1_16},
},