0
Bamboo Windows代理(Powershell / Batch)中BitBucket存储库的自动标记
我正在尝试自动化项目存储库的标记。该代码托管在私有的BitBucket上,而持续集成在Bamboo上自动进行,而Bamboo仅在当前Windows 10代理上运行。该代理具有MINGW GitPowerShell的功能,但是从Bamboo来说,我只能在cmd.exe或上设置命令行任务Windows PowerShell。 我已经在BitBucket上设置了一个特定用户,该用户具有对存储库的写权限以及已知的密码。用户通过SSH在BitBucket上进行身份验证: remote.origin.url=ssh://git@git.mycompany.com:7999/myproject/myrepository.git 该origin.url变量是直接从Bamboo变量设置的,因此没有简单的方法可以切换到https://username:password@git.mycompany.com...url以手动指定密码。 如果没有做任何事情比设置本地多user.name和user.password到适当值时,git push --tags命令失败: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. 因此,我猜想授予用户访问权限的正确方法是使用SSH身份验证方法。但是,PowerShell中的Git实例似乎并不了解pageant:通过Git Bash导入ssh密钥后,该命令在PowerShell上仍然失败,但在Git Bash中成功。在这一点上,我陷入了困境,因为似乎无法让PowerShell知道我的id_rsa文件.pub或.ppk,并且尝试从PowerShell调用Git Bash以使其他可执行文件执行肮脏的工作失败了: "C:\Program Files\Git\git-bash.exe git push --tags --set-upstream origin test-tag-branch" "C:\Program Files\Git\bin\git.exe push --tags --set-upstream …