我正在使用golang创建一个简单的CLI应用程序。我正在使用GoReleaser将其发布到Gitlab。我按照https://goreleaser.com/quick-start/中概述的步骤发布了对gitlab的更改。我已经生成了一个具有API作用域的个人访问令牌。在使用goreleaser发布工件之前,我会标记这些更改并推送它们。
我总是得到这样的错误: 452.34s后发布失败错误=github/gitlab/gitea发布:发布工件失败: get "https://PRIVATEGITLABURL/api/v4/projects/PRIVATE_GITLAB_PROJECT/releases/v1%2E0%2E3":dial tcp IP_ADDRESS:443: connect:操作超时。
我的.gorelease.yml文件
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
- go generate ./...
builds:
- env:
- CGO_ENABLED=0
goos:
- windows
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
# .goreleaser.yml
gitlab_urls:
api: https://PRIVATE_GITLAB_REPO/api/v4/
download: https://PRIVATE_GITLAB_REPO
# set to true if you use a self-signed certificate
skip_tls_verify: false 有什么想法吗?我的gitlab版本是GitLab企业版14.1.5-ee
发布于 2021-09-27 06:05:05
首先检查这是不是因为goreleaser/goreleaser issue 1879 (“在http(s)代理后面使用goreleaser "),这是从PR 1885和goreleaser v0.147.0开始支持的:
HTTP(S)_PROXY环境变量HTTP(S)_PROXY,但忘记了NO_PROXY (通过https://访问intranet资源时不使用代理)。Batuhan Apaydın在OP's discussion中建议应用gitlab configuration
# .goreleaser.yml
release:
# Default is extracted from the origin remote URL or empty if its private hosted.
# You can also use Gitlab's internal project id by setting it in the name
# field and leaving the owner field empty.
gitlab:
owner: user
name: repo. 从GH讨论中,OP GrailsTest在the comments中确认
我无法推送我的版本,因为我只能通过
访问GitLab。
HTTP似乎不起作用。Https从未在我的机器上工作过,可能是因为我没有设置环境变量。
我可以让它在我的同事机器上工作,他们可以通过HHTPS和SSH访问GitLab。
https://stackoverflow.com/questions/69340444
复制相似问题