Skip to content
This repository has been archived by the owner on Nov 30, 2017. It is now read-only.

Commit

Permalink
Raise unless the proper environment variable is set
Browse files Browse the repository at this point in the history
Sam Kottler committed Mar 23, 2014
1 parent 7d9db8a commit 2c04130
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .chef/knife.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
chef_username = 'RUBYGEMS_CHEF_USERNAME'
env_username = ENV[chef_username]
raise "You need to set the environment variable #{chef_username} to your hosted chef username" unless env_username

current_dir = File.dirname(__FILE__)
log_level :info
log_location STDOUT
node_name ENV['RUBYGEMS_CHEF_USERNAME']
client_key "#{current_dir}/#{ENV['RUBYGEMS_CHEF_USERNAME']}.pem"
node_name chef_username
client_key "#{current_dir}/#{env_username}.pem"
validation_client_name "rubygems-validator"
validation_key "#{current_dir}/rubygems-validator.pem"
chef_server_url "https://api.opscode.com/organizations/rubygems"

0 comments on commit 2c04130

Please sign in to comment.