UgiAlt.NET - Organize your Chickens: NuGet for the Enterprise

UgiAlt.NET - Organize your Chickens: NuGet for the Enterprise

946ee540fb9ff876905c6d3d25db0ac7?s=128

Xavier Decoster

January 20, 2012
Tweet

Transcript

  1. www.ugialt.net

  2. NuGet for the Enterprise Organize YourChickens

  3. Who am I? › Xavier Decoster › Antwerp, Belgium ›

    Focus on  What matters › www.xavierdecoster.com › @xavierdecoster
  4. Agenda › NuGet › Scenarios  Host your own NuGet

    repository  Continuous {Package} Integration  {Ab}using NuGet  NuGet Inception › Conclusion Chickens?!
  5. Welcome to Dependency Hell “A term for the frustration of

    software users who have installed software packageswhich have dependencies on specific versions of other software packages.” (Wikipedia)
  6. Cause and Effect › Reinventingthe wheel  We don’tneedthatdependency 

    “If they can do it, we can do it, but better” › Marketing-DrivenVersioning  People are waitingforv2 tobuy  Let’s call it v4 Platform Update SP3 November Edition KB2348063 RTW Refresh
  7. Package Management › NuGet to the Rescue! › Simple concept

     Find Packages  {Re}Use Packages  Produce Packages “NuGet is a Visual Studio extension that makes it easy to install and update open source libraries and tools in Visual Studio.”
  8. Semantic Versioning › Think about your versioning! {semver.org}  Always

    specify lowerbound  Use a version range {lowerbound + upperbound} when versioning of package you depend on is messed up Major Breaking changes Minor Backwards compatible API additions/changes Patch Bugfixes not affecting the API
  9. Advanced usage scenarios › Host your own NuGet repository ›

    Continuous{Package} Integration › {Ab}usingNuGet
  10. Hosting your own repository

  11. Hosting your own repository › NuGet = public feed 

    Privacy  Intellectual property › NuGet maintained by package authors  Author removes v1.0.45 and you depend on it
  12. Solutions › Folder / File share › NuGet.Serverpackage › NuGet

    Gallery {or Orchard Gallery} › MyGet
  13. NuGet.Server Demo // Install-Package NuGet.Server

  14. NuGet.Server limitations › Only 1 feed per installation › No

    UI  up to you to build it › No granular security  only 1 API-key for entire feed › Conclusion: requires you todevelop if you want something more useful
  15. Meet MyGet › www.myget.org › NaaS  Register andoff you

    go! › Supports Enterprise scenarios  Granular security  Package mirroring
  16. MyGet Demo // Sign in tomyget.org and get started

  17. Continuous {Package} Integration // Tochicken, or nottocheck-in

  18. Typical source control... › Contains /References {if you are lucky}

     ...and also Project/_bin_deployable_assemblies  ...and also /References/old  ...and also /..././../.././References › Usually references GAC-ed assemblies
  19. Dependencies › Software has dependencies. Deal with it. › But

    are those YOUR intellectual property?  YOUR reason to build software?  YOUR product? › No. They are dependencies. And they don’t belong in source control.
  20. Continuous {Package} Integration › Can I get rid of allthese

    referenced assemblies duplicated all-over my source control system? › Do I need to installandmaintainNuGet on allmy build agents?
  21. Enable-PackageRestore Demo // Organizeyour build chickens!

  22. 3rd parties don’t belong in your VCS › Replace them

    with NuGet packages › Do commit packages\repositories.configfile › Use Enable-PackageRestore › Set package-source location(s) (NuGet.settings.targets in $(SolutionDir)\.nuget folder)
  23. Problem! › NuGet feed is subject to change...  PackageSource

    msbuild property to the rescue › Now what...  Host your own feed and mirror packages  Or use MyGet for that 
  24. Organize yourchickens › Feed structuring  Scoped by quality: Build,

    QA, Production, …  Scoped by audience: public, restricted access  Other: Scopedby product version, milestone… Scopedby target platform
  25. {Ab}using NuGet // Notchickens…

  26. Guidance › Publishing a package brings great responsibility  Breaking

    changes in your packages should be versioned accordingly!  Consumers might choose to no longer consume anypackages you published
  27. Guidance › Package Integration ≠ Integration Testing  CI builds

    reflect output of source control input  Same input alwaysproduces same output  Do notauto-update packages duringautomated builds
  28. The Male Optical Illusion Stare at this picture. After about

    30 seconds you should begin to see a Boat appear in the background. Amazing! *** Some men report ittakes them several minutes tosee the boat, sobe patient andreally focus!!! ***
  29. {Ab}using NuGet? › Change of perspective NuGet is a package

    manager NuGet is a protocol for distributing packages
  30. NuGet as a Protocol // Automateanything: more time fora NaaP!

  31. Automate deployments › Build results in .nupkg › Octopus deploys

    to its tentacles  Test tentacles  Staging tentacles  Production tentacles › www.octopusdeploy.com
  32. None
  33. Chocolatey › NuGet  developer library packages › Chocolatey 

    applications and tools packager  “yum” or “apt-get” for Windows › www.chocolatey.org
  34. Chocolatey Demo // Nom-nom NuGet dessert

  35. NuGet Inception Build Test Package Push Release / Publish Deploy

    DEMO › ContinuousDelivery of the MyGet website using:  TeamCity  NuGet  MyGet  Octopus
  36. Dependencies & people are chickens Deal with them! NuGet can

    help Set up your own NuGet repository Continuouspackage integration NuGet is a package manager NuGet is a protocol Conclusion
  37. Thank you! // No chickenswerehurt // in the making of

    thispresentation http://www.xavierdecoster.com @xavierdecoster Stay for the price draw for a chance to win a copy