Created
March 4, 2025 17:53
-
-
Save jacobrose/b12496096cad606c086912eb823457ee to your computer and use it in GitHub Desktop.
A crib-sheet of the chef deploy commands written up by Vaibhav Verma in Confluence
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # If knife-spork and knife-flip aren't installed, you can run | |
| /opt/chef/embedded/bin/gem install knife-spork knife-flip | |
| #make our changes locally to the cookbook | |
| knife spork check apache | |
| # this will ask you if you want to bump the version of apache, and you say yes | |
| knife spork upload apache | |
| # this will put the new version of apache on the chef server, but nothing will get deployed yet. | |
| knife node flip $(hostname) testing | |
| # this puts your VM in the testing environment, so your VM starts getting the latest version of every cookbook. | |
| knife node show $(hostname) | |
| # this will show that you're in the testing environment. | |
| sudo chef-client --once | |
| # this runs chef on your VM, so it picks up the new config | |
| # check that your config changed as expected. | |
| knife spork promote apache | |
| # this changes environments/production.js in your local directory to point to the new version of apache. | |
| git commit && git push | |
| # chef and git don't know about each other. Let's push the change to git before we put it on production servers. | |
| knife spork promote apache --remote | |
| # this will start making all production servers pick up your new version of apache. | |
| knife node flip $(hostname) production | |
| # this will turn your VM back to the production environment instead of testing. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment