Your SlideShare is downloading. ×
0
Organize your chickens<br />NuGet for the Enterprise<br />
Who are we?<br />Maarten Balliauw<br />Antwerp, Belgium<br />www.realdolmen.com<br />Focus on web<br />ASP.NET, ASP.NET MV...
Who are we?<br />Xavier Decoster<br />Antwerp, Belgium<br />www.realdolmen.com<br />Focus on web/ALM<br />Visual Studio, T...
Agenda<br />Chickens?<br />NuGet<br />Scenarios<br />Host your own NuGet repository<br />Continuous (Package) Integration<...
Welcome to Dll Hell<br />Dependency Hell<br />
WelcometoDependency Hell<br />“A term for the frustrationof software users who have installedsoftware packageswhich have  ...
Causeand Effect<br />Reinventing the wheel<br />We don’tneedthatdependency<br />“If they can do it, we can do it, but bett...
Package Management<br />Using NuGet<br />
Package Management<br />NuGet to the Rescue!<br />“NuGet is a Visual Studio extension that makes it easy to install and up...
Package What?<br />Package Management<br />Simple concept<br />Find Packages<br />(Re)Use Packages<br />Produce Packages<b...
GettingStarted<br />Tooling:<br />NuGet Package Manager (http://nuget.org)<br />NuGet Package Explorer (http://npe.codeple...
Consuming Packages<br />Simple as adding a reference<br />
Onedialogtorulethemall…<br />Install-Package<br />Update-Package<br />Uninstall-Package<br />Settings<br />Package Sources...
NuGet Package Manager Console<br />PowerShellenabled!<br />Extensible!<br />Scaffolding, NuGetPowerTools, …<br />%UserProf...
Configurable Package Sources<br />Configurablethrough…<br />NuGet Library Package Manager (VS add-in)<br />NuGet.config (i...
Creating Packages<br />What’s a package?<br />Just a zip-filecontaining:<br />… content and source code (tobeinjectedinto ...
Package Conventions<br />Conventions<br />http://docs.nuget.org/docs/creating-packages/Package-Conventions<br />Folder str...
NuGet Manifest Specification<br />NuSpec manifest<br />XML file (with XSD available)<br />Package metadata<br />
Semantic Versioning<br />Think about your versioning! (semver.org)<br />Always specifylowerbound<br />Use a version range ...
Advanced usage scenarios<br />Host your own NuGet repository<br />Continuous (Package) Integration<br />(Ab)using NuGet<br />
Hosting your own repository<br />Those chickens are mine!<br />
Hosting your own repository<br />NuGet = public feed<br />Privacy<br />Intellectual property<br />NuGet maintained by pack...
Solutions<br />Folder / File share<br />Orchard Gallery (or NuGet Gallery)<br />NuGet.Server package<br />MyGet<br />
NuGet.Server Demo<br />Install-Package NuGet.Server<br />
NuGet.Serverlimitations<br />Only 1 feed per installation<br />No UI: up toyoutobuildit<br />No granular security: only 1 ...
Meet MyGet<br />www.myget.org<br />NaaS<br />Register and off you go! (no dev)<br />Supports Enterprise scenarios<br />Gra...
MyGet Demo<br />Log in to www.myget.org and get started<br />
Continuous (Package) Integration<br />Fetch the chickens when you need them<br />
Typical source control...<br />Contains /References (if you are lucky)<br />...and also Project/_bin_deployable_assemblies...
Dependencies<br />Software has dependencies. Deal with it.<br />But are those YOUR intellectual property?<br />YOUR reason...
Continuous (Package) Integration<br />Can I get rid of all these referencedassembliesduplicatedall-over my source control ...
3rd partiesdon’tbelong in your SCM<br />Source control bloatedwiththird-party binaries?<br />Replacethem with NuGet packag...
Problem!<br />NuGet feed is subject to change...<br />PackageSourceMSBuild property to the rescue<br />NuGet.settings.targ...
Organizeyourchickens<br />Feed structuring<br />Scopedbyquality: Build, QA, Production, …<br />Scopedbyaudience: public, r...
(Ab)using NuGet<br />
Guidance<br />Publishing a package bringsgreatresponsibility<br />Breakingchanges in your packages shouldbeversionedaccord...
Guidance<br />Package Integration ≠ Integration Testing<br />CI buildsreflect output of source control input<br />Same inp...
(Ab)using NuGet?<br />Change of perspective<br />NuGet as a package manager<br />NuGet as a protocol for distributing pack...
ExtendingNuGet<br />Scaffolding, CmdLets, Plug-ins, …<br />
Scaffolding<br />T4, Mvc, …<br />CreateyourownPowerShellcmdlets<br />Automate Visual Studio (access to DTE)<br />
Automate deployments<br />Build results in .nupkg<br />Octopus deploys to its tentacles<br />Test tentacles<br />Staging t...
NuGet command line plug-ins<br />Extend NuGet.exe<br />Custom Commands<br />How?<br />Build class library<br />Reference N...
Chocolatey<br />NuGet<br />developer library packages<br />Chocolatey<br />applications and tools packager<br />“yum” or “...
Chocolatey Demo<br />NuGet desert<br />
Orchard / WebMatrix / …<br />NuGetnotboundto VS<br />Orchard CMS: modules & themes<br />WebMatrix: install page helpers on...
Conclusion<br />
Dependencies & people are chickens<br /><ul><li>Deal with them! NuGet can help</li></ul>Set up your own NuGet repository f...
Thank you!<br />Any questions?<br />http://blog.maartenballiauw.be <br />@maartenballiauw <br />http://www.xavierdecoster....
Organize your chickens: NuGet for the enterprise
Upcoming SlideShare
Loading in...5
×

Organize your chickens: NuGet for the enterprise

4,695

Published on

Managing software dependencies, whether those created in-house or from third parties can be a pain in the behind. Whether dependencies feel like wild chickens or people run around like chickens dealing with dependencies, the NuGet package manager can be a cure. Let us guide you to creating enterprise (chicken) NuGets and dealing with them in a structured, easy-to-maintain manner. From developer workstation to build server, NuGet tastes great! We'll provide you the dip sauce.

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
4,695
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
44
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide
  • Maarten
  • Maarten
  • Xavier
  • Xavier
  • Xavier
  • XavierMaarten
  • Maarten
  • NuGet Install-PackageWhen you use NuGet to install a package, it copies the library files to your solution and automatically updates your project (add references, change config files, etc). NuGet Uninstall-PackageIf you remove a package, NuGet reverses whatever changes it made so that no clutter is left.
  • Xavier: Terugverwijzen naar “Marketing versioning”
  • Xavier
  • Maarten
  • Maarten
  • Maarten
  • XavierStart with empty MVC template + addNuGet.ServerpkgRun siteDrop pkgs in packages folderRefresh browserFeed toevoegen in VS &amp; show pkgs
  • Xavier
  • Maarten
  • MaartenInloggen en feed aanmakenPackage pushen vanuit NPEFeed toevoegen aan VSOp MyGet feed security instellenPackage installen in VS en tonen dat er basic auth bijkomtPackage vanNuGet toevoegen op MyGet en tonen dat je alle dependencies kan meepakken, mirroring, … en dat je ook gewoon van uw packages.config kan toevoegen
  • Xavier
  • Xavier
  • Xavier
  • Maarten
  • Maarten
  • Xavier- Het feit dat NuGet.org geen garanties biedt op content- Wat als mensen packages verwijderen? BUILD breaks, DEVS unhappy again
  • Maarten -&gt; Xavier
  • Xavier
  • Xavier
  • Xavier
  • Maarten
  • Maarten
  • TODO Scaffolding? Toevoegen van functies?Eventueel de NuGet.exe plugins ook nog tonen?
  • Maarten
  • Maarten
  • Xavier
  • Xavier
  • Maarten
  • XavierMaartenXavierMaarten
  • Transcript of "Organize your chickens: NuGet for the enterprise"

    1. 1. Organize your chickens<br />NuGet for the Enterprise<br />
    2. 2. Who are we?<br />Maarten Balliauw<br />Antwerp, Belgium<br />www.realdolmen.com<br />Focus on web<br />ASP.NET, ASP.NET MVC, PHP, Azure, …<br />MVP Windows Azure (formerly ASP.NET)<br />http://blog.maartenballiauw.be<br />@maartenballiauw<br />
    3. 3. Who are we?<br />Xavier Decoster<br />Antwerp, Belgium<br />www.realdolmen.com<br />Focus on web/ALM<br />Visual Studio, TFS, Scrum, ...<br />Silverlight, ASP.NET, ASP.NET MVC, …<br />http://www.xavierdecoster.com<br />@xavierdecoster<br />
    4. 4. Agenda<br />Chickens?<br />NuGet<br />Scenarios<br />Host your own NuGet repository<br />Continuous (Package) Integration<br />(Ab)usingNuGet<br />Conclusion<br />
    5. 5. Welcome to Dll Hell<br />Dependency Hell<br />
    6. 6. WelcometoDependency Hell<br />“A term for the frustrationof software users who have installedsoftware packageswhich have dependencieson specificversionsof other software packages.”<br />Source: Wikipedia<br />
    7. 7. Causeand Effect<br />Reinventing the wheel<br />We don’tneedthatdependency<br />“If they can do it, we can do it, but better”<br />Marketing does the versioning<br />People are waitingfor v2 tobuy<br />Let’s call it v4 Platform Update SP3 November Edition KB2348063 RTW Refresh<br /> Whathappenedtoreuse of components?<br /> We lost ownership of AssemblyVersion ?<br />
    8. 8. Package Management<br />Using NuGet<br />
    9. 9. Package Management<br />NuGet to the Rescue!<br />“NuGet is a Visual Studio extension that makes it easy to install and update open source libraries and tools in Visual Studio.”<br />
    10. 10. Package What?<br />Package Management<br />Simple concept<br />Find Packages<br />(Re)Use Packages<br />Produce Packages<br />“…a collection of software tools to automate the process of installing, upgrading, configuring, and removingsoftware packages…”<br />Wikipedia<br />
    11. 11. GettingStarted<br />Tooling:<br />NuGet Package Manager (http://nuget.org)<br />NuGet Package Explorer (http://npe.codeplex.com)<br />Install-Package NuGetPowerTools<br />Install-Package NuGet.CommandLine<br />Guidanceanddocumentation<br />http://docs.nuget.org<br />
    12. 12. Consuming Packages<br />Simple as adding a reference<br />
    13. 13. Onedialogtorulethemall…<br />Install-Package<br />Update-Package<br />Uninstall-Package<br />Settings<br />Package Sources<br />Local (offline) Cache location<br />Also: Manage packages on solution level!<br />Right-click solution > Manage NuGet Packages…<br />
    14. 14. NuGet Package Manager Console<br />PowerShellenabled!<br />Extensible!<br />Scaffolding, NuGetPowerTools, …<br />%UserProfile%DocumentsWindowsPowerShellNuGet_profile.ps1<br />
    15. 15. Configurable Package Sources<br />Configurablethrough…<br />NuGet Library Package Manager (VS add-in)<br />NuGet.config (in %APPDATA%RoamingNuGetNuGet.config)<br />NuGet.settings.targets (MSBUILD file part of NuGetPowerTools)<br />
    16. 16. Creating Packages<br />What’s a package?<br />Just a zip-filecontaining:<br />… content and source code (tobeinjectedinto target project)<br />… PowerShell scripts andexecutables<br />… configuration file and source code transformations<br />http://docs.nuget.org/docs/creating-packages/Configuration-File-and-Source-Code-Transformations<br />
    17. 17. Package Conventions<br />Conventions<br />http://docs.nuget.org/docs/creating-packages/Package-Conventions<br />Folder structure<br />Tools (init.ps1, install.ps1, uninstall.ps1)<br />Content<br />Manifest (.nuspec file)<br />Lib<br />
    18. 18. NuGet Manifest Specification<br />NuSpec manifest<br />XML file (with XSD available)<br />Package metadata<br />
    19. 19. Semantic Versioning<br />Think about your versioning! (semver.org)<br />Always specifylowerbound<br />Use a version range (lowerbound + upperbound) whenversioning of package youdepend on is messed up<br />
    20. 20. Advanced usage scenarios<br />Host your own NuGet repository<br />Continuous (Package) Integration<br />(Ab)using NuGet<br />
    21. 21. Hosting your own repository<br />Those chickens are mine!<br />
    22. 22. Hosting your own repository<br />NuGet = public feed<br />Privacy<br />Intellectual property<br />NuGet maintained by package authors<br />Author removes v1.0.45 and you depend on it<br />
    23. 23. Solutions<br />Folder / File share<br />Orchard Gallery (or NuGet Gallery)<br />NuGet.Server package<br />MyGet<br />
    24. 24. NuGet.Server Demo<br />Install-Package NuGet.Server<br />
    25. 25. NuGet.Serverlimitations<br />Only 1 feed per installation<br />No UI: up toyoutobuildit<br />No granular security: only 1 API-keyforentire feed<br />Conclusion: requiresyoutodevelopifyou want something more useful<br />
    26. 26. Meet MyGet<br />www.myget.org<br />NaaS<br />Register and off you go! (no dev)<br />Supports Enterprise scenarios<br />Granular security<br />Package mirroring<br />
    27. 27. MyGet Demo<br />Log in to www.myget.org and get started<br />
    28. 28. Continuous (Package) Integration<br />Fetch the chickens when you need them<br />
    29. 29. Typical source control...<br />Contains /References (if you are lucky)<br />...and also Project/_bin_deployable_assemblies<br />...and also /References/old<br />...and also /..././../.././References<br />Usually references GAC-ed assemblies<br />
    30. 30. Dependencies<br />Software has dependencies. Deal with it.<br />But are those YOUR intellectual property?<br />YOUR reason to build software?<br />YOUR product?<br />No. They are dependencies. And they don’t belong in source control.<br />
    31. 31. Continuous (Package) Integration<br />Can I get rid of all these referencedassembliesduplicatedall-over my source control system?<br /><ul><li>Yes!</li></ul>Do I needtoinstallandmaintainNuGet on allmybuildagents?<br /><ul><li>No!</li></li></ul><li>NuGetPowerTools Demo<br />Organize your build chickens!<br />
    32. 32. 3rd partiesdon’tbelong in your SCM<br />Source control bloatedwiththird-party binaries?<br />Replacethem with NuGet packages<br />Commitpackages.config/repositories.config files<br />Preferablynot the packages<br />Use NuGetPowerTools<br />Enable-PackageRestore<br />
    33. 33. Problem!<br />NuGet feed is subject to change...<br />PackageSourceMSBuild property to the rescue<br />NuGet.settings.targets in $(SolutionDir).nuget folder<br />Nowwhat...<br />Host yourown feed andmirrorthird-party packages<br />InternalNuGet.Server<br />Network Share<br />Or useMyGetforthat<br />
    34. 34. Organizeyourchickens<br />Feed structuring<br />Scopedbyquality: Build, QA, Production, …<br />Scopedbyaudience: public, restricted access<br />Other: <br />Scopedby product version, milestone…<br />Scopedby target platform<br />
    35. 35. (Ab)using NuGet<br />
    36. 36. Guidance<br />Publishing a package bringsgreatresponsibility<br />Breakingchanges in your packages shouldbeversionedaccordingly!<br />Consumersmightchooseto no longerconsumeany packages youpublished<br />
    37. 37. Guidance<br />Package Integration ≠ Integration Testing<br />CI buildsreflect output of source control input<br />Same input alwaysproducessame output<br />Do not auto-update packages duringautomatedbuilds!<br />
    38. 38.
    39. 39. (Ab)using NuGet?<br />Change of perspective<br />NuGet as a package manager<br />NuGet as a protocol for distributing packages<br />
    40. 40. ExtendingNuGet<br />Scaffolding, CmdLets, Plug-ins, …<br />
    41. 41. Scaffolding<br />T4, Mvc, …<br />CreateyourownPowerShellcmdlets<br />Automate Visual Studio (access to DTE)<br />
    42. 42. Automate deployments<br />Build results in .nupkg<br />Octopus deploys to its tentacles<br />Test tentacles<br />Staging tentacles<br />Production tentacles<br />www.octopusdeploy.com<br />
    43. 43.
    44. 44. NuGet command line plug-ins<br />Extend NuGet.exe<br />Custom Commands<br />How?<br />Build class library<br />Reference NuGet.exe<br />Inherit Command<br />Deploy your dll to %LocalAppData%NuGetCommands<br />
    45. 45. Chocolatey<br />NuGet<br />developer library packages<br />Chocolatey<br />applications and tools packager<br />“yum” or “apt-get” for Windows<br />www.chocolatey.org<br />
    46. 46. Chocolatey Demo<br />NuGet desert<br />
    47. 47. Orchard / WebMatrix / …<br />NuGetnotboundto VS<br />Orchard CMS: modules & themes<br />WebMatrix: install page helpers on the fly<br />Yourapp: offer pluginsthrough a repo<br />
    48. 48. Conclusion<br />
    49. 49. Dependencies & people are chickens<br /><ul><li>Deal with them! NuGet can help</li></ul>Set up your own NuGet repository for various reasons<br />Continuous package integration<br />NuGet is a package manager<br /><ul><li>NuGet is a protocol</li></ul>Conclusion<br />
    50. 50. Thank you!<br />Any questions?<br />http://blog.maartenballiauw.be <br />@maartenballiauw <br />http://www.xavierdecoster.com<br />@xavierdecoster<br />
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×