Sha256: 94531c72c6b3bca49ff4690ef4ffd1494a3a35fac52a51dced09674947b71107

Contents?: true

Size: 814 Bytes

Versions: 4

Compression:

Stored size: 814 Bytes

Contents

module Ec2onrails
  module CapistranoUtils
    def run_local(command)
      result = system command
      raise("error: #{$?}") unless result
    end
    
    def make_admin_role_for(role)
      newrole = "#{role.to_s}_admin".to_sym
      roles[role].each do |srv_def|
        options = srv_def.options.dup
        options[:user] = "admin"
        options[:port] = srv_def.port
        options[:no_release] = true
        role newrole, srv_def.host, options
      end
    end
    
    # return hostnames for the role named role_sym. It must have the options given or no hostnames will be returned
    def hostnames_for_role(role_sym, options = {})
      role = roles[role_sym]
      unless role
        return []
      end
      role.reject{|s| s.options != options}.collect{|s| s.host}.join(',')
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ec2onrails-0.9.4 lib/ec2onrails/capistrano_utils.rb
ec2onrails-0.9.5 lib/ec2onrails/capistrano_utils.rb
ec2onrails-0.9.6 lib/ec2onrails/capistrano_utils.rb
ec2onrails-0.9.7 lib/ec2onrails/capistrano_utils.rb