我的gitlab构建管道失败了,因为它将运行git ls-remote -q origin指令,并报告了一个错误,称“找不到您正在寻找的项目”。
[2022/01/04 15:58:00] /go/pkg/mod/***/finance/alice@v0.9.63-0.20211231031838-f6dae3fdb8c4/kafkax/kafka_consumer.go:9:2: reading golang.***.com/kit/swimlane/go.mod at revision v0.0.1: git ls-remote -q origin in /go/pkg/mod/cache/vcs/d59e078efe804645d7b0bc877750c96d810a57328e3acc47eb94bdb969209bf9: exit status 128:
[2022/01/04 15:58:00] > GitLab: The project you were looking for could not be found.
[2022/01/04 15:58:00] fatal: Could not read from remote repository.
[2022/01/04 15:58:00]
[2022/01/04 15:58:00] Please make sure you have the correct access rights
[2022/01/04 15:58:00] and the repository exists.事实上,“泳道”依赖性,这不是一个围棋模块项目,已经下载。
[2022/01/04 15:57:39] go: downloading golang.***.com/kit/swimlane v0.0.1
[2022/01/04 15:57:39] get "golang.***.com/kit/swimlane": found meta tag vcs.metaImport{Prefix:"golang.***.com/kit/swimlane", VCS:"git", RepoRoot:"git+ssh://git@git.***.com/kit/swimlane"} at //golang.***.com/kit/swimlane?go-get=1然而,由于某些原因,我还没有搞清楚,似乎是“/kafkax/kafka_ get . to :9:2”导致它运行"git ls-远程-q原产地“来获取”泳道“的远程引用。
我使用git ls-remote --get-url origin来获取原点url,即"http://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@git.***.com/finance/order-center.git"。“金融/订单中心。get是这个项目-- gitlab管道建设失败,而不是”泳道“的起源。
我在寻找一种让我的管道成功运行的方法。非常感谢你对这个问题的看法或解决方案。
谢谢!
P.S.最初的git配置是:
[2022/01/04 15:57:18] Step 12/22 : RUN git config --list
[2022/01/04 15:57:18] ---> Running in 3170cf53e18e
[2022/01/04 15:57:18] url.http://git.***.com/.insteadof=git+ssh://git@git.***.com/
[2022/01/04 15:57:18] fetch.recursesubmodules=false
[2022/01/04 15:57:18] core.repositoryformatversion=0
[2022/01/04 15:57:18] core.filemode=true
[2022/01/04 15:57:18] core.bare=false
[2022/01/04 15:57:18] core.logallrefupdates=true
[2022/01/04 15:57:18] remote.origin.url=http://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@git.***.com/finance/order-center.git
[2022/01/04 15:57:18] remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
[2022/01/04 15:57:18] branch.master.remote=origin
[2022/01/04 15:57:18] branch.master.merge=refs/heads/master要使用ssh从私有repo获取代码,我运行
[2022/01/04 15:57:23] Step 20/22 : RUN git config --global --unset url.http://git.***.com/.insteadof发布于 2022-01-04 13:15:01
您通常可以检查此代码https://github.com/golang/go/blob/b1a53ece68d46e4fb59c74d2bc529060861f5dbf/src/cmd/go/internal/vcs/vcs.go#L242-L246,git remote将在go获取或下载mod时被调用(go build将下载远程模块,该模块由当前构建)。
https://stackoverflow.com/questions/70575725
复制相似问题