firespring_dev_commands 3.1.0 → 3.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b8a0cf1089d3d18c9125820042028a2c2acd1324aec9cc1f7e0a6726a643d2ed
4
- data.tar.gz: 374e07c279f5a49e364f6de708349214441174ab92fa2d52ac90e117ccf46ab8
3
+ metadata.gz: 3e77ca766ac1043ad38f01aafffa2d0858efa3921c652b6936ccd0a001bde044
4
+ data.tar.gz: 98b5fd9ce91cfbcba95e27584383d9926e853b434139c9e4cdb7675cb88d7de7
5
5
  SHA512:
6
- metadata.gz: a90a05a3beef66c4cbc4a931f3f09c836b5e489e4c0e979d786f8d17a122e8fe12bb1eaed0b0387c0127e6a6ea7f03500ef85828efd921a7ca59707bbafdb2b5
7
- data.tar.gz: 4b7b731d9ba25e3ebf8d14ac7da991e2b111ff9cd9e69cc09c9595b20d35699d80230dadea34cd7923bbdaeaccaae2b76d56b15c4062a98883fb6e60a13f2aab
6
+ metadata.gz: 5f2c044d0b6a06d7134359a05c02254f3191ecda757f77a87dd81bd8d26b1e5eaf345137c6162ab6d622bc3a10217c6f7bc96c74900890a17a810026dfd437aa
7
+ data.tar.gz: c409dd449358dffb2dd2afb482e9916a44c63b9fb5d8a0b3191ac29b25dded23f1699dde6a91ef187ffb9bf26fea22f65fe2fe9dc2a872849d339407a73db345
@@ -1,5 +1,6 @@
1
1
  module Dev
2
2
  class EndOfLife
3
+ # Class which checks for eol packges referenced by the node package manager
3
4
  class Node
4
5
  attr_reader :node, :lockfile
5
6
 
@@ -8,10 +9,14 @@ module Dev
8
9
  @lockfile = File.join(node.local_path, "#{node.package_file.reverse.split('.')[-1].reverse}-lock.json")
9
10
  end
10
11
 
12
+ # Default to NPM products
11
13
  def default_products
12
14
  npm_products
13
15
  end
14
16
 
17
+ # 1.) Parse the npm lock file
18
+ # 2.) Do some package name and version manipulation
19
+ # 3.) Return the product if it looks like something that the EOL library tracks
15
20
  def npm_products
16
21
  eol = Dev::EndOfLife.new
17
22
  major_version_only_products = %w(ckeditor vue jquery)
@@ -1,5 +1,6 @@
1
1
  module Dev
2
2
  class EndOfLife
3
+ # Class which checks for eol packges referenced by the php package manager
3
4
  class Php
4
5
  attr_reader :php, :lockfile
5
6
 
@@ -8,10 +9,14 @@ module Dev
8
9
  @lockfile = File.join(php.local_path, "#{php.package_file.reverse.split('.')[-1].reverse}.lock")
9
10
  end
10
11
 
12
+ # Default to Composer products
11
13
  def default_products
12
14
  composer_products
13
15
  end
14
16
 
17
+ # 1.) Parse the composer lock file
18
+ # 2.) Do some package name and version manipulation
19
+ # 3.) Return the product if it looks like something that the EOL library tracks
15
20
  def composer_products
16
21
  eol = Dev::EndOfLife.new
17
22
  major_version_only_products = ['laravel']
@@ -1,5 +1,6 @@
1
1
  module Dev
2
2
  class EndOfLife
3
+ # Class which checks for eol packges referenced by the ruby package manager
3
4
  class Ruby
4
5
  attr_reader :ruby, :lockfile
5
6
 
@@ -8,11 +9,15 @@ module Dev
8
9
  @lockfile = File.join(ruby.local_path, "#{ruby.package_file.reverse.split('.')[-1].reverse}.lock")
9
10
  end
10
11
 
12
+ # Default to Rubygems products
11
13
  def default_products
12
- composer_products
14
+ rubygems_products
13
15
  end
14
16
 
15
- def composer_products
17
+ # 1.) Parse the rubygems lock file
18
+ # 2.) Do some package name and version manipulation
19
+ # 3.) Return the product if it looks like something that the EOL library tracks
20
+ def rubygems_products
16
21
  eol = Dev::EndOfLife.new
17
22
  major_version_only_products = []
18
23
 
@@ -18,6 +18,22 @@ module Dev
18
18
  end
19
19
  end
20
20
 
