【发布时间】:2021-07-06 03:08:40
【问题描述】:
我正在尝试为 Go 项目设置自动构建。我们有一些内部依赖项,但在我们的私有 BitBucket 上可用。但是需要凭证才能访问这些。我可以使用选项 Git 和 SSH 读取主存储库,但我可以从 BitBucket 下载依赖项。
我已经尝试过:
git config --global url."git@bitbucket.org:".insteadOf "https://bitbucket.org/"
export 'GOPRIVATE=bitbucket.org/*'
但这似乎不起作用,因为输出:
+ go version
22:33:27 go version go1.16.4 darwin/arm64
+ go test
22:33:29 go: missing Mercurial command. See https://golang.org/s/gogetcmd
22:33:30 go: bitbucket.org/repositorie_url: reading https://api.bitbucket.org/2.0/repositorie_url/dependency_repo 403 Forbidden
22:33:30 server response: Access denied. You must have write or admin access.
我如何确保 go get 或 go install 以安全的方式访问我们的私有存储库?
注意:去测试 sems 以忽略 git 配置,它正在尝试从 https 获取依赖项,此外我还有一些 Mercurial 错误。
【问题讨论】:
标签: go jenkins ssh bitbucket jenkins-plugins