#!/usr/bin/ruby # This file is part of EC2 on Rails. # http://rubyforge.org/projects/ec2onrails/ # # Copyright 2007 Paul Dowman, http://pauldowman.com/ # # EC2 on Rails is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # EC2 on Rails is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . require "#{File.dirname(__FILE__)}/../lib/roles_helper" require "#{File.dirname(__FILE__)}/../lib/utils" include Ec2onrails::RolesHelper APP_ROOT = "/mnt/app/current" RAILS_ENV = Ec2onrails::Utils.rails_env #reload configs to pick up any new changes # Just a thought... do we really need to load god files from inside the app? They could just be installed via install_system_files, that would be simpler Dir.glob("/etc/god/*.god") + Dir.glob("/mnt/app/current/config/god/#{RAILS_ENV}/*.god").each do |f| sudo "god load '#{f}'" end roles.keys.each do |role| if in_role? role start role else stop role end end