[英]Push changes to GitHub repository as a part of release pipeline in Azure DevOps
I am trying to create a Release pipeline that:我正在尝试创建一个发布管道:
I stuck on the point #1.我坚持第 1 点。 I managed to get to the point where I have my repository available, I update the docker-compose.yml file (via bash script), I can commit the changes but unfortunately the push fails.
我设法让我的存储库可用,我更新了 docker-compose.yml 文件(通过 bash 脚本),我可以提交更改但不幸的是推送失败。
Here's my release pipeline with two artifacts:这是我的发布管道,包含两个工件:
Here's my stage with three bash scripts - the first two are updating docker-compose.yml, the third one should commit the changes to the repository and push it.这是我使用三个 bash 脚本的阶段 - 前两个是更新 docker-compose.yml,第三个应该将更改提交到存储库并推送它。
Here's the result I'm getting when running the release:这是我在运行发布时得到的结果:
It seems there's some problem with authentication when doing git push, but I'm not sure how to solve this.似乎在执行 git push 时身份验证存在一些问题,但我不确定如何解决此问题。 This SO suggests it's a problem with 2FA enabled on the git side, but since I'm using Personal Access Token to authenticate to git, 2FA should not be used.
这SO表明这是一个问题,在git的侧启用2FA,但因为我使用的个人访问令牌来验证混帐,2FA不宜使用。 Even if I add this line to my script as suggested in that SO:
即使我按照该 SO 中的建议将此行添加到我的脚本中:
git config --global --add url."git@github.com:".insteadOf "https://github.com/"
It still fails with the following error:它仍然失败并出现以下错误:
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Could anyone guide me how to properly push git repository as a part of Azure release pipeline?谁能指导我如何将 git 存储库作为 Azure 发布管道的一部分正确推送?
I found a workaround that seems to solve my problem.我找到了一种解决方法,似乎可以解决我的问题。 I have removed the repository from the artifacts list and instead I'm doing everything manually:
我已从工件列表中删除了存储库,而是手动执行所有操作:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.