2016-05-19 4 views
1

Das Projekt wurde unter Mono entwickelt und hängt von einigen Nugget-Paketen ab. Ich verwende Gitlab CI, um Builds auszuführen. Die Build-Umgebung ist Docker Ubuntu. Alle anderen apt-get Installationen funktionieren perfekt, aber nuget stellt die Pakete nie wieder her, egal wie ich die Parameter ändere und NuGet.config. Ich wechselte zwischen v2 und v3 und versuchte alles besprochen, was ich im Internet finden können:NUget-Pakete eines Monoprojekts können nicht unter der Gitlab CI-Docker-Umgebung wiederhergestellt werden

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

bekommt aber immer noch die folgenden Fehler:

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 

Referenzen:

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

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

Auf meiner lokalen Maschine kann ich erfolgreich alle Pakete aus Online-Quelle mit genau den gleichen Befehlen wiederherstellen.

+0

Was ist in Ihrer nuget.conf? Ich musste Repository-Quellen zu meinem hinzufügen ** und noch ** speziell hinzufügen eine Reihe von Paket-Downloads mit dem Source-Parameter zu _nuget install_. Es scheint, dass einige Pakete mit _nugget restore_ nicht richtig angezeigt werden, also zwang ich einfach ihren Download. Ich benutze Bamboo für Builds. – Marakai

Antwort

0

Je nachdem, welche Version von Ubuntu Sie verwenden, das Hinzufügen ca-certificates-mono Ihrer Umgebung helfen können:

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

Ich verwende Docker mit Stretch und this thread fixiert meine identisch Problem zu Ihnen.

Verwandte Themen