module Dockly

Constants

LOAD_FILE
MAJOR
MINOR
PATCH
RELEASE
VERSION

Attributes

load_file[W]

Public Instance Methods

assume_role(role_name = nil) click to toggle source
# File lib/dockly.rb, line 61
def assume_role(role_name = nil)
  @assume_role = role_name if role_name
  @assume_role
end
aws_region(region = nil) click to toggle source
# File lib/dockly.rb, line 77
def aws_region(region = nil)
  @aws_region = region unless region.nil?
  @aws_region || 'us-east-1'
end
git_sha() click to toggle source
# File lib/dockly.rb, line 57
def git_sha
  @git_sha ||= Dockly::Util::Git.sha
end
instance() click to toggle source
# File lib/dockly.rb, line 36
def instance
  @instance ||= load_inst
end
load_file() click to toggle source
# File lib/dockly.rb, line 32
def load_file
  @load_file || LOAD_FILE
end
load_inst() click to toggle source
# File lib/dockly.rb, line 40
def load_inst
  setup.tap do |state|
    if File.exists?(load_file)
      instance_eval(IO.read(load_file), load_file)
    end
  end
end
perform_role_assumption() click to toggle source
# File lib/dockly.rb, line 66
def perform_role_assumption
  return if assume_role.nil?
  Aws.config.update(
    credentials: Aws::AssumeRoleCredentials.new(
      role_arn: assume_role, role_session_name: 'dockly',
      client: Aws::STS::Client.new(region: aws_region)
    ),
    region: aws_region
  )
end
s3() click to toggle source
# File lib/dockly.rb, line 82
def s3
  @s3 ||= Aws::S3::Client.new(region: aws_region)
end
setup() click to toggle source
# File lib/dockly.rb, line 48
def setup
  {
    :debs => Dockly::Deb.instances,
    :rpms => Dockly::Rpm.instances,
    :dockers => Dockly::Docker.instances,
    :foremans => Dockly::Foreman.instances
  }
end