没有使用LibGit2Sharp在Docker容器内克隆存储库

问题描述 投票:0回答:1

我目前正在使用.net standard 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", "[email protected]", DateTimeOffset.Now), new PullOptions()
            {
                FetchOptions = new FetchOptions() {CredentialsProvider = CredentialsProvider()},
                MergeOptions = new MergeOptions() {FailOnConflict = true},
            });
    }
    ...

我希望可以像在Windows中那样看到包含所有子文件夹/文件的文件夹,但是它始终为空。另外,该文件夹的时间戳在执行拉操作时也会更新。

这是Linux发行版的信息:

Linux 828ec2e85f2c 4.9.184-linuxkit#1 SMP Tue Jul 2 22:58:16 UTC 2019 x86_64 GNU / Linux

我看到其他问题,其中指出在拉动时应该进行一些初始化设置,但是至少应该进行克隆(根据我的阅读)。

非常感谢您的帮助。

c# docker .net-standard-2.0 libgit2sharp
1个回答
0
投票

添加一些日志后,我发现这是错误消息:重定向或身份验证重放过多。因此,我继续使用解决方案for this question使其生效。

© www.soinside.com 2019 - 2024. All rights reserved.