2016-05-19 2 views
1

Проект разработан в Mono и зависит от некоторых пакетов nuget. Я использую Gitlab CI для запуска сборок. Среда сборки является докере ubuntu. Все остальные установки apt-get работают отлично, но nuget никогда не восстанавливает пакеты независимо от того, как я изменяю параметры и NuGet.config. Я переключился между v2 и v3 и попытался все обсуждали в том, что я могу найти в интернете:Невозможно восстановить пакеты nuget монопроекта в среде докеры Gitlab CI

http://blog.davidebbo.com/2014/01/the-right-way-to-restore-nuget-packages.html

http://docs.myget.org/docs/how-to/package-not-found-during-package-restore

, но до сих пор получает следующие ошибки:

gitlab-ci-multi-runner 1.1.4 (9e2fd1a) 
Using Docker executor with image ruby:2.1 ... 
Pulling docker image ruby:2.1 ... 
... 
$ apt-get update -qq && apt-get install -y -qq 
$ apt-get install -y -qq mono-complete 
... 
$ wget https://dist.nuget.org/win-x86-commandline/latest/nuget.exe 
... 
$ mono nuget.exe restore monotest.sln -Source http://nuget.org/api/v2 
MSBuild auto-detection: using msbuild version '4.0' from '/usr/lib/mono/4.5'. 
Restoring NuGet package MongoDB.Bson.2.2.3. 
Restoring NuGet package MongoDB.Driver.2.2.3. 
Restoring NuGet package MongoDB.Driver.Core.2.2.3. 
Restoring NuGet package Newtonsoft.Json.8.0.3. 
WARNING: Unable to find version '2.2.3' of package 'MongoDB.Bson'. 
    /root/.local/share/NuGet/Cache: Package 'MongoDB.Bson.2.2.3' is not found on source '/root/.local/share/NuGet/Cache'. 
    http://nuget.org/api/v2: Unable to load the service index for source http://nuget.org/api/v2. 
    This method must be implemented in derived classes 

WARNING: Unable to find version '8.0.3' of package 'Newtonsoft.Json'. 
    /root/.local/share/NuGet/Cache: Package 'Newtonsoft.Json.8.0.3' is not found on source '/root/.local/share/NuGet/Cache'. 
    http://nuget.org/api/v2: Unable to load the service index for source http://nuget.org/api/v2. 
    This method must be implemented in derived classes 

WARNING: Unable to find version '2.2.3' of package 'MongoDB.Driver'. 
    /root/.local/share/NuGet/Cache: Package 'MongoDB.Driver.2.2.3' is not found on source '/root/.local/share/NuGet/Cache'. 
    http://nuget.org/api/v2: Unable to load the service index for source http://nuget.org/api/v2. 
    This method must be implemented in derived classes 

WARNING: Unable to find version '2.2.3' of package 'MongoDB.Driver.Core'. 
    /root/.local/share/NuGet/Cache: Package 'MongoDB.Driver.Core.2.2.3' is not found on source '/root/.local/share/NuGet/Cache'. 
    http://nuget.org/api/v2: Unable to load the service index for source http://nuget.org/api/v2. 
    This method must be implemented in derived classes 


Errors in packages.config projects 
    Unable to find version '2.2.3' of package 'MongoDB.Bson'. 
     /root/.local/share/NuGet/Cache: Package 'MongoDB.Bson.2.2.3' is not found on source '/root/.local/share/NuGet/Cache'. 
     http://nuget.org/api/v2: Unable to load the service index for source http://nuget.org/api/v2. 
     This method must be implemented in derived classes 
    Unable to find version '8.0.3' of package 'Newtonsoft.Json'. 
     /root/.local/share/NuGet/Cache: Package 'Newtonsoft.Json.8.0.3' is not found on source '/root/.local/share/NuGet/Cache'. 
     http://nuget.org/api/v2: Unable to load the service index for source http://nuget.org/api/v2. 
     This method must be implemented in derived classes 
    Unable to find version '2.2.3' of package 'MongoDB.Driver'. 
     /root/.local/share/NuGet/Cache: Package 'MongoDB.Driver.2.2.3' is not found on source '/root/.local/share/NuGet/Cache'. 
     http://nuget.org/api/v2: Unable to load the service index for source http://nuget.org/api/v2. 
     This method must be implemented in derived classes 
    Unable to find version '2.2.3' of package 'MongoDB.Driver.Core'. 
     /root/.local/share/NuGet/Cache: Package 'MongoDB.Driver.Core.2.2.3' is not found on source '/root/.local/share/NuGet/Cache'. 
     http://nuget.org/api/v2: Unable to load the service index for source http://nuget.org/api/v2. 
     This method must be implemented in derived classes 

NuGet Config files used: 
    /builds/renkun-ken/monotest/.nuget/NuGet.config 
    /root/.config/NuGet/NuGet.Config 

Feeds used: 
    /root/.local/share/NuGet/Cache 
    http://nuget.org/api/v2 

ERROR: Build failed: exit code 1 

рекомендации:

https://docs.nuget.org/consume/package-restore

https://docs.nuget.org/consume/command-line-reference

На моей локальной машине я могу успешно восстановить все пакеты из онлайн-источника с помощью тех же команд.

+0

Что находится в вашем nuget.conf? Я должен был добавить источники репозитория для моего ** и все еще ** специально добавить несколько загрузок пакетов, используя параметр -Source для _nuget install_. Кажется, что некоторые пакеты не отображаются должным образом с _nuget restore_, поэтому я просто заставил их загрузить. Я использую Bamboo для сборки. – Marakai

ответ

0

В зависимости от версии Ubuntu вы используете, добавив ca-certificates-mono в вашу среду может помочь:

apt-get install -y --allow-unauthenticated ca-certificates-mono 

Я использую Docker с Stretch и this thread сосредоточил свою идентичную проблему с вами.

Смежные вопросы