- Vagrant 1.5.4 or greater. 1.8.x has linked clones so it is highly recommended.
- VirtualBox 4.2.16 or VMWare Fusion 5
- If you want to use VMWare Fusion you will also need the vagrant-vmware-fusion plugin for vagrant (which is not free). You also want the latest version (at least 0.8.5).
- Vagrant-Windows
- At least 20GB free on the host box.
- Vagrant Sahara plugin for sandboxing.
- Install/upgrade Vagrant to 1.5.4+.
- Install/upgrade VirtualBox/VMWare to versions listed above.
- Install/upgrade required plugins for vagrant (if using VMWare you will need the non-free vagrant-vmware-fusion or equivalent).
- Vagrant 1.5.4 (and below) - Install/upgrade vagrant-windows vagrant plugin. Open terminal/command line and type
vagrant plugin install vagrant-windows - Install/upgrade
saharavagrant plugin -vagrant plugin install sahara.
The presentation is in keynote but there are other formats in the Presentation directory.
- Obtain a 2012 Windows vagrant box.
- You may need to update the box name to something from vagrantcloud/opentable.
- Now install the required modules (demo/puppet/modules/readme.md)
- Call
vagrant upand wait for it to run the shell provisioner. - Now we are ready to grab a snapshot for the demo. Call
vagrant sandbox on - In
demo/Vagrantfileplease comment out the shell provisioner and change the puppet provisioner toprovision.ppthat is currently set topuppet.manifest_file = "empty.pp". - This concludes exercise 0.
- From the Windows box, navigate to
c:\vagrant\packageson the command line or powershell. - Run
choco new mypackage. - Inspect the contents of the
mypackageandmypackage\toolsfolder. Note a readme file that provides resources for creating packages. - Edit
mypackage\mypackage.nuspecto remove items that end in url. - Change the version to
0.1.0. - Save and close the nuspec.
- Edit
mypackage\tools\chocolateyInstall.ps1. Make it look like: $packageName = 'mypackage' Write-Host "$packageName has been installed." - Save and close the file.
- Delete
mypackage\tools\chocolateyInstall.ps1 - Run
choco pack. - Note that there is now a
.nupkgfile in the directory. - Optionally open it with NuGet Package Explorer if you have that installed and inspect how everything is laid out. NOTE: Certain newer items in the nuspec may cause this step not to work. You can alternative copy the nupkg over to a .zip file and unpack it normally and inspect the contents.
- This concludes exercise 1.
- From the host, access
http://localhost:8090(unless it conflicted, adjust as vagrant tells you the port is forwarded to). It should show nothing. - In
demo/puppet/manifests/provision.pp, uncommentinclude chocolateyserver - Run
vagrant provisionand wait for it to finish. - Now access
http://localhost:8090again. Note the information displayed. - On the box itself, access
http://localhost. Note the additional information displayed when you are local. - This concludes exercise 2.
Now that we've created a custom package and we've created a custom package server, it only makes sense that we want to get our package up on that server.
- Access
http://localhost. Click on the link for packages. Show how their are none there. - Navigate to the directory where you created the nupkg file from prior exercises.
- Run
choco push pkgname.nupkg -s http://localhost. You should receive some errors. - If you are on new choco, just add in the apikey to the push command
-k chocolateyrocks. If you are on old choco: choco install nuget.commandlinenuget setapikey chocolateyrocks -source http://localhost/chocolatey- Run
choco push pkgname.nupkg -s http://localhost -k chocolateyrocks. You will probably get an error here. Point out this is the most common mistake folks make. The location you query and the location you push to are always slightly different. - Run
choco push pkgname.nupkg -s http://localhost/chocolatey -k chocolateyrocks. - Note how the command succeeds.
- Access
http://localhost. Click on the link for packages. Note how there is package metadata now. - Show the package in the folder at
c:\tools\chocolatey.server\AppData\packages. - This concludes exercise 3.
- Run
choco install mypackage -s http://localhost. - Note what happens.
- This concludes exercise 4.