SlideShare a Scribd company logo
CHOCOLATEY
Software deployments using
Who am i
Owain Perry
Software architect at thetrainline.com
Twitter: owainperry
Blog: owainperry.com
What is Chocolatey?
 Chocolatey NuGet is a Machine Package
Manager, somewhat like apt-get, but built
withWindows in mind. - See more at:
http://chocolatey.org/#sthash.WI0IhYUd.dpu
f
What is a package?
 A collection of stuff, glued into one file
 Msi
 Self extracting zip exe
 Zip file
 Nuget
 Rpm
 Etc…
What version is it?
 Packages should be versioned?
 Question:Which is more helpful?
 Setup.exe
 Setup_Notepadpp_1.2.3.4.exe
 Version.txt inside a zip file.
This is not new
 Unix has been doing this for the last 20 years
 Windows tried to do this with Msi #fail.
How do we get it there?
 What is wrong with this?
 //installers/files/notepadpp/setup.exe
 Share permissions
 Domain
 TCP / UDP Ports 135->139
 Only works “easily” on windows.
What is installed?
 How do we find out what is installed on a
machine?
 Check the registry (add / remove programs)?
 Scan in
 c:program files*
 C:program files x86*
 What about stuff installed elsewhere?
How do we replicate?
 We have multiple sites – how to replicate?
 Use windows file based replication
 Domain hell if not on one domain
 Polled replication every x minutes
 a pain and slow
 hard to see current state
 when is it broken?
Some technology we have been
using
 Nuget.
 Zip file containing stuff
 API for downloading a specific version via HTTP
 Wide adoption amongst the .NET community
 Written by *Microsoft*
 Lightweight (single .exe)
 Large active open source development
community
Artifactory
 Multiple repositories
 Virtual repositories
 Near real-time replication
 Simple to browse and search
 Thought? - Could use SEMVER and promote
packages between repositories
(environments)
This can help ops people?
 Use the same pattern for installing everything
 Same command line
 Single repository of packages easy to browse
 Obvious version selection
 Easy to script
 Abstract the implementation away – who cares?
What I want?
 Simple and easy to use command line
interface
 Download via HTTP
 Download a specific version(s)
 List packages that have been installed.
 Install / upgrade / uninstall options.
 Simple to create packages using known
language syntax.
Chocolatey
 Chocolatey NuGet is a Machine Package
Manager, somewhat like apt-get, but built
withWindows in mind. - See more at:
http://chocolatey.org/#sthash.WI0IhYUd.dpu
f
Chocolatey
 Nuget packages with extra stuff
 Tools/chocolatey-install.ps1
Commands
 chocolatey [install [packageName [-source source] [-version version] | pathToPac
 kagesConfig] | installmissing packageName [-source source] | update packageName
 [-source source] [-version version] | list [packageName] [-source source] | hel
 p | version [packageName] | webpi packageName | windowsfeatures packageName | ge
 m packageName [-version version] |uninstall packageName]
 example: chocolatey install nunit
 example: chocolatey install nunit -version 2.5.7.10213
 example: chocolatey install packages.config
 example: chocolatey installmissing nunit
 example: chocolatey update nunit -source http://somelocalfeed.com/nuget/
 example: chocolatey help
 example: chocolatey list (might take awhile)
 example: chocolatey list nunit
 example: chocolatey version
 example: chocolatey version nunit
 example: chocolatey uninstall
Commands - shortcuts
Cpack – create a chocolatey package (nuget
style)
Cpush – push a package
Cinst – install
Cup – update
Clist – list
Cuninst – uninstall
Cver – display version
Cwindowsfeature – add a windows feature
How most chocolatey.org
packages work
This is not ideal
 Hundreds of machines installing stuff
 Putting the implementation files into the package
keeps it all in house
 Provides more control over switches and install
options.
Dependants
 Chocolatey like nuget supports pulling down
and installing dependants
 E.g. getting version 2.1.1.0 of packageA to
install a package B with version 4.8.0.34
We can build them
What does an install script
look like?
 It’s just PowerShell.
 Everything you can do in PowerShell you
