capistrano-aws-ec2 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +2 -2
- data/capistrano-aws-ec2.gemspec +43 -0
- data/lib/capistrano/aws/ec2/patches.rb +9 -4
- data/lib/capistrano/aws/ec2/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f81df23d8d0fd91ec0118914d065f86cc3c9306989cb5ba73bea10722f99bc01
|
4
|
+
data.tar.gz: 4b46e7443eb7ece57a5dd7a74c763c6cb0221f90477fe99e082cefcfc3bcfcb7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83a2ed3c4e74cd96b1fd940977b0d987cfa5ea358ce5a4139d10b828632b5a419aa0883f0ad0615ed4ae5655d92c3571b1e57d06cc9d884ae78a46d5f78b5c3d
|
7
|
+
data.tar.gz: c546012741625dcbdb7bf0959f0593c5dee08ee0adc5d2f3dc58e08d824f681650f1fdaa4c2090ae82af14bac2267e4ac5d78c669a69014ff964510a479805f9
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -53,7 +53,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
53
53
|
|
54
54
|
## Contributing
|
55
55
|
|
56
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
56
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/zyndoras/capistrano-aws-ec2. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/zyndoras/capistrano-aws-ec2/blob/master/CODE_OF_CONDUCT.md).
|
57
57
|
|
58
58
|
## License
|
59
59
|
|
@@ -61,4 +61,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
61
61
|
|
62
62
|
## Code of Conduct
|
63
63
|
|
64
|
-
Everyone interacting in the Capistrano::Aws::Ec2 project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
64
|
+
Everyone interacting in the Capistrano::Aws::Ec2 project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/zyndoras/capistrano-aws-ec2/blob/master/CODE_OF_CONDUCT.md).
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('../lib', __FILE__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require_relative 'lib/capistrano/aws/ec2/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = 'capistrano-aws-ec2'
|
9
|
+
spec.version = Capistrano::Aws::Ec2::VERSION
|
10
|
+
spec.authors = ['Alex Sella']
|
11
|
+
spec.email = ['zyndoras@gmail.com']
|
12
|
+
|
13
|
+
spec.summary = 'Deploy to AWS EC2 via Capistrano.'
|
14
|
+
spec.description = 'Dynamically select EC2 instances to interact with using Capistrano.'
|
15
|
+
spec.homepage = 'https://github.com/zyndoras/capistrano-aws-ec2'
|
16
|
+
spec.license = 'MIT'
|
17
|
+
spec.required_ruby_version = '>= 2.6.0'
|
18
|
+
|
19
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
20
|
+
spec.metadata['source_code_uri'] = 'https://github.com/zyndoras/capistrano-aws-ec2'
|
21
|
+
spec.metadata['changelog_uri'] = 'https://github.com/zyndoras/capistrano-aws-ec2/blob/master/CHANGELOG.md'
|
22
|
+
|
23
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
24
|
+
|
25
|
+
# Specify which files should be added to the gem when it is released.
|
26
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
27
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
28
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
29
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
30
|
+
end
|
31
|
+
end
|
32
|
+
spec.bindir = 'exe'
|
33
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
34
|
+
spec.require_paths = ['lib']
|
35
|
+
|
36
|
+
spec.add_dependency 'aws-sdk-ec2', '~> 1.0'
|
37
|
+
spec.add_dependency 'capistrano', '~> 3.0'
|
38
|
+
|
39
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
40
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
41
|
+
spec.add_development_dependency 'rubocop'
|
42
|
+
spec.add_development_dependency 'rubocop-performance'
|
43
|
+
end
|
@@ -3,13 +3,18 @@
|
|
3
3
|
require 'aws-sdk-ec2'
|
4
4
|
|
5
5
|
module Capistrano
|
6
|
+
# Patches the Capistrano Configuration class to add our aws-ec2 features
|
6
7
|
class Configuration
|
8
|
+
EC2_STATE_RUNNING_CODE = 16
|
7
9
|
|
8
|
-
def ec2_instances(tags:
|
9
|
-
instances
|
10
|
-
|
10
|
+
def ec2_instances(running_only: true, tags: {})
|
11
|
+
ec2_resource.instances.filter do |instance|
|
12
|
+
# Filter out non-running instances
|
13
|
+
next false if running_only && instance.state.code != EC2_STATE_RUNNING_CODE
|
11
14
|
|
12
|
-
|
15
|
+
# Filter out instances not matching the given tags
|
16
|
+
tags.all? { |k, v| i.tags.any? { |tag| tag.key == k && tag.value == v } }
|
17
|
+
end
|
13
18
|
end
|
14
19
|
|
15
20
|
private
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-aws-ec2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Sella
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-09-
|
11
|
+
date: 2022-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-ec2
|
@@ -109,6 +109,7 @@ files:
|
|
109
109
|
- LICENSE.txt
|
110
110
|
- README.md
|
111
111
|
- Rakefile
|
112
|
+
- capistrano-aws-ec2.gemspec
|
112
113
|
- lib/capistrano/aws/ec2.rb
|
113
114
|
- lib/capistrano/aws/ec2/patches.rb
|
114
115
|
- lib/capistrano/aws/ec2/version.rb
|
@@ -135,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
136
|
- !ruby/object:Gem::Version
|
136
137
|
version: '0'
|
137
138
|
requirements: []
|
138
|
-
rubygems_version: 3.2.
|
139
|
+
rubygems_version: 3.2.28
|
139
140
|
signing_key:
|
140
141
|
specification_version: 4
|
141
142
|
summary: Deploy to AWS EC2 via Capistrano.
|