diff options
author | John Keiser <john@johnkeiser.com> | 2016-02-24 15:10:49 -0800 |
---|---|---|
committer | John Keiser <john@johnkeiser.com> | 2016-02-25 08:31:43 -0800 |
commit | 5f72ac57337bd4914d87a48bdfb49c2d1d039951 (patch) | |
tree | 5de0de9fa4dad9b107db3eeebb9ebaa469af8f9e /acceptance/.shared | |
parent | 8e03a08291db95db0dc2f6fd98da494668c3f3ab (diff) | |
download | chef-5f72ac57337bd4914d87a48bdfb49c2d1d039951.tar.gz |
Detect whether we are running from chef or chef-dkjk/kitchen-acceptance
Diffstat (limited to 'acceptance/.shared')
-rw-r--r-- | acceptance/.shared/kitchen_acceptance/libraries/kitchen.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/acceptance/.shared/kitchen_acceptance/libraries/kitchen.rb b/acceptance/.shared/kitchen_acceptance/libraries/kitchen.rb index 916ca5ca7a..d36909e8b3 100644 --- a/acceptance/.shared/kitchen_acceptance/libraries/kitchen.rb +++ b/acceptance/.shared/kitchen_acceptance/libraries/kitchen.rb @@ -7,9 +7,14 @@ module KitchenAcceptance property :instances, String, default: lazy { ENV["KITCHEN_INSTANCES"] ? ENV["KITCHEN_INSTANCES"] : "" } property :kitchen_dir, String, default: Chef.node['chef-acceptance']['suite-dir'] property :chef_product, String, default: lazy { - ENV["KITCHEN_CHEF_PRODUCT"] || - # If we're running the chef or chefdk projects in jenkins, pick up the project name. - (%w(chef chefdk).include?(ENV["PROJECT_NAME"]) ? ENV["PROJECT_NAME"] : "chef") + ENV["KITCHEN_CHEF_PRODUCT"] || begin + # Figure out if we're in chefdk or chef + if ::File.exist?(::File.expand_path("../../chef-dk.gemspec", node['chef-acceptance']['suite-dir'])) + "chefdk" + else + "chef" + end + end } property :chef_channel, String, default: lazy { ENV["KITCHEN_CHEF_CHANNEL"] || |