Private tap with private Go based projects #6638
Unanswered
Okeanos
asked this question in
Writing Formulae/Casks
Replies: 1 comment 1 reply
-
|
I think it would be much easier to use goreleaser for this. You can make binaries and distribute them as casks. They also have recommendations on how to sidestep gatekeeper issues |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Output of
brew configOutput of
brew doctorDescription of issue
I would like to create a private tap that contains formulae using Go to build the resulting binaries. The involved repositories for dependencies are partially private as well.
A simplified example with fake data:
Please note that the Go dependencies specified in the
go.modfile are not vendored and may look something like this:where
github.com/example/example-2is its own private repository on GitHub (or any other host for that matter).Some minimal setup on a client with brew assumed:
brew installhas credentials for the target repositories (plural!) tap, formula source & dependenciesinsteadOfredirect for Git to use SSH connections (git config set --global url."[email protected]:".insteadOf "https://github.com/") instead of HTTPS or vice versabrew installruns.Now after setting up the tap
brew tap example/tap https://github.com/example/homebrew-tapand then running installbrew install example/tap/examplethe following happens:The Formula invokes
go buildand Go will then attempt to resolve the dependencies. Publicly available dependencies resolve just fine, however, the private dependencies fail.According to the docs Brew will (understandably!) create a self-contained environment for the build process to execute in. However, this means that the user's Git settings are also not available, specifically the credentials to access the private repositories.
There appears to be a way to inject some environment variables into the local build process according to the docs but nothing related to authentication for Git/Go/build systems. I also found a few potentially relevant discussions that somewhat touch on my question but no solution.
Other discussions that might be related / similar are:
Private casks (or bottles I guess also need this access to automatically build?) are sadly out of the question for me. Or at least I don't think I can make them work reasonably because they would trigger Gatekeeper issues that need resolving and I would like to avoid that by providing the means to locally self-build instead.
So my question is: how do I provide brew with access to the private repositories needed to resolve & download the dependencies during a local
brew install(requiring a build)?If this isn't possible / supported behaviour, I'll have to live with it but I just wanted to make sure I am not overlooking anything that would make this work.
Beta Was this translation helpful? Give feedback.
All reactions