Module: Dockly
- Defined in:
- lib/dockly.rb,
lib/dockly/version.rb,
lib/dockly/s3_writer.rb,
lib/dockly/bash_builder.rb
Defined Under Namespace
Modules: BuildCache, History, RakeHelper
Classes: AbstractCommand, BashBuilder, BuildCacheCommand, BuildCommand, Cli, Deb, Docker, DockerCommand, Foreman, ListCommand, Rpm, S3Writer, TarDiff
Constant Summary
collapse
- LOAD_FILE =
'dockly.rb'
- MAJOR =
3
- MINOR =
0
- PATCH =
2
- RELEASE =
nil
- VERSION =
[MAJOR, MINOR, PATCH, RELEASE].compact.join('.')
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Attribute Details
#instance ⇒ Object
Returns the value of attribute instance.
12
13
14
|
# File 'lib/dockly.rb', line 12
def instance
@instance
end
|
#load_file=(value) ⇒ Object
Sets the attribute load_file
13
14
15
|
# File 'lib/dockly.rb', line 13
def load_file=(value)
@load_file = value
end
|
Class Method Details
.assume_role(role_name = nil) ⇒ Object
57
58
59
60
|
# File 'lib/dockly.rb', line 57
def assume_role(role_name = nil)
@assume_role = role_name if role_name
@assume_role
end
|
.aws_region(region = nil) ⇒ Object
73
74
75
76
|
# File 'lib/dockly.rb', line 73
def aws_region(region = nil)
@aws_region = region unless region.nil?
@aws_region || 'us-east-1'
end
|
.git_sha ⇒ Object
53
54
55
|
# File 'lib/dockly.rb', line 53
def git_sha
@git_sha ||= Dockly::Util::Git.sha
end
|
.inst ⇒ Object
32
33
34
|
# File 'lib/dockly.rb', line 32
def inst
@instance ||= load_inst
end
|
.load_file ⇒ Object
28
29
30
|
# File 'lib/dockly.rb', line 28
def load_file
@load_file || LOAD_FILE
end
|
.load_inst ⇒ Object
36
37
38
39
40
41
42
|
# File 'lib/dockly.rb', line 36
def load_inst
setup.tap do |state|
if File.exists?(load_file)
instance_eval(IO.read(load_file), load_file)
end
end
end
|
62
63
64
65
66
67
68
69
70
71
|
# File 'lib/dockly.rb', line 62
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 ⇒ Object
78
79
80
|
# File 'lib/dockly.rb', line 78
def s3
@s3 ||= Aws::S3::Client.new(region: aws_region)
end
|
.setup ⇒ Object
44
45
46
47
48
49
50
51
|
# File 'lib/dockly.rb', line 44
def setup
{
:debs => Dockly::Deb.instances,
:rpms => Dockly::Rpm.instances,
:dockers => Dockly::Docker.instances,
:foremans => Dockly::Foreman.instances
}
end
|