Set up your workstation for Chef development in minutes
Ruby PowerShell HTML Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
attributes
files/default
libraries Remove the vagrant cookbook monkey patches Apr 3, 2018
recipes
resources Install a default list of atom plugins Feb 27, 2018
spec
templates/default Add function docs to chefdk_bootstrap module May 17, 2016
test
.gitignore Remove Berksfile.lock, Gemfile. Update chefignore. Feb 18, 2016
.kitchen.appveyor.yml
.kitchen.yml Install a default list of atom plugins Feb 27, 2018
.rspec Initial commit May 7, 2015
.rubocop.yml
.travis.yml Explicit calls to cookstyle and foodcritic Jan 29, 2018
Berksfile Bump the vagrant cookbook version. May 15, 2018
CHANGELOG.md Update the change log May 24, 2018
CONTRIBUTING.md Install a default list of atom plugins Feb 27, 2018
Gemfile Use node['virtualization']['role'] to decide if a server is a guest. May 24, 2018
Guardfile Style and README updates Jan 28, 2018
LICENSE
README.md Allow adding a CA authority bundle to the cacert.pem file Feb 22, 2018
Rakefile Use node['virtualization']['role'] to decide if a server is a guest. May 24, 2018
appveyor.yml Update bundle exec rake to 3 cmds Jul 26, 2016
bootstrap.ps1
bootstrap.rb Use node['virtualization']['role'] to decide if a server is a guest. May 24, 2018
chefignore Remove Berksfile.lock, Gemfile. Update chefignore. Feb 18, 2016
metadata.rb Use node['virtualization']['role'] to decide if a server is a guest. May 24, 2018
uninstall

README.md

ChefDK_Bootstrap Build Status Build status

Setup your laptop for Chef development in minutes

Run one simple command to easily set up your Windows or Mac machine for Chef cookbook development in about 20 minutes.

Before You Begin

Windows Quickstart

Copy the PowerShell command below and paste them into a PowerShell Admin console. This will download and run the bootstrap script on your workstation.

 Invoke-WebRequest -UseBasicParsing https://raw.githubusercontent.com/Nordstrom/chefdk_bootstrap/master/bootstrap.ps1 | Invoke-Expression
 install

Mac Quickstart

Copy the command below and paste it into a terminal. This will download and run the bootstrap script on your workstation.

ruby -e "$(curl https://raw.githubusercontent.com/Nordstrom/chefdk_bootstrap/master/bootstrap.rb)"

Mac ChefDK profile setup

Follow the instructions in the ChefDK README to complete the Chef workstation setup.


If you are behind a proxy

Windows

Set Proxy Environment Vars

Copy/paste these environment variables into your terminal.

# change these values to your proxy address
$env:http_proxy='http://myproxy.example.com:1234'
$env:https_proxy=$env:http_proxy
# don't go through the proxy for these addresses.
# change example.com to your corporate DNS domain
$env:no_proxy='localhost,127.0.0.1,example.com'

Use this proxy-aware bootstrap script

Copy the PowerShell command below and paste them into a PowerShell Admin console. This will execute the bootstrap script on your workstation.

 Invoke-WebRequest -UseBasicParsing https://raw.githubusercontent.com/Nordstrom/chefdk_bootstrap/master/bootstrap.ps1 -ProxyUseDefaultCredentials -Proxy $env:https_proxy | Invoke-Expression
 install

The ChefDK_bootstrap script will write your environment variables to your Profile.ps1.

Mac

Copy/paste these environment variables into your terminal.

# change these values to your proxy address
export http_proxy=http://myproxy.example.com:1234
export https_proxy=$http_proxy
# don't go through the proxy for these addresses.
# change example.com to your corporate DNS domain
export no_proxy='localhost,127.0.0.1,example.com'

The ChefDK_bootstrap script will write your environment variables to your ~/.bash_profile.

If you are using a different shell, you will need to export these environment variables in your shell startup file (e.g. .zshrc).

Now run the Quickstart for Mac

Customization

If you want to use your own custom wrapper cookbook, add the name of your cookbook and your private supermarket source to these commands instead of the original Quickstart (examples included below).

JSON attributes

You can pass in attributes via URL/path to a JSON file (see the --json-attributes option in chef-client ). For Windows, json_attributes is a named parameter of the bootstrap PowerShell script. For Mac, json-attributes is a named parameter of the bootstrap Ruby script.

Windows

