[英]Repository not being cloned inside a docker container using LibGit2Sharp
我目前正在使用 .net 標准 2.0 部署微服務,它可以從 GitLab 克隆或更新存儲庫。
為此,我有一個可以在 Windows 環境中完美運行的功能,但在我啟動它之后,它在 docker 容器內無法發揮作用。
if (gitFolder.GetDirectories().Length == 0)
{
try
{
// Get user credentials
Repository.Clone("repository.git", deployerPath, new CloneOptions()
{
BranchName = "develop",
CredentialsProvider = CredentialsProvider(),
});
}
catch (Exception ex)
{
...
}
}
else
{
try
{
var repository = new Repository(deployerPath);
Commands.Pull(repository,
new Signature("blah", "blah@blah.com", DateTimeOffset.Now), new PullOptions()
{
FetchOptions = new FetchOptions() {CredentialsProvider = CredentialsProvider()},
MergeOptions = new MergeOptions() {FailOnConflict = true},
});
}
...
我希望看到包含所有子文件夾/文件的文件夾,就像在 Windows 中一樣,但它始終是空的。 此外,文件夾的時間戳會在它應該進行拉取時更新。
這是 Linux 發行版的信息:
Linux 828ec2e85f2c 4.9.184-linuxkit #1 SMP 2019 年 7 月 2 日星期二 22:58:16 UTC x86_64 GNU/Linux
我看到了其他問題,他們 state 拉動時應該進行一些初始化設置,但至少應該發生克隆(根據我讀過的內容)。
任何幫助是極大的贊賞。
添加一些日志記錄后,我發現這是錯誤消息: too many redirects or authentication replays 。 因此,我繼續應用針對該問題所述的解決方案以使其發揮作用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.