Sha256: ff0cea77c422682d9f3ca92812fe921851e40a43ddadba598e303c56256d4475

Contents?: true

Size: 1.03 KB

Versions: 1

Compression:

Stored size: 1.03 KB

Contents

#!/usr/bin/env ruby
require File.join(File.dirname(__FILE__), '..', 'lib', 'soloist')

include Soloist::Util

log_level = ENV['LOG_LEVEL'] || "info"

soloistrc_contents, soloistrc_path = walk_up_and_find_file(with_or_without_dot("soloistrc"))
config_generator = Soloist::ChefConfigGenerator.new(YAML.load(soloistrc_contents), soloistrc_path)

soloistrc_contents, soloistrc_path = walk_up_and_find_file(with_or_without_dot("soloistrc_local"), :required => false)
config_generator.merge_config(YAML.load(soloistrc_contents), soloistrc_path) if soloistrc_contents

if ARGV.length >= 1
  requested_recipe = ARGV[0]
  config_generator.recipes = [requested_recipe]
end

solo_rb = fileify(config_generator.solo_rb)
metadata_json = fileify(config_generator.json_file)

system "sudo mkdir -p /var/chef/cache" unless File.directory?("/var/chef/cache")

command = "sudo bash -c '#{config_generator.preserved_environment_variables_string} chef-solo -j #{metadata_json.path} -c #{solo_rb.path} -l #{log_level}'"
puts "running chef: " + command
system(command) || exit(1)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
soloist-0.9.7 bin/soloist