Today I setup a yet another flavor of a NuGet feed, TeamCity NuGet Feed and NuGet Gallery. The TeamCity NuGet Feed was effortless and completed in less than five minutes once I upgraded to 7.0 ( Whats new in TeamCity 7.0 ). NuGet Gallery setup is simple, granted not as simple as TeamCity NuGet Server setup but easy enough to be up in less than 10 minutes.
In addition, discovered a few new offerings related to NuGet Community today. NuGetFeed.org provides the ability to add packages to a personalized feed or follow releases until a stable package is released. The site also offers a Chrome browser extension to follow NuGet packages as RSS feeds and Visual Studio Extension to export referenced NuGet packages to NuGetFeed.org from the VS IDE. TFS nugetter is an extension for TFS 2010 build process performing all of the necessary versioning, packaging, and deployment functions in a customizable and completely repeatable manner. An update to the Community TFS Build Extensions was released this past January.
Community TFS Build Extensions is a collection of around 100 activities that can provide many commonly requested functions including running CodeMetrics and NUnit tests, creating a Zip archive, wrapping RoboCopy for deployment, updating AssemblyInfo files, running StyleCop, merging assemblies with ILMerge etc etc.
Listed below are the personalization options for NuGet that I’m aware of at the time of this writing. The post outlines TeamCity and NuGet Gallery options.
Personalized NuGet Feed Options:
- Network Share
- Own Local Cache
- NuGet Server
- NuGet Gallery
- NuGet Orchard Gallery
- TeamCity
- NuGetFeed.org
- MyGet
Go Pro NuGet!
Time to knockout TeamCity 7.0 NuGet Feed Server setup in a few minutes ( this does not include upgrade time ) then tackle the slightly more complicated NuGet Gallery setup.
TeamCity NuGet Support
TeamCity 7.0 out of the box supports NuGet integration.
- installing and updating NuGet packages on agents
- creating NuGet packages
- publishing package to a given NuGet feed
- act as a NuGet feed server
- trigger builds on changes in a specified NuGet package
TeamCity NuGet Setup
Installation and upgrade of TeamCity is out of scope. Please leverage the provide links to learn more about TeamCity 7.0 instillation or upgrade path. Once TeamCity 7.0 us up configuration of the NuGet Feed Server takes less than 5 minutes.
PreRequesits
- TeamCity 7.0 Installation and Upgrade
TeamCity NuGet Feed Server Setup
- Login with
Adminstrator Role
- Click on
Adminstration
link in upper right corner - Click on
Integrations -> NuGet Settings
link on left menu - Click on NuGet Server
Enable
button to enable the NuGet Feed Server - Click on the
Authentication Feed URL
to view the feed in a browser, notice you must authenticate. - To allow public access the Guest User Log-on must be enabled.
- Added the TeamCity Feed to your Package Manager package sources
Tools -> Library Package Manager -> Package Manager Settings
- Click
Package Sources
under Package Manager on the left Options section - Add a name NuGet TeamCity Feed
- Paste in the public URL for TeamCity NuGet Feed Server
- Click Add button
TeamCity NuGet Command Line Setup
- Login with
Adminstrator Role
- Click on
Adminstration
link in upper right corner - Click on
Integrations -> NuGet Settings
link on left menu - Click on
NuGet Commandline
tab - Click on
Download NuGet
to install the latest version of NuGet command line bootstrapper - Notice TeamCity permits multiple versions of NuGet Command Line to be installed
NuGet Gallery Setup
Before we jump into the setup. If you have not already seen Enterprise NuGet talk Scott Hanselman at Tech Ed last year it is a MUST
. There are a few post regarding NuGet Gallery setup BUT the post most helpful to me was by Michael Cernaski How to Set Up a Local NuGet Gallery. That said, I will make reference to Michael’s post and add additional details or further explanation related to my setup experience. Please read Michaels post before continuing BUT do not start the process until reviewing the steps below as I’ve changed the order and altered some content.
First, I will reiterate, at the time of this writing the NuGet documentation on setting up a local NuGet Gallery is outdated. Outlined below are the steps, in order, with altered content that supplement the steps in Michael’s blog post. I recommend following the steps below in order and refer to Michaels blog for additional details on certain brief steps.
- Visual Studio 2010 or greater
- PowerShell 2.0.
- NuGet VS Extension NuGet Command Line
- Windows Azure SDK – Both PowerShell and the Windows Azure SDK can also be installed via the Microsoft Web Platform Installer.
- Download latest source from GitHub
- Open SQL Server Management Studio, create a new database user for NuGet Gallery database ( db does not exist yet leave set to master) usr_nuget. For now grant the user db_creator to permit EF to setup db on first run.
- Update web.config settings and database connection ( using user name and password ) in Website directory
- Update /WebSite/Content/Images/nugetlogo.png to be unique to you
- Run Build-Solution.ps1 using PowerShell ( you must have unrestricted execution policy set )
- Open IIS Manager, create new application pool for .NET 4.0 with integrated pipeline
- Create a new
WebSite
, called NuGetMyCustomNameGallery and set to physical path to WebSite dir. - If Web Site is not started, start it and browse to site and register a new user for yourself
- Open SQL Server Management Studio, remove the db_create permission for the usr_nuget, save. Now set usr_nuget to NuGetGallery database and only grant db_datareader and db_datawriter permission.
- Update your user account to be administrator by running the following code against the database.
- Navigate to your site dbadmin view –
http://localhost:8111/dbadmin
- Click on
GallerySettings
to set SMTP settings, GalleryOwnerName and GalleryOwnerEmail. You can manage the rest of the site here too.
1 2 3 |
|
1 2 |
|