21
+ # Create the rake task which shows the current AWS account information
22
+ def create_show_account_info_task!
23
+ # Have to set a local variable to be accessible inside of the instance_eval block
24
+ exclude = @exclude
25
+
26
+ DEV_COMMANDS_TOP_LEVEL.instance_eval do
27
+ return if exclude.include?(:show_account_info)
28
+
29
+ task show_account_info: %w(init ensure_aws_credentials) do
30
+ account_id = Dev::Aws::Credentials.new.logged_in_account
31
+ account_name = Dev::Aws::Account.new.name_by_account(account_id)
32
+ LOG.info "\n Current AWS Account is #{account_name} (#{account_id})\n".light_yellow
33
+ end
34
+ end
35
+ end
36
+
21
37
  # Create the rake task for the aws profile method
22
38
  def create_profile_task!
23
39
  # Have to set a local variable to be accessible inside of the instance_eval block
@@ -20,15 +20,17 @@ module Dev
20
20
  # Have to set a local variable to be accessible inside of the instance_eval block
21
21
  exclude = @exclude
22
22
  cloudformations = @cloudformations
23
- return if exclude.include?(:status)
23
+ return if exclude.include?(:create)
24
24
 
25
25
  DEV_COMMANDS_TOP_LEVEL.instance_eval do
26
26
  namespace :ci do
27
27
  desc 'Create the ci cloudformation stack in aws'
28
- task create: %w(init ensure_aws_credentials) do
29
- LOG.info
28
+ task create: %w(init ensure_aws_credentials show_account_info) do
30
29
  next if cloudformations.empty?
31
30
 
31
+ names = cloudformations.map(&:name).join(', ')
32
+ Dev::Common.new.exit_unless_confirmed(" This will create the #{names} pipelines. Continue?")
33
+
32
34
  # Start create on all stacks without waiting so they are created in parallel
33
35
  cloudformations.each do |cloudformation|
34
36
  next if cloudformation.exist?
@@ -53,15 +55,17 @@ module Dev
53
55
  # Have to set a local variable to be accessible inside of the instance_eval block
54
56
  exclude = @exclude
55
57
  cloudformations = @cloudformations
56
- return if exclude.include?(:status)
58
+ return if exclude.include?(:update)
57
59
 
58
60
  DEV_COMMANDS_TOP_LEVEL.instance_eval do
59
61
  namespace :ci do
60
62
  desc 'Update the ci cloudformation stack in aws'
61
- task update: %w(init ensure_aws_credentials) do
62
- LOG.info
63
+ task update: %w(init ensure_aws_credentials show_account_info) do
63
64
  next if cloudformations.empty?
64
65
 
66
+ names = cloudformations.map(&:name).join(', ')
67
+ Dev::Common.new.exit_unless_confirmed(" This will update the #{names} pipelines. Continue?")
68
+
65
69
  # Start update on all stacks without waiting so they are updated in parallel
66
70
  cloudformations.each do |cloudformation|
67
71
  next unless cloudformation.exist?
@@ -86,15 +90,17 @@ module Dev
86
90
  # Have to set a local variable to be accessible inside of the instance_eval block
87
91
  exclude = @exclude
88
92
  cloudformations = @cloudformations
89
- return if exclude.include?(:status)
93
+ return if exclude.include?(:delete)
90
94
 
91
95
  DEV_COMMANDS_TOP_LEVEL.instance_eval do
92
96
  namespace :ci do
93
97
  desc 'Delete the ci cloudformation stack in aws'
94
- task delete: %w(init ensure_aws_credentials) do
95
- LOG.info
98
+ task delete: %w(init ensure_aws_credentials show_account_info) do
96
99
  next if cloudformations.empty?
97
100
 
101
+ names = cloudformations.map(&:name).join(', ')
102
+ Dev::Common.new.exit_unless_confirmed(" This will delete the #{names} pipelines. Continue?")
103
+
98
104
  # Start delete on all stacks without waiting so they are deleted in parallel
99
105
  cloudformations.each do |cloudformation|
100
106
  next unless cloudformation.exist?
@@ -124,8 +130,7 @@ module Dev
124
130
  DEV_COMMANDS_TOP_LEVEL.instance_eval do
125
131
  namespace :ci do
126
132
  desc 'Show the current status of the pipelines associated with your branch'
127
- task status: %w(init ensure_aws_credentials) do
128
- LOG.info
133
+ task status: %w(init ensure_aws_credentials show_account_info) do
129
134
  next if cloudformations.empty?
130
135
 
131
136
  pattern = /#{cloudformations.map(&:name).join('|')}/
@@ -6,6 +6,6 @@ module Dev
6
6
  # Use 'v.v.v.pre.alpha.v' for pre-release vesions
7
7
  # Use 'v.v.v.beta.v for beta versions
8
8
  # Use semantic versioning for any releases (https://semver.org/)
9
- VERSION = '3.1.0'.freeze
9
+ VERSION = '3.1.1'.freeze
10
10
  end
11
11
  end
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: 3.1.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Firespring
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-05 00:00:00.000000000 Z
11
+ date: 2024-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport