【问题标题】:How to bazel gazelle --update-repos with private repository如何使用私有存储库对瞪羚 --update-repos
【发布时间】:2020-09-07 00:53:51
【问题描述】:

当你的 go.mod 文件中有私有存储库时,当你有私有存储库时如何运行 bazel gelelle update-repo 命令

❯ bazel run //:gazelle -- update-repos -from_file=search/go.mod
INFO: Analyzed target //:gazelle (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //:gazelle up-to-date:
  bazel-bin/gazelle-runner.bash
  bazel-bin/gazelle
INFO: Elapsed time: 0.231s, Critical Path: 0.00s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action
INFO: Build completed successfully, 1 total action
go: bitbucket.org/blah/backend-components/go-logging@v1.0.5/go.mod: verifying module: bitbucket.org/blah/backend-components/go-logging@v1.0.5/go.mod: reading https://sum.golang.org/lookup/bitbucket.org/blah/backend-components/go-logging@v1.0.5: 410 Gone
        server response:
        not found: bitbucket.org/blah/backend-components/go-logging@v1.0.5: reading https://api.bitbucket.org/2.0/repositories/blah/backend-components?fields=scm: 403 Forbidden
                server response: Access denied. You must have write or admin access.
gazelle: exit status 1

【问题讨论】:

    标签: bazel bazel-rules


    【解决方案1】:

    我在文档中找不到它,但是您将环境变量 GOPRIVATE 设置为以逗号分隔的类似模块的模式列表。例如:

    export GOPRIVATE='github.com/mycompany/myrepo,*.example.com'
    

    【讨论】:

      猜你喜欢
      • 2021-06-13
      • 2015-08-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-12
      • 2015-06-24
      相关资源
      最近更新 更多