firespring_dev_commands 2.1.12.pre.alpha.3 → 2.1.13.pre.alpha.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -2
- data/lib/firespring_dev_commands/aws/codepipeline.rb +10 -4
- data/lib/firespring_dev_commands/aws/parameter.rb +13 -5
- data/lib/firespring_dev_commands/aws.rb +0 -12
- data/lib/firespring_dev_commands/common.rb +7 -5
- data/lib/firespring_dev_commands/eol/product_version.rb +3 -1
- data/lib/firespring_dev_commands/templates/aws.rb +0 -19
- data/lib/firespring_dev_commands/version.rb +1 -1
- data/lib/firespring_dev_commands.rb +4 -0
- metadata +2 -59
- data/lib/firespring_dev_commands/eol/aws.rb +0 -117
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '028cf722c7499e53e14594214f69d2f18ee73e84382ba3001176aac54c4dba7e'
|
4
|
+
data.tar.gz: 2320579264ff63f2defed4959c66d33c609d83d962526b9d4ddcba71d93f11bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 628bfca98898c318750a64182938250285456d6eea834b700a53173ab01810399e2b255e93c8d520e66f7f754cc32d2f4a8f10308589a1f0a9fc3d011cf9a79b
|
7
|
+
data.tar.gz: 70d6f8be02edcdee76def1902378d86106b8bec904e3fd4975a36c7cdcf03e9b0e966b75ca5bbd3f9dd2f0702149e24244968d2dcceab092f14d47fcd70f7dde
|
data/README.md
CHANGED
@@ -21,10 +21,16 @@ module Dev
|
|
21
21
|
def pipelines(regex_match = nil)
|
22
22
|
raise 'regex_match must be a regexp' if regex_match && !regex_match.is_a?(Regexp)
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
24
|
+
params = {}
|
25
|
+
response = client.list_pipelines(params)
|
26
|
+
pipelines = response.pipelines
|
27
|
+
|
28
|
+
next_token = response.next_token
|
29
|
+
while next_token
|
30
|
+
params[:next_token] = next_token
|
31
|
+
response = client.list_pipelines(params)
|
32
|
+
pipelines += response.pipelines
|
33
|
+
next_token = response.next_token
|
28
34
|
end
|
29
35
|
|
30
36
|
pipelines.select! { |it| it.name.match(regex_match) } if regex_match
|
@@ -24,12 +24,20 @@ module Dev
|
|
24
24
|
|
25
25
|
# Retrieve all parameters which start with the given path
|
26
26
|
def list(path, recursive: true, with_decryption: true)
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
27
|
+
next_token = nil
|
28
|
+
|
29
|
+
parameters = []
|
30
|
+
loop do
|
31
|
+
response = client.get_parameters_by_path(
|
32
|
+
path:,
|
33
|
+
recursive:,
|
34
|
+
with_decryption:,
|
35
|
+
next_token:
|
36
|
+
)
|
37
|
+
parameters += response.parameters
|
38
|
+
break unless (next_token = response.next_token)
|
32
39
|
end
|
40
|
+
parameters
|
33
41
|
end
|
34
42
|
|
35
43
|
# Sets the given parameter name's value to the given value
|
@@ -9,17 +9,5 @@ module Dev
|
|
9
9
|
|
10
10
|
# The default role name used if none has been configured when logging in
|
11
11
|
DEFAULT_LOGIN_ROLE_NAME = 'ReadonlyAccessRole'.freeze
|
12
|
-
|
13
|
-
# Runs the query on the client with the parameters
|
14
|
-
# Yields each response page
|
15
|
-
def self.each_page(client, query, params = {})
|
16
|
-
response = client.send(query, params)
|
17
|
-
yield response
|
18
|
-
|
19
|
-
while response.next_page?
|
20
|
-
response = response.next_page
|
21
|
-
yield response
|
22
|
-
end
|
23
|
-
end
|
24
12
|
end
|
25
13
|
end
|
@@ -40,7 +40,7 @@ module Dev
|
|
40
40
|
# Wraps a block of code in a y/n question.
|
41
41
|
# If the user answers 'y' then the block is executed.
|
42
42
|
# If the user answers 'n' then the block is skipped.
|
43
|
-
def with_confirmation(message, default = 'y', color_message: true)
|
43
|
+
def with_confirmation(message, default = 'y', color_message: true, exit_unconfirmed: true)
|
44
44
|
message = "\n #{message}" << '? '.light_green
|
45
45
|
message = message.light_green if color_message
|
46
46
|
print message
|
@@ -49,13 +49,15 @@ module Dev
|
|
49
49
|
answer = default
|
50
50
|
answer = $stdin.gets unless ENV['NON_INTERACTIVE'] == 'true'
|
51
51
|
|
52
|
-
|
52
|
+
if answer.strip.casecmp('y').zero?
|
53
|
+
puts
|
54
|
+
yield
|
55
|
+
elsif exit_unconfirmed
|
53
56
|
puts "\n Cancelled.\n".light_yellow
|
54
57
|
exit 1
|
58
|
+
else
|
59
|
+
puts
|
55
60
|
end
|
56
|
-
puts
|
57
|
-
|
58
|
-
yield
|
59
61
|
end
|
60
62
|
|
61
63
|
# Asks for user input using the given message and returns it
|
@@ -55,7 +55,9 @@ module Dev
|
|
55
55
|
# If EOL info is a boolean or missing from the current details, overwrite with the manual date (if present)
|
56
56
|
manual_date = Dev::EndOfLife.config.manual_dates["#{product}_#{cycle.tr('.', '_')}".to_sym]
|
57
57
|
detail['eol'] = manual_date if manual_date && (detail['eol'].boolean? || detail['eol'].nil?)
|
58
|
-
|
58
|
+
|
59
|
+
raise "unable to query eol detail for #{name}, #{cycle}" if detail.empty?
|
60
|
+
|
59
61
|
detail
|
60
62
|
end
|
61
63
|
|
@@ -93,25 +93,6 @@ module Dev
|
|
93
93
|
end
|
94
94
|
end
|
95
95
|
# rubocop:enable Metrics/MethodLength
|
96
|
-
|
97
|
-
# Create the rake task for the eol method
|
98
|
-
def create_eol_task!
|
99
|
-
# Have to set a local variable to be accessible inside of the instance_eval block
|
100
|
-
exclude = @exclude
|
101
|
-
|
102
|
-
DEV_COMMANDS_TOP_LEVEL.instance_eval do
|
103
|
-
return if exclude.include?(:eol)
|
104
|
-
|
105
|
-
desc 'Compares the current date to the EOL date for supported resources'
|
106
|
-
task eol: %w(init ensure_aws_credentials) do
|
107
|
-
account_id = Dev::Aws::Profile.new.current
|
108
|
-
account_name = Dev::Aws::Account.new.name_by_account(account_id)
|
109
|
-
LOG.info " Current AWS Account is #{account_name} (#{account_id})".light_yellow
|
110
|
-
|
111
|
-
Dev::EndOfLife.new(product_versions: Dev::EndOfLife::Aws.new.default_products).check
|
112
|
-
end
|
113
|
-
end
|
114
|
-
end
|
115
96
|
end
|
116
97
|
end
|
117
98
|
end
|
@@ -9,6 +9,10 @@ DEV_COMMANDS_PROJECT_NAME = File.basename(DEV_COMMANDS_ROOT_DIR)
|
|
9
9
|
# A reference to the top level object context
|
10
10
|
DEV_COMMANDS_TOP_LEVEL = self
|
11
11
|
|
12
|
+
# Load all gems referenced in the Gemfile
|
13
|
+
require 'bundler'
|
14
|
+
Bundler.require
|
15
|
+
|
12
16
|
# Add libdir to the default ruby path
|
13
17
|
libdir = File.realpath(File.dirname(__FILE__))
|
14
18
|
$LOAD_PATH.unshift libdir
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: firespring_dev_commands
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.13.pre.alpha.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Firespring
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-11-
|
11
|
+
date: 2023-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -66,62 +66,6 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 1.61.0
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: aws-sdk-elasticache
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: 1.88.0
|
76
|
-
type: :runtime
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: 1.88.0
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: aws-sdk-lambda
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - "~>"
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: 1.101.0
|
90
|
-
type: :runtime
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - "~>"
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: 1.101.0
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: aws-sdk-opensearchservice
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - "~>"
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: 1.24.0
|
104
|
-
type: :runtime
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - "~>"
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: 1.24.0
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: aws-sdk-rds
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - "~>"
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: 1.183.0
|
118
|
-
type: :runtime
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - "~>"
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: 1.183.0
|
125
69
|
- !ruby/object:Gem::Dependency
|
126
70
|
name: aws-sdk-s3
|
127
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -336,7 +280,6 @@ files:
|
|
336
280
|
- lib/firespring_dev_commands/dotenv.rb
|
337
281
|
- lib/firespring_dev_commands/env.rb
|
338
282
|
- lib/firespring_dev_commands/eol.rb
|
339
|
-
- lib/firespring_dev_commands/eol/aws.rb
|
340
283
|
- lib/firespring_dev_commands/eol/product_version.rb
|
341
284
|
- lib/firespring_dev_commands/git.rb
|
342
285
|
- lib/firespring_dev_commands/git/info.rb
|
@@ -1,117 +0,0 @@
|
|
1
|
-
require 'aws-sdk-lambda'
|
2
|
-
require 'aws-sdk-elasticache'
|
3
|
-
require 'aws-sdk-rds'
|
4
|
-
require 'aws-sdk-opensearchservice'
|
5
|
-
|
6
|
-
module Dev
|
7
|
-
class EndOfLife
|
8
|
-
# Class which queries several different AWS product types and
|
9
|
-
# returns ProductVersion entities which can be checked for EOL
|
10
|
-
class Aws
|
11
|
-
# Queries and returns product versions for the default product types
|
12
|
-
def default_products
|
13
|
-
(elasticache_products + lambda_products + opensearch_products + rds_products).flatten.compact
|
14
|
-
end
|
15
|
-
|
16
|
-
# Queries and returns product versions for elasticache products
|
17
|
-
def elasticache_products
|
18
|
-
client = ::Aws::ElastiCache::Client.new
|
19
|
-
|
20
|
-
[].tap do |ary|
|
21
|
-
Dev::Aws.each_page(client, :describe_cache_clusters) do |response|
|
22
|
-
response.cache_clusters.each do |cluster|
|
23
|
-
name = cluster.cache_cluster_id
|
24
|
-
product = cluster.engine
|
25
|
-
version = cluster.engine_version.reverse.split('.')[-2..].join('.').reverse
|
26
|
-
ary << Dev::EndOfLife::ProductVersion.new(product, version, name)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
# Queries and returns product versions for lambda products
|
33
|
-
def lambda_products
|
34
|
-
client = ::Aws::Lambda::Client.new
|
35
|
-
|
36
|
-
[].tap do |ary|
|
37
|
-
Dev::Aws.each_page(client, :list_functions) do |response|
|
38
|
-
response.functions.each do |function|
|
39
|
-
# Runtime is empty if using a docker image
|
40
|
-
next unless function.runtime
|
41
|
-
|
42
|
-
name = function.function_name
|
43
|
-
product = function&.runtime&.split(/[0-9]/, 2)&.first
|
44
|
-
version = function&.runtime&.split(/#{product}/, 2)&.last&.chomp('.x')
|
45
|
-
ary << Dev::EndOfLife::ProductVersion.new(product, version, name)
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
# Queries and returns product versions for opensearch products
|
52
|
-
def opensearch_products
|
53
|
-
client = ::Aws::OpenSearchService::Client.new
|
54
|
-
|
55
|
-
[].tap do |ary|
|
56
|
-
Dev::Aws.each_page(client, :list_domain_names) do |response|
|
57
|
-
response.domain_names.each do |domain|
|
58
|
-
name = domain.domain_name
|
59
|
-
product = domain.engine_type
|
60
|
-
version = client.describe_domain(domain_name: name).domain_status.engine_version.split('_').last.split('.').first
|
61
|
-
ary << Dev::EndOfLife::ProductVersion.new(product, version, name)
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
# Queries and returns product versions for rds products
|
68
|
-
def rds_products
|
69
|
-
rds_instance_products + rds_cluster_products
|
70
|
-
end
|
71
|
-
|
72
|
-
# Queries and returns product versions for rds instance products
|
73
|
-
def rds_instance_products
|
74
|
-
aws_engines = %w(mysql postgresql)
|
75
|
-
client = ::Aws::RDS::Client.new
|
76
|
-
|
77
|
-
[].tap do |ary|
|
78
|
-
Dev::Aws.each_page(client, :describe_db_instances) do |response|
|
79
|
-
response.db_instances.each do |instance|
|
80
|
-
name = instance.db_instance_identifier
|
81
|
-
engine = instance.engine.tr('aurora-', '')
|
82
|
-
product = if aws_engines.include?(engine)
|
83
|
-
"amazon-rds-#{engine}"
|
84
|
-
else
|
85
|
-
engine
|
86
|
-
end
|
87
|
-
version = instance.engine_version.reverse.split('.')[-2..].join('.').reverse
|
88
|
-
ary << Dev::EndOfLife::ProductVersion.new(product, version, name)
|
89
|
-
end
|
90
|
-
end
|
91
|
-
end
|
92
|
-
end
|
93
|
-
|
94
|
-
# Queries and returns product versions for rds cluster products
|
95
|
-
def rds_cluster_products
|
96
|
-
aws_engines = %w(mysql postgresql)
|
97
|
-
client = ::Aws::RDS::Client.new
|
98
|
-
|
99
|
-
[].tap do |ary|
|
100
|
-
Dev::Aws.each_page(client, :describe_db_clusters) do |response|
|
101
|
-
response.db_clusters.each do |cluster|
|
102
|
-
name = cluster.db_cluster_identifier
|
103
|
-
engine = cluster.engine.tr('aurora-', '')
|
104
|
-
product = if aws_engines.include?(engine)
|
105
|
-
"amazon-rds-#{engine}"
|
106
|
-
else
|
107
|
-
engine
|
108
|
-
end
|
109
|
-
version = cluster.engine_version.reverse.split('.')[-2..].join('.').reverse
|
110
|
-
ary << Dev::EndOfLife::ProductVersion.new(product, version, name)
|
111
|
-
end
|
112
|
-
end
|
113
|
-
end
|
114
|
-
end
|
115
|
-
end
|
116
|
-
end
|
117
|
-
end
|