gon icon indicating copy to clipboard operation
gon copied to clipboard

Support ENV variables in source or as a flag

Open radeksimko opened this issue 5 years ago • 2 comments

I'm not sure what's better in terms of UX, but I would find it really useful if gon accepted paths to binaries either as environment variables or as flags. This would allow for much cleaner integration with GoReleaser and probably other release software and CIs too.

Example

source = ["@env:BIN_PATH"]
bundle_id = "com.mitchellh.example.terraform"
apple_id {
  username = "[email protected]"
  password = "@env:AC_PASSWORD"
}
sign {
  application_identity = "Developer ID Application: Mitchell Hashimoto"
}
$ BIN_PATH=./path/to/binary gon .gon.hcl

radeksimko avatar Apr 13 '20 08:04 radeksimko

Extending Apple's syntax would make the most consistent UX but I imagine using HCL2 expressions would be easier. I don't want to get stuck interpolating every string again with @env: haha (for background: those are just passed through since Apple's signing CLIs handle those).

mitchellh avatar Apr 13 '20 16:04 mitchellh

+1

Especially with goreleaser configs that target amd64 and arm64 (for M1), one currently seems to need 2 separate config files that only differ in the source and output_path properties.

Here’s a workaround that fzf uses: generate the gon config from goreleaser: https://github.com/junegunn/fzf/blob/4f9a7f8c879ef625f3bec5946df9e7fe5768f9dd/.goreleaser.yml#L22

stapelberg avatar Mar 03 '21 07:03 stapelberg