Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nexus and uploading artifacts for .NET Applications

Is there anyway that Nexus can be used as the artifact manager for the build output of a .NET application?

I very much understand Nexus can an excellent nuget proxy and internal artifact manager, however I need Nexus to operate a bit more downstream from those libaries and store the output of a TeamCity build.

I have looked into using the REST API to upload a zip file (of say an MVC website) but that doesn't look super sustainable. Any thoughts out there?

like image 919
AutomationNation Avatar asked Jun 15 '15 21:06

AutomationNation


2 Answers

Is there anyway that Nexus can be used as the artifact manager for the build output of a .NET application?

Yes, but nexus version must be 2.9 or later.

Sonatype: With the release of version 2.9, NuGet support is available in Nexus Repository Manager Pro and Nexus Repository Manager OSS.

You can use NuGet hosted repositories to upload output of build artifacts.

I very much understand Nexus can an excellent nuget proxy and internal artifact manager, however I need Nexus to operate a bit more downstream from those libaries and store the output of a TeamCity build. I have looked into using the REST API to upload a zip file (of say an MVC website) but that doesn't look super sustainable. Any thoughts out there?

Instead of rest api, I am using NuGet CLI.

nuget push foo.nupkg API-KEY -Source https://www.nuget.org/api/v2/hosted-repo/

Accessing nuget hosted repo with API-KEY explained here.

First; generate an API-KEY. enter image description here

Then; Activate the NuGey API-Key Realm enter image description here

Finally, you can use following command to push your nuget package to hosted nexus repository on Nexus

nuget push foo.nupkg {GENERATED-API-KEY} -Source http://localhost:8081/repository/nuget-hosted/
like image 54
clockworks Avatar answered Oct 02 '22 01:10

clockworks


Nexus supports hosted NuGet repositories that can be the deployment target of your nuget package you author internally. So you can sort of run an internal Nuget repo. Check out the documentation for NuGet with Nexus for more details on how to do the deployment.

http://books.sonatype.com/nexus-book/reference/nuget.html

There is also a good video intro available at http://www.sonatype.org/nexus/2015/06/04/license-and-vulnerability-tracking-for-nuget-packages-with-nexus-lifecycle/

Deploying a package would have to target a hosted repository and use authentication. Details can be found at http://books.sonatype.com/nexus-book/reference/nuget-deploying_packages_to_nuget_hosted_repositories.html

And if you do not want to use a nuget repository to store the build output, you could also e.g. upload a zip file to a Maven repository on the same server.

Once your build output is in a repository in Nexus (Maven or nuget) you can use e.g. plain HTTP GET calls with curl or anything else you want to download the install zip or so onto the deployment server and then install it there.

like image 43
Manfred Moser Avatar answered Oct 02 '22 01:10

Manfred Moser