require "#{::File.dirname(__FILE__)}/../net/remoter/connections" #provide a very simple provisioner with as few dependencies as possible module PoolParty module Provision class BootStrapper include ::PoolParty::Remote # List of gems that are default to install def self.gem_list @gem_list ||= %w( flexmock lockfile logging ZenTest rake xml-simple sexp_processor net-ssh net-sftp net-scp net-ssh-gateway echoe highline json capistrano ParseTree ruby2ruby activesupport grempe-amazon-ec2 RubyInline ohai chef auser-dslify auser-butterfly auser-parenting thin ) end # Default options for the boot_strapper @defaults = ::PoolParty::Default.default_options.merge({ :full_keypair_path => "#{ENV["AWS_KEYPAIR_NAME"]}" || "~/.ssh/id_rsa", :installer => 'apt-get', :dependency_resolver => 'chef' }) class </dev/null", 'echo "bootstrap" >> /var/poolparty/POOLPARTY.PROGRESS'] commands << self.class.class_commands unless self.class.class_commands.empty? end def after_bootstrap # thin_cmd = "thin -R /etc/poolparty/monitor.ru start -p 8642 --daemonize --pid /var/run/poolparty/monitor.pid --log /var/log/poolparty/monitor.log --environment production --chdir /var/poolparty" #TODO --user poolparty --group poolparty # vputs "thin_cmd = #{thin_cmd}" # curl_put = "curl -i -XPUT -d'{}' http://localhost:8642/stats_monitor" # execute! [ thin_cmd, "sleep 10", curl_put ] # execute! ["sleep 5", curl_put] end end end end