ami_spec 1.8.0 → 1.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ami_spec/aws_instance.rb +6 -0
- data/lib/ami_spec/aws_instance_options.rb +1 -0
- data/lib/ami_spec/version.rb +1 -1
- data/lib/ami_spec.rb +11 -3
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52b2bb6051e9962f16d4743d539763034bdf6e5ae33154852bbd335fe0a1b26b
|
4
|
+
data.tar.gz: 3b8876510c793c28911dab088fa35f003a0f15862c869bda17092db38e266929
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '06228534001d96065a6bc5937533e4e00a250d821ce264259cc792d41165639d0142e04e4dfa0374cd934fc9b0786fa80c76deb577e96649519017a28a23a4c1'
|
7
|
+
data.tar.gz: 3aff902fd3205ce1704dbddb09eda7b5a02ce960cc253e944c04473e5101624d8459c31b3bb69400ac20565745647dfbb178f1c23b2f6fc2f259bc7fc50c02a8
|
@@ -25,22 +25,28 @@ module AmiSpec
|
|
25
25
|
@tags = ec2ify_tags(options.fetch(:tags))
|
26
26
|
@user_data_file = options.fetch(:user_data_file, nil)
|
27
27
|
@iam_instance_profile_arn = options.fetch(:iam_instance_profile_arn, nil)
|
28
|
+
@logger = options.fetch(:logger)
|
28
29
|
end
|
29
30
|
|
30
31
|
def_delegators :@instance, :instance_id, :tags, :private_ip_address, :public_ip_address
|
31
32
|
|
32
33
|
def start
|
34
|
+
@logger.info "Creating AWS EC2 instance for #{@ami}"
|
33
35
|
client = Aws::EC2::Client.new(client_options)
|
34
36
|
placeholder_instance = client.run_instances(instances_options).instances.first
|
35
37
|
|
36
38
|
@instance = Aws::EC2::Instance.new(placeholder_instance.instance_id, client_options)
|
39
|
+
@logger.info "Waiting for AWS EC2 instance to start: #{@instance.id}"
|
37
40
|
@instance.wait_until_running
|
38
41
|
tag_instance
|
42
|
+
@logger.info "AWS EC2 instance started: #{@instance.id}"
|
39
43
|
end
|
40
44
|
|
41
45
|
def terminate
|
46
|
+
@logger.info "Terminating AWS EC2 instance: #{@instance.id}"
|
42
47
|
@instance.terminate
|
43
48
|
@instance.wait_until_terminated
|
49
|
+
@logger.info "AWS EC2 instance terminated: #{@instance.id}"
|
44
50
|
end
|
45
51
|
|
46
52
|
private
|
data/lib/ami_spec/version.rb
CHANGED
data/lib/ami_spec.rb
CHANGED
@@ -83,17 +83,25 @@ module AmiSpec
|
|
83
83
|
|
84
84
|
instances = []
|
85
85
|
options[:amis].each_pair do |role, ami|
|
86
|
-
aws_instance_options = AwsInstanceOptions.new(options.merge(role: role, ami: ami))
|
86
|
+
aws_instance_options = AwsInstanceOptions.new(options.merge(role: role, ami: ami, logger: logger))
|
87
87
|
instances << AwsInstance.start(aws_instance_options)
|
88
88
|
end
|
89
89
|
|
90
90
|
results = []
|
91
91
|
instances.each do |instance|
|
92
92
|
ip_address = options[:aws_public_ip] ? instance.public_ip_address : instance.private_ip_address
|
93
|
+
logger.info("Waiting for SSH…")
|
93
94
|
WaitForSSH.wait(ip_address, options[:ssh_user], options[:key_file], options[:ssh_retries])
|
94
|
-
|
95
|
-
|
95
|
+
if options[:wait_for_rc]
|
96
|
+
logger.info("Waiting for RC…")
|
97
|
+
WaitForRC.wait(ip_address, options[:ssh_user], options[:key_file])
|
98
|
+
end
|
99
|
+
if options[:wait_for_cloud_init]
|
100
|
+
logger.info("Waiting for cloud init…")
|
101
|
+
WaitForCloudInit.wait(ip_address, options[:ssh_user], options[:key_file])
|
102
|
+
end
|
96
103
|
|
104
|
+
logger.info("Running serverspec…")
|
97
105
|
server_spec_options = ServerSpecOptions.new(options.merge(instance: instance))
|
98
106
|
results << ServerSpec.new(server_spec_options).run
|
99
107
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ami_spec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrick Robinson
|
8
8
|
- Martin Jagusch
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-12-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: aws-sdk-ec2
|
@@ -134,7 +134,7 @@ files:
|
|
134
134
|
homepage: https://github.com/envato/ami-spec
|
135
135
|
licenses: []
|
136
136
|
metadata: {}
|
137
|
-
post_install_message:
|
137
|
+
post_install_message:
|
138
138
|
rdoc_options: []
|
139
139
|
require_paths:
|
140
140
|
- lib
|
@@ -149,8 +149,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
149
|
- !ruby/object:Gem::Version
|
150
150
|
version: '0'
|
151
151
|
requirements: []
|
152
|
-
rubygems_version: 3.
|
153
|
-
signing_key:
|
152
|
+
rubygems_version: 3.3.26
|
153
|
+
signing_key:
|
154
154
|
specification_version: 4
|
155
155
|
summary: Acceptance testing your AMIs
|
156
156
|
test_files: []
|