have at your finger tips
What does an install script
look like?
$packageName = 'notepad++'
$silentArgs = '/S'
$validExitCodes = @(0)
$url = $(Split-Path –parent)
$MyInvocation.MyCommand.Definition) +
"..datanpp.6.3.Installer.exe"
$url64 = $url
Install-ChocolateyPackage $packageName "exe"
"$silentArgs" "$url" "$url64" -validExitCodes
$validExitCodes
What is a chocolatey package
then?
 Nuget package with:
 /tools/chocolateyinstall.ps1
 /tools/chocolateyuninstall.ps1
 A bunch of helpers
 https://github.com/chocolatey/chocolatey/wiki/He
lpersReference
Helpers
 Install-ChocolateyPackage
Install-ChocolateyZipPackage
Install-ChocolateyPowershellCommand
Install-ChocolateyVsixPackage - v0.9.8.20+
helpers
 Install-ChocolateyPackage
 Start-ChocolateyProcessAsAdmin
 Install-ChocolateyInstallPackage
 Install-ChocolateyPath - when specifying machine path
 Install-ChocolateyEnvironmentVariable - when specifying
machine path v0.9.8.20+
 Install-ChocolateyExplorerMenuItem - v0.9.8.20+
 Install-ChocolateyFileAssociation - v0.9.8.20+
 Update-SessionEnvironment - v0.9.8.20+
helpers
 Install-ChocolateyZipPackage
 Install-ChocolateyPowershellCommand
 Write-ChocolateySuccess
 Write-ChocolateyFailure
 Get-ChocolateyWebFile
 Get-ChocolateyUnzip
 Install-ChocolateyPath - when specifying user path
 Install-ChocolateyEnvironmentVariable - when specifying user path v0.9.8.20+
 Install-ChocolateyDesktopLink
 Install-ChocolateyPinnedTaskBarItem - v0.9.8.20+
Build a package
 We have a build script in nuget and a
