diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/features-screen | 28 | ||||
-rwxr-xr-x | scripts/mac-dev-screen | 24 | ||||
-rwxr-xr-x | scripts/mac-dev-start | 78 |
3 files changed, 0 insertions, 130 deletions
diff --git a/scripts/features-screen b/scripts/features-screen deleted file mode 100755 index 969c9c3de6..0000000000 --- a/scripts/features-screen +++ /dev/null @@ -1,28 +0,0 @@ -# Start up a Chef environment with: -# screen -c scripts/features-screen -# from the chef base directory. -hardstatus alwayslastline '%w' - -screen -t "couchdb" 0 -stuff "sudo rake dev:features:start:couchdb\012" -sleep 3 - -screen -t "rabbitmq" 1 -stuff "sudo rake dev:features:start:rabbitmq\012" -sleep 3 - -screen -t "chef_solr" 2 -stuff "sudo rake dev:features:start:chef_solr\012" -sleep 3 - -screen -t "chef_expander" 3 -stuff "sudo rake dev:features:start:chef_expander\012" -sleep 3 - -screen -t "chef_server" 4 -stuff "sudo rake dev:features:start:chef_server\012" -sleep 3 - -screen -t "chef_webui" 5 -stuff "sudo rake dev:features:start:chef_webui\012" -sleep 3 diff --git a/scripts/mac-dev-screen b/scripts/mac-dev-screen deleted file mode 100755 index 671bd23b83..0000000000 --- a/scripts/mac-dev-screen +++ /dev/null @@ -1,24 +0,0 @@ -# Start up a Chef environment with: -# screen -c scripts/mac-dev-screen -# from the chef base directory. -hardstatus alwayslastline '%w' - -screen -t "couchdb" 0 -stuff "sudo rake dev:start:couchdb\012" -sleep 3 - -screen -t "rabbitmq" 1 -stuff "sudo rake dev:start:rabbitmq\012" -sleep 3 - -screen -t "chef_solr" 2 -stuff "sudo rake dev:start:chef_solr\012" -sleep 3 - -screen -t "chef_solr_indexer" 3 -stuff "sudo rake dev:start:chef_solr_indexer\012" -sleep 3 - -screen -t "chef_server" 4 -stuff "sudo rake dev:start:chef_server\012" -sleep 3 diff --git a/scripts/mac-dev-start b/scripts/mac-dev-start deleted file mode 100755 index b2b029335a..0000000000 --- a/scripts/mac-dev-start +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env ruby - -require 'rubygems' -require 'pp' -require 'appscript' -require 'mixlib/cli' - -class MacDevStart - include Mixlib::CLI - include Appscript - - SERVICES = %w{couchdb rabbitmq chef_solr chef_expander chef_server chef_webui} - - option :environment, - :short => '-e ENV', - :long => '--environment ENV', - :default => 'test', - :description => 'Set the environment (test|dev), defaults to test' - - def run - @srcdir = File.expand_path(File.dirname(__FILE__)) - - @base_cmd = case config[:environment] - when 'test' - "cd #{@srcdir} && rake dev:features:start:" - when 'dev' - "cd #{@srcdir} && rake dev:start:" - else - puts "--environment must be set to either 'test' or 'dev'" - puts @opt_parser - exit 1 - end - - STDOUT.puts "Starting services:" - pp SERVICES - start_services(SERVICES) - end - - def create_tab - @window.activate - app("System Events").application_processes["Terminal.app"].keystroke("t", :using=>:command_down) - end - - def terminal_app - @terminal_app ||= app("Terminal") - end - - def create_term_window - terminal_app.windows.first.activate - app("System Events").application_processes["Terminal.app"].keystroke("n", :using=>:command_down) - @window = terminal_app.windows.first.get - end - - def start_service_in_tab(service, tab) - # use xterm escape codes to set the tab title to the service running in the tab. - cmd = "unset PROMPT_COMMAND; echo -e \"\\033]0;#{service}\\007\"; #{@base_cmd}#{service}" - app('Terminal').do_script(cmd, :in => @window.tabs[tab].get) - end - - def start_services(services) - create_term_window - - tab_index = 1 # applescript indexes from 1 instead of 0 - - (services.size - 1).times { create_tab } - - services.each do |service| - start_service_in_tab(service, tab_index) - tab_index += 1 - end - end -end - -if __FILE__ == $0 - os = MacDevStart.new - os.parse_options - os.run -end |