COB.NET R2 Program - 02 June 2014 Guidance Automation Toolkit VISUG 09/08/2006 Jelle Druyts .
Visug - organize your chickens - nuget for the enterprise
-
Upload
xavier-decoster -
Category
Technology
-
view
826 -
download
2
description
Transcript of Visug - organize your chickens - nuget for the enterprise
![Page 1: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/1.jpg)
www.visug.be
![Page 2: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/2.jpg)
NuGet for the Enterprise
Organize your chickens
![Page 3: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/3.jpg)
www.visug.be
Who are we?
• Maarten Balliauw• Antwerp, Belgium• www.realdolmen.com • Focus on web
– ASP.NET, ASP.NET MVC, PHP, Azure, …– MVP Windows Azure (formerly ASP.NET)
• http://blog.maartenballiauw.be • @maartenballiauw
![Page 4: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/4.jpg)
www.visug.be
Who are we?
• Xavier Decoster• Antwerp, Belgium• www.realdolmen.com • Focus on web/ALM
– Visual Studio, TFS, Scrum, ...– Silverlight, ASP.NET, ASP.NET MVC, …
• http://www.xavierdecoster.com• @xavierdecoster
![Page 5: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/5.jpg)
www.visug.be
Agenda
• Chickens?• NuGet• Scenarios
– Host your own NuGet repository– Continuous (Package) Integration– (Ab)using NuGet
• Conclusion
![Page 6: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/6.jpg)
www.visug.be
Welcome to Dependency Hell
“A term for the frustration of software users who have installed software packages which have dependencies on specific versions of other software packages.” Source: Wikipedia
![Page 7: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/7.jpg)
www.visug.be
Cause and Effect
• Reinventing the wheel– We don’t need that dependency– “If they can do it, we can do it, but better” What happened to reuse of components?
• Marketing does the versioning– People are waiting for v2 to buy– Let’s call it v4 Platform Update SP3
November Edition KB2348063 RTW Refresh We lost ownership of AssemblyVersion ?
![Page 8: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/8.jpg)
www.visug.be
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.”
![Page 9: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/9.jpg)
www.visug.be
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
![Page 10: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/10.jpg)
www.visug.be
Advanced usage scenarios
• Host your own NuGet repository• Continuous (Package) Integration• (Ab)using NuGet
![Page 11: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/11.jpg)
www.visug.be
HOSTING YOUR OWN REPOSITORY
![Page 12: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/12.jpg)
www.visug.be
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
![Page 13: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/13.jpg)
www.visug.be
Solutions
• Folder / File share• Orchard Gallery (or NuGet Gallery)• NuGet.Server package• MyGet
![Page 14: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/14.jpg)
www.visug.be
NUGET.SERVER DEMOInstall-Package NuGet.Server
![Page 15: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/15.jpg)
www.visug.be
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 to develop if
you want something more useful
![Page 16: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/16.jpg)
www.visug.be
Meet MyGet
• www.myget.org• NaaS
– Register and off you go! (no dev)
• Supports Enterprise scenarios– Granular security– Package mirroring
![Page 17: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/17.jpg)
www.visug.be
MYGET DEMOLog in to www.myget.org and get started
![Page 18: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/18.jpg)
www.visug.be
CONTINUOUS (PACKAGE) INTEGRATION
![Page 19: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/19.jpg)
www.visug.be
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
![Page 20: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/20.jpg)
www.visug.be
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.
![Page 21: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/21.jpg)
www.visug.be
Continuous (Package) Integration
• Can I get rid of all these referenced assemblies duplicated all-over my source control system?Yes!
• Do I need to install and maintain NuGet on all my build agents?No!
![Page 22: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/22.jpg)
www.visug.be
NUGETPOWERTOOLS DEMO
Organize your build chickens!
![Page 23: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/23.jpg)
www.visug.be
3rd parties don’t belong in your SCM
• Replace them with NuGet packages• Commit packages/repositories.config
files• Use NuGetPowerTools Enable-PackageRestore
• Set package-source location(s)(NuGet.settings.targets in $(SolutionDir)\.nuget folder)
![Page 24: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/24.jpg)
www.visug.be
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
![Page 25: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/25.jpg)
www.visug.be
Organize your chickens
• Feed structuring– Scoped by quality: Build, QA, Production,
…– Scoped by audience: public, restricted
access– Other:
• Scoped by product version, milestone…• Scoped by target platform
![Page 26: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/26.jpg)
www.visug.be
(AB)USING NUGET
![Page 27: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/27.jpg)
www.visug.be
Guidance
• Publishing a package brings great responsibility– Breaking changes in your packages
should be versioned accordingly!– Consumers might choose to no longer
consume any packages you published
![Page 28: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/28.jpg)
www.visug.be
Guidance
• Package Integration ≠ Integration Testing– CI builds reflect output of source control
input– Same input always produces same
output
Do not auto-update packages during automated builds
![Page 29: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/29.jpg)
![Page 30: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/30.jpg)
www.visug.be
(Ab)using NuGet?
• Change of perspective
NuGet is a package managerNuGet is a protocol for distributing packages
![Page 31: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/31.jpg)
www.visug.be
EXTENDING NUGETScaffolding, CmdLets, Plug-ins, …
![Page 32: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/32.jpg)
www.visug.be
Automate deployments
• Build results in .nupkg• Octopus deploys to its tentacles
– Test tentacles– Staging tentacles– Production tentacles
• www.octopusdeploy.com
![Page 33: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/33.jpg)
www.visug.be
![Page 34: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/34.jpg)
www.visug.be
Chocolatey
• NuGet– developer library packages
• Chocolatey– applications and tools packager– “yum” or “apt-get” for Windows
• www.chocolatey.org
![Page 35: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/35.jpg)
www.visug.be
CHOCOLATEY DEMONuGet desert
![Page 36: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/36.jpg)
www.visug.be
Orchard / WebMatrix / …
• NuGet not bound to VS• Orchard CMS: modules & themes• WebMatrix: install page helpers on
the fly• Your app: offer plugins through a
repo
![Page 37: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/37.jpg)
www.visug.be
CONCLUSION
![Page 38: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/38.jpg)
www.visug.be
• Dependencies & people are chickensDeal with them! NuGet can help
• Set up your own NuGet repository for various reasons
• Continuous package integration
• NuGet is a package managerNuGet is a protocol
Conclusion
![Page 39: Visug - organize your chickens - nuget for the enterprise](https://reader035.fdocuments.in/reader035/viewer/2022070303/54b4e93b4a7959cd418b45da/html5/thumbnails/39.jpg)
www.visug.be
THANK YOU!Any questions?
http://blog.maartenballiauw.be @maartenballiauw
http://www.xavierdecoster.com@xavierdecoster