applicaster-capistrano3-aws 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/capistrano3/aws.rb +4 -5
- data/lib/capistrano3/aws/client.rb +9 -7
- data/lib/capistrano3/aws/version.rb +1 -1
- data/lib/capistrano3/tasks/aws.rake +8 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03bfeba2c63f751ebc2256c1126f4a0cff18f60c
|
4
|
+
data.tar.gz: 4e6fc9bbd6c394442d0be6fea23dde3157359e75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a49d0e79600ecf1f789c6a906f3e94d10216c631b29b0fce204e388f3fa2a059e13721302301c085fb254e4b50eec552423ed79466f31dcffa266d757c9fbe75
|
7
|
+
data.tar.gz: a2622f1b90e8e657c084557777e5248da39bab0aa6e4125ebb24b7daddb101b4ecd02c2eee28d59b037848da76604c74630cf41490d00c5f83569fb17a7ebfa6
|
data/lib/capistrano3/aws.rb
CHANGED
@@ -8,7 +8,8 @@ module Capistrano3
|
|
8
8
|
module Aws
|
9
9
|
def ec2_instances(filters, map_attribute = :private_ip_address)
|
10
10
|
filters = filters.push({ name: 'instance-state-name', values: %w(running) })
|
11
|
-
ec2
|
11
|
+
Capistrano3::Aws::Client.ec2
|
12
|
+
.describe_instances(filters: filters)
|
12
13
|
.reservations
|
13
14
|
.map(&:instances)
|
14
15
|
.map(&:first)
|
@@ -16,7 +17,7 @@ module Capistrano3
|
|
16
17
|
end
|
17
18
|
|
18
19
|
def update_ssm_parameter(name, value)
|
19
|
-
ssm.put_parameter({
|
20
|
+
Capistrano3::Aws::Client.ssm.put_parameter({
|
20
21
|
name: name,
|
21
22
|
value: value,
|
22
23
|
type: "String",
|
@@ -24,6 +25,4 @@ module Capistrano3
|
|
24
25
|
})
|
25
26
|
end
|
26
27
|
end
|
27
|
-
end
|
28
|
-
|
29
|
-
self.extend Capistrano::Aws
|
28
|
+
end
|
@@ -1,13 +1,15 @@
|
|
1
|
-
module
|
1
|
+
module Capistrano3
|
2
2
|
module Aws
|
3
|
-
|
3
|
+
module Client
|
4
|
+
module_function
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
|
6
|
+
def ec2
|
7
|
+
@ec2 ||= ::Aws::EC2::Client.new(region: fetch(:aws_region, ENV["AWS_REGION"]))
|
8
|
+
end
|
8
9
|
|
9
|
-
|
10
|
-
|
10
|
+
def ssm
|
11
|
+
@ssm ||= ::Aws::SSM::Client.new(region: fetch(:aws_region, ENV["AWS_REGION"]))
|
12
|
+
end
|
11
13
|
end
|
12
14
|
end
|
13
15
|
end
|
@@ -1,7 +1,10 @@
|
|
1
1
|
namespace :load do
|
2
2
|
task :defaults do
|
3
|
-
set :ssm_params_prefix, -> { "/environments/#{fetch(:stage)}/services/#{fetch(:application)}/deployment" }
|
4
3
|
set :aws_region, "us-east-1"
|
4
|
+
|
5
|
+
set :ssm_params_prefix, -> do
|
6
|
+
"/environments/#{fetch(:stage)}/services/#{fetch(:application)}/deployment"
|
7
|
+
end
|
5
8
|
end
|
6
9
|
end
|
7
10
|
|
@@ -18,9 +21,10 @@ namespace :deploy do
|
|
18
21
|
end
|
19
22
|
end
|
20
23
|
|
21
|
-
update_ssm_parameter("#{fetch(:ssm_params_prefix)}/revision", current_revision)
|
22
|
-
update_ssm_parameter("#{fetch(:ssm_params_prefix)}/release_slug", release_name)
|
23
|
-
|
24
|
+
Capistrano3::Aws.update_ssm_parameter("#{fetch(:ssm_params_prefix)}/revision", current_revision)
|
25
|
+
Capistrano3::Aws.update_ssm_parameter("#{fetch(:ssm_params_prefix)}/release_slug", release_name)
|
26
|
+
|
27
|
+
puts "UPDATED:: AWS SSM parameters to REVISION: #{current_revision}, RELEASE: #{release_name}"
|
24
28
|
end
|
25
29
|
end
|
26
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: applicaster-capistrano3-aws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vitaly Gorodetsky
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|