repository layout to make this quick and easy
for 3rd party tools.
Quick demo
Install chocolatey
@powershell -NoProfile -ExecutionPolicy
unrestricted -Command "iex ((new-object
net.webclient).DownloadString('https://chocola
tey.org/install.ps1'))" && SET
PATH=%PATH%;%systemdrive%chocolateybi
n
cinst
 Install a package
 Cinst <package name> (get from chocolatey.org)
 Cinst ttl-msysgit –source
http://get.pkgs.ttldev
 Cinst ttl-msysgit –version 1.2.3.4 –source
http://get.pkgs.ttldev
clist
 Get a list of packages via the command line.
 Clist (get from chocolatey.org)
 Clist –source http://get.pkgs.ttldev
 chocolatey.bat version ttl-msysgit -
localonly
Using chef.
 Installation using chef is just this.
Or really this…
What’s installed? The chef way
 Chocolatey ohai plugin
So…
 We should consider using chocolatey to wrap
all existing installers
 Work is minimal to do this.
 Near real-time robust replication to multiple
sites
 Simple consistent interface to install
applications internal or 3rd party
 Easy to what versions are installed.
Questions?

More Related Content

PDF
Managing windows with Puppet and Chocolatey
PDF
Chocolatey - making the process of installing software on windows easy as pie
PPTX
Mmmm, chocolatey goodness!
PDF
Windows Just Got Chocolatey (Package Management) LISA15
PDF
Plugging Chocolatey into your Puppet Infrastructure PuppetConf2014
PDF
PuppetConf 2016: Easily Manage Software on Windows with Chocolatey – Rob Reyn...
PPTX
PuppetConf 2016: How Not to Freak Out When You Start Writing Puppet Modules f...
PDF
Easily Manage Software on Windows with Chocolatey - PuppetConf 2016
Managing windows with Puppet and Chocolatey
Chocolatey - making the process of installing software on windows easy as pie
Mmmm, chocolatey goodness!
Windows Just Got Chocolatey (Package Management) LISA15
Plugging Chocolatey into your Puppet Infrastructure PuppetConf2014
PuppetConf 2016: Easily Manage Software on Windows with Chocolatey – Rob Reyn...
PuppetConf 2016: How Not to Freak Out When You Start Writing Puppet Modules f...
Easily Manage Software on Windows with Chocolatey - PuppetConf 2016

What's hot (20)

PDF
Chocolatey Goodness: From Fringe to Mainstream #dotnetfringe
KEY
MozTW Jetpack Workshop: Taipei
PPTX
2015 TechSummit Web & Cloud - Gem, NPM, Bower, Nuget, Paket - Päckchen hier, ...
PDF
MozTW Jetpack Workshop: Taichung
PDF
Jetpack SDK: The new possibility of the extensions on browser
PDF
npm + browserify
PPTX
Running a Successful Open Source Project
PPTX
Heroes of Paragon: publishing Unity WebGL game on Facebook
PDF
Ubento with own cloud
PDF
node-webkit : Make a magic from your a desktop app to desktop app!
PPTX
Bringing Javascript to the Desktop with Electron
PDF
WordPress Setup and Security - WordCamp, Charleston 2014
PPTX
Lessons Learned with Unity and WebGL
PPTX
Building a PWA - For Everyone Who Is Scared To
PPTX
Using multi-tenant WordPress to simplify development
PDF
Max Voloshin - "Organization of frontend development for products with micros...
PPTX
A crash course in scaling wordpress
PDF
Wp cli- intro and basics
PPTX
PowerShell crashcourse for sharepoint
PDF
Introducing Wordpress Multitenancy
Chocolatey Goodness: From Fringe to Mainstream #dotnetfringe
MozTW Jetpack Workshop: Taipei
2015 TechSummit Web & Cloud - Gem, NPM, Bower, Nuget, Paket - Päckchen hier, ...
MozTW Jetpack Workshop: Taichung
Jetpack SDK: The new possibility of the extensions on browser
npm + browserify
Running a Successful Open Source Project
Heroes of Paragon: publishing Unity WebGL game on Facebook
Ubento with own cloud
node-webkit : Make a magic from your a desktop app to desktop app!
Bringing Javascript to the Desktop with Electron
WordPress Setup and Security - WordCamp, Charleston 2014
Lessons Learned with Unity and WebGL
Building a PWA - For Everyone Who Is Scared To
Using multi-tenant WordPress to simplify development
Max Voloshin - "Organization of frontend development for products with micros...
A crash course in scaling wordpress
Wp cli- intro and basics
PowerShell crashcourse for sharepoint
Introducing Wordpress Multitenancy
Ad

Viewers also liked (20)

PDF
Zen and the Art of Automated Acceptance Test Suite Maintenance
PPTX
BAM CEP / Business Activity Monitoring , Complex Event Processingomplex
PDF
Web App Security Horror Stories
PPTX
Continuous integration 101
PPTX
Package Management on Windows with Chocolatey
PDF
How to create great slides for presentations
PPT
The new masters of management
PDF
Niuchangchih (Antrodia camphorata) and its potential in treating liver diseases
PPT
关于 Twitter 以及 Twitter 与 NGO2.0
PDF
Boulder/Denver BigData: Cluster Computing with Apache Mesos and Cascading
PPT
Budget Simulation Assignment Renee Jackson
DOCX
PDF
Gps4b
DOCX
Rescue.asd
PDF
All about Interview
PPT
ZENworks Configuration Management
DOC
B.j. mate i
PPTX
Modul 1 bahasa indonesia kb 1
PDF
A Little Pumpkin Likes Reading Books
PPT
Business ppt-template-043
Zen and the Art of Automated Acceptance Test Suite Maintenance
BAM CEP / Business Activity Monitoring , Complex Event Processingomplex
Web App Security Horror Stories
Continuous integration 101
Package Management on Windows with Chocolatey
How to create great slides for presentations
The new masters of management
Niuchangchih (Antrodia camphorata) and its potential in treating liver diseases
关于 Twitter 以及 Twitter 与 NGO2.0
Boulder/Denver BigData: Cluster Computing with Apache Mesos and Cascading
Budget Simulation Assignment Renee Jackson
Gps4b
Rescue.asd
All about Interview
ZENworks Configuration Management
B.j. mate i
Modul 1 bahasa indonesia kb 1
A Little Pumpkin Likes Reading Books
Business ppt-template-043
Ad

Similar to using Chocolatey for application deployments (20)

PPT
TechMentor Fall, 2011 - Packaging Software for Automated Deployment with Wind...
ODP
Dexterity in 15 minutes or less
PPT
How to host an app for $20 in 20min using buildout and hostout
PPT
Where's the source, Luke? : How to find and debug the code behind Plone
PPTX
NuGet Nuggets
PPT
Adventures in infrastructure as code
PDF
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
PDF
Continuous Web Performance Monitoring with Jenkins
PPT
Python virtualenv & pip in 90 minutes
PDF
Dependencies Managers in C/C++. Using stdcpp 2014
PPTX
nginx + uwsgi emperor + bottle
PPT
Prepping software for w7 deployment
PDF
Martin Aspeli Extending And Customising Plone 3
PDF
LIGGGHTS installation-guide
PDF
Python setup for dummies
PDF
Compile open cpn on windows
PDF
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
PDF
DevOps Series: Extending vagrant with Puppet for configuration management
PDF
Puppet Camp LA 2015: Package Managers and Puppet (Beginner)
TechMentor Fall, 2011 - Packaging Software for Automated Deployment with Wind...
Dexterity in 15 minutes or less
How to host an app for $20 in 20min using buildout and hostout
Where's the source, Luke? : How to find and debug the code behind Plone
NuGet Nuggets
Adventures in infrastructure as code
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
Continuous Web Performance Monitoring with Jenkins
Python virtualenv & pip in 90 minutes
Dependencies Managers in C/C++. Using stdcpp 2014
nginx + uwsgi emperor + bottle
Prepping software for w7 deployment
Martin Aspeli Extending And Customising Plone 3
LIGGGHTS installation-guide
Python setup for dummies
Compile open cpn on windows
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
DevOps Series: Extending vagrant with Puppet for configuration management
Puppet Camp LA 2015: Package Managers and Puppet (Beginner)

Recently uploaded (20)

PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Approach and Philosophy of On baking technology
PPTX
sap open course for s4hana steps from ECC to s4
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPT
Teaching material agriculture food technology
PDF
Machine learning based COVID-19 study performance prediction
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Big Data Technologies - Introduction.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Encapsulation theory and applications.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Spectroscopy.pptx food analysis technology
Building Integrated photovoltaic BIPV_UPV.pdf
Approach and Philosophy of On baking technology
sap open course for s4hana steps from ECC to s4
A comparative analysis of optical character recognition models for extracting...
Advanced methodologies resolving dimensionality complications for autism neur...
Teaching material agriculture food technology
Machine learning based COVID-19 study performance prediction
Empathic Computing: Creating Shared Understanding
Programs and apps: productivity, graphics, security and other tools
Assigned Numbers - 2025 - Bluetooth® Document
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Big Data Technologies - Introduction.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Encapsulation theory and applications.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Spectroscopy.pptx food analysis technology

using Chocolatey for application deployments

  • 2. Who am i Owain Perry Software architect at thetrainline.com Twitter: owainperry Blog: owainperry.com
  • 3. What is Chocolatey?  Chocolatey NuGet is a Machine Package Manager, somewhat like apt-get, but built withWindows in mind. - See more at: http://chocolatey.org/#sthash.WI0IhYUd.dpu f
  • 4. What is a package?  A collection of stuff, glued into one file  Msi  Self extracting zip exe  Zip file  Nuget  Rpm  Etc…
  • 5. What version is it?  Packages should be versioned?  Question:Which is more helpful?  Setup.exe  Setup_Notepadpp_1.2.3.4.exe  Version.txt inside a zip file.
  • 6. This is not new  Unix has been doing this for the last 20 years  Windows tried to do this with Msi #fail.
  • 7. How do we get it there?  What is wrong with this?  //installers/files/notepadpp/setup.exe  Share permissions  Domain  TCP / UDP Ports 135->139  Only works “easily” on windows.
  • 8. What is installed?  How do we find out what is installed on a machine?  Check the registry (add / remove programs)?  Scan in  c:program files*  C:program files x86*  What about stuff installed elsewhere?
  • 9. How do we replicate?  We have multiple sites – how to replicate?  Use windows file based replication  Domain hell if not on one domain  Polled replication every x minutes  a pain and slow  hard to see current state  when is it broken?
  • 10. Some technology we have been using  Nuget.  Zip file containing stuff  API for downloading a specific version via HTTP  Wide adoption amongst the .NET community  Written by *Microsoft*  Lightweight (single .exe)  Large active open source development community
  • 11. Artifactory  Multiple repositories  Virtual repositories  Near real-time replication  Simple to browse and search  Thought? - Could use SEMVER and promote packages between repositories (environments)
  • 12. This can help ops people?  Use the same pattern for installing everything  Same command line  Single repository of packages easy to browse  Obvious version selection  Easy to script  Abstract the implementation away – who cares?
  • 13. What I want?  Simple and easy to use command line interface  Download via HTTP  Download a specific version(s)  List packages that have been installed.  Install / upgrade / uninstall options.  Simple to create packages using known language syntax.
  • 14. Chocolatey  Chocolatey NuGet is a Machine Package Manager, somewhat like apt-get, but built withWindows in mind. - See more at: http://chocolatey.org/#sthash.WI0IhYUd.dpu f
  • 15. Chocolatey  Nuget packages with extra stuff  Tools/chocolatey-install.ps1
  • 16. Commands  chocolatey [install [packageName [-source source] [-version version] | pathToPac  kagesConfig] | installmissing packageName [-source source] | update packageName  [-source source] [-version version] | list [packageName] [-source source] | hel  p | version [packageName] | webpi packageName | windowsfeatures packageName | ge  m packageName [-version version] |uninstall packageName]  example: chocolatey install nunit  example: chocolatey install nunit -version 2.5.7.10213  example: chocolatey install packages.config  example: chocolatey installmissing nunit  example: chocolatey update nunit -source http://somelocalfeed.com/nuget/  example: chocolatey help  example: chocolatey list (might take awhile)  example: chocolatey list nunit  example: chocolatey version  example: chocolatey version nunit  example: chocolatey uninstall
  • 17. Commands - shortcuts Cpack – create a chocolatey package (nuget style) Cpush – push a package Cinst – install Cup – update Clist – list Cuninst – uninstall Cver – display version Cwindowsfeature – add a windows feature
  • 19. This is not ideal  Hundreds of machines installing stuff  Putting the implementation files into the package keeps it all in house  Provides more control over switches and install options.
  • 20. Dependants  Chocolatey like nuget supports pulling down and installing dependants  E.g. getting version 2.1.1.0 of packageA to install a package B with version 4.8.0.34
  • 21. We can build them
  • 22. What does an install script look like?  It’s just PowerShell.  Everything you can do in PowerShell you have at your finger tips
  • 23. What does an install script look like? $packageName = 'notepad++' $silentArgs = '/S' $validExitCodes = @(0) $url = $(Split-Path –parent) $MyInvocation.MyCommand.Definition) + "..datanpp.6.3.Installer.exe" $url64 = $url Install-ChocolateyPackage $packageName "exe" "$silentArgs" "$url" "$url64" -validExitCodes $validExitCodes
  • 24. What is a chocolatey package then?  Nuget package with:  /tools/chocolateyinstall.ps1  /tools/chocolateyuninstall.ps1  A bunch of helpers  https://github.com/chocolatey/chocolatey/wiki/He lpersReference
  • 26. helpers  Install-ChocolateyPackage  Start-ChocolateyProcessAsAdmin  Install-ChocolateyInstallPackage  Install-ChocolateyPath - when specifying machine path  Install-ChocolateyEnvironmentVariable - when specifying machine path v0.9.8.20+  Install-ChocolateyExplorerMenuItem - v0.9.8.20+  Install-ChocolateyFileAssociation - v0.9.8.20+  Update-SessionEnvironment - v0.9.8.20+
  • 27. helpers  Install-ChocolateyZipPackage  Install-ChocolateyPowershellCommand  Write-ChocolateySuccess  Write-ChocolateyFailure  Get-ChocolateyWebFile  Get-ChocolateyUnzip  Install-ChocolateyPath - when specifying user path  Install-ChocolateyEnvironmentVariable - when specifying user path v0.9.8.20+  Install-ChocolateyDesktopLink  Install-ChocolateyPinnedTaskBarItem - v0.9.8.20+
  • 28. Build a package  We have a build script in nuget and a repository layout to make this quick and easy for 3rd party tools.
  • 30. Install chocolatey @powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocola tey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%chocolateybi n
  • 31. cinst  Install a package  Cinst <package name> (get from chocolatey.org)  Cinst ttl-msysgit –source http://get.pkgs.ttldev  Cinst ttl-msysgit –version 1.2.3.4 –source http://get.pkgs.ttldev
  • 32. clist  Get a list of packages via the command line.  Clist (get from chocolatey.org)  Clist –source http://get.pkgs.ttldev  chocolatey.bat version ttl-msysgit - localonly
  • 33. Using chef.  Installation using chef is just this.
  • 35. What’s installed? The chef way  Chocolatey ohai plugin
  • 36. So…  We should consider using chocolatey to wrap all existing installers  Work is minimal to do this.  Near real-time robust replication to multiple sites  Simple consistent interface to install applications internal or 3rd party  Easy to what versions are installed.