我使用下面的代碼推標籤用於Git倉庫如何從Cake構建任務將標籤推送到Bamboo中的Bitbucket Git存儲庫?
#addin "Cake.Git"
using LibGit2Sharp;
var solutionFolder = "./";
var versionTag = "someTag";
Task("Default")
.Does(() =>
{
var remoteRepository = EnvironmentVariable("bamboo_planRepository_repositoryUrl");
var repositoryRevision = EnvironmentVariable("bamboo_planRepository_revision");
var absolutePath = MakeAbsolute(Directory(solutionFolder));
var repoName = "central";
//LibGit2Sharp add remote
using (var repo = new Repository(absolutePath.FullPath))
{
repo.Network.Remotes.Add(repoName, remoteRepository);
}
GitTag(solutionFolder, versionTag, repositoryRevision);
GitPushRef(solutionFolder, gitUser, gitPassword, repoName, versionTag);
}
});
釘入到下一個問題:因爲我們的竹子配置爲使用SSH協議,Cake.Git(LibGit2Sharp)目前不支持接收下一個錯誤
Error: unsupported URL protocol
感謝
你好,謝謝你,嘗試過,但遺憾的是沒有運氣,更新問題與結帳任務日誌,我看到它從一個修訂切換到另一個,但無法弄清楚如何處理它 – makison