1 Chef development environment and VSTS account setup
ivadim редактировал(а) эту страницу 2016-02-29 21:33:16 +01:00

VSTS setup

  1. Create a VSTS account if you don't have one
  2. Create a new user ( or use existing one)
  3. Create a Personal Access Token (PAT) http://roadtoalm.com/2015/07/22/using-personal-access-tokens-to-access-visual-studio-online/.
  • Use Authorized Scopes as "All Scopes"
  • Save PAT for the future use
  1. Create a VSTS pool
  1. Add the user you created the PAT token for to both
  • Agent Pool Administrators (allows to register)
  • Agent Pool Service Accounts (allows listening to build queue)

Chef setup

There are lots of ways to setup chef environment. This instruction will use 'Hosted Chef' and 'chefdk' on Windows. But others installations should work as well. (for more information check https://docs.chef.io/install_dk.html)

  1. Download chefdk from http://downloads.chef.io/chef-dk/
  2. Install chefdk
  3. Start cmd and run chef verify
  4. Create a Chef account https://manage.chef.io/login
  5. Create an organization inside a chef account
  6. Go to https://manage.chef.io/organizations/YOUR_ORG/users/YOUR_ACCOUNT
  7. Press "Reset Key" in public key section
  8. Press "Download" and save key to %HOME%\.chef\YOUR_ACCOUNT.pem
  • Where %HOME% is a local PC user profile directory
  1. Create file %HOME%\.chef\knife.rb with next content

current_dir = File.dirname(FILE) log_level :info log_location STDOUT node_name "YOUR_ACCOUNT" client_key "#{current_dir}/YOUR_ACCOUNT.pem" chef_server_url "https://api.chef.io/organizations/YOUR_ORG"


10. To validate setup run ```knife node list```. If there is no any errors then setup is correct.


Now you need to install [Knife Azure](https://github.com/chef/knife-azure) plugin

1. Run ```chef gem install knife-azure```
2. Download a management cert from azure https://manage.windowsazure.com/publishsettings/index?client=xplat
3. Add next entry to a knife.rb file

knife[:azure_publish_settings_file] = "path/to/azure.publishsettings"