class Capistrano::Asg::AWSResource
Provides basic AWS resource methods
Attributes
aws_counterpart[R]
Public Instance Methods
cleanup() { || ... }
click to toggle source
# File lib/capistrano/asg/aws_resource.rb, line 15 def cleanup(&_block) items = trash || [] yield destroy items self end
Private Instance Methods
base_ec2_instance()
click to toggle source
# File lib/capistrano/asg/aws_resource.rb, line 24 def base_ec2_instance autoscaling_group.instances.first end
deployed_with_asg?(resource)
click to toggle source
# File lib/capistrano/asg/aws_resource.rb, line 36 def deployed_with_asg?(resource) return false if resource.tags.empty? resource.tags.any? { |k| k.key == 'deployed-with' && k.value == 'cap-asg' } && resource.tags.any? { |k| k.key == 'cap-asg-deploy-group' && k.value == autoscaling_group_name } end
environment()
click to toggle source
# File lib/capistrano/asg/aws_resource.rb, line 28 def environment fetch(:rails_env, 'production') end
timestamp(str)
click to toggle source
# File lib/capistrano/asg/aws_resource.rb, line 32 def timestamp(str) "#{str}-#{Time.now.utc.to_i}" end