$CHEFDK_BOOTSTRAP_JSON_ATTRIBUTES = "http://server/attributes.json"

Invoke-WebRequest -UseBasicParsing https://raw.githubusercontent.com/Nordstrom/chefdk_bootstrap/master/bootstrap.ps1 | Invoke-Expression
install -json_attributes $CHEFDK_BOOTSTRAP_JSON_ATTRIBUTES

Mac

ruby -e "$(curl https://raw.githubusercontent.com/Nordstrom/chefdk_bootstrap/master/bootstrap.rb)" - --json-attributes http://server/attributes.json

Custom cookbook

Deprecated. If you would like to use a custom cookbook, please use an earlier version of ChefDK_bootstrap.

ChefDK Version

You can specify the version of chefdk to install as a named parameter in the bootstrap script. By default, the bootstrap script will install the latest version of chefdk. The script will not re-install chefdk if the target version is already installed.

Windows

Invoke-WebRequest -UseBasicParsing https://raw.githubusercontent.com/Nordstrom/chefdk_bootstrap/master/bootstrap.ps1 | Invoke-Expression

install -version <target version>

Mac

ruby -e "$(curl https://raw.githubusercontent.com/Nordstrom/chefdk_bootstrap/master/bootstrap.rb)" - --version <target version>

What does it do?

This cookbook installs these tools:

Editor

Atom, a free, general purpose, cross-platform, open source, text editor. Out of the box, Atom supports all the languages you will need for Chef development: Ruby, PowerShell, Bash, XML, JSON, etc.

Source Control

Git - command line git client and tools. Optionally configures a default global gitconfig file.

Local Virtualization

Virtualbox - Oracle's free, open source virtualization tool for local cookbook testing.

Vagrant - ChefDK's included Test Kitchen tool uses Vagrant to spin up local VMs for cookbook testing.


Recipes

default

  • Installs Chocolatey for a Windows machine and homebrew for a Mac machine. Both of these are package managers, similar to apt-get on Ubuntu. Chocolatey is used to install packages like posh-git and kdiff3, while homebrew is used to install packages like iterm2.

  • Installs all the other tools marked true in the node['chefdk_bootstrap']['package'] hash.

  • On Windows, includes the Powershell profile configuration recipe.

atom

  • Installs the Atom editor

chef_ca

  • Adds a Certificate Authority cert bundle to the cacerts.pem file. See the test/fixtures/samples/chefdk_bootstrap_nord for an example that uses this method.

conemu

  • On Windows, installs ConEmu (a console replacement)

git

  • Installs git.
  • On Windows, installs git-credential-winstore, and posh-git.

gitconfig

  • Configures a default global gitconfig.

gitextensions

  • On Windows, installs gitextensions, a GUI git client.

iterm2

  • On Mac, installs iterm2.

kdiff3

  • On Windows, installs the free, open-source diff/merge tool, kdiff3.

poshgit

  • On Windows, install poshgit for git/powershell integration.

powershell_profile

  • Configures a global PowerShell profile to correct the $env:HOME environment variable and run chef shell-init powershell.

vagrant

  • Installs Vagrant.

virtualbox

  • Installs Virtualbox.

Environment variables used

Variable Description
GITUSERNAME User name set in gitconfig
GITUSEREMAIL User email name set in gitconfig

Attributes

The attributes defined by this recipe are organized under the node['chefdk_bootstrap'] namespace.

Attribute Description Type Default
['atom']['source_url'] Windows: Atom installer package source URL URL String https://atom.io/download/windows
['atom']['source_url'] Mac: Atom installer package source URL URL String https://atom.io/download/mac
['package']['atom'] Whether to install Atom or not boolean true
['package']['chef_ca'] Whether to install a certificate authority cert bundleA or not boolean false
['package']['kdiff3'] Whether to install kdiff3 or not boolean true
['package']['vagrant'] Whether to install Vagrant or not boolean true
['package']['virtualbox'] Whether to install Virtualbox or not boolean true
['package']['git'] Whether to install git and related packages or not boolean true
['package']['gitextensions'] Whether to install gitextensions or not boolean true
['package']['iterm2'] Whether to install iterm2 or not boolean true
['package']['chefdk_julia'] Whether to install chefdk_julia or not boolean false
['package']['gitconfig'] Whether to configure a default gitconfig or not boolean false

Author

Nordstrom, Inc.

License

Copyright 2015, 2018 Nordstrom, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.