firespring_dev_commands 1.4.0 → 1.4.1.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/lib/firespring_dev_commands/aws/profile.rb +9 -0
- data/lib/firespring_dev_commands/templates/aws.rb +14 -0
- data/lib/firespring_dev_commands/templates/base_interface.rb +17 -3
- data/lib/firespring_dev_commands/templates/docker/application.rb +20 -1
- data/lib/firespring_dev_commands/templates/docker/default.rb +24 -0
- data/lib/firespring_dev_commands/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5a37e3ee4aa07b7c2afd6ee5b5067b1feacebba16e73b89493a29b938359e99
|
4
|
+
data.tar.gz: b5c0625a1f50e83d5a8f6996d604ae39666dd24c6de9ed13c2188f3104a313cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c3cf4d5524185f48a7f6ac148c22cc52af97a5f335398cad65c2c833881b46a8c6d7d38f51c53c108fb943e20e1c305e01a9ea8ff6e8956df94a464932c19f6
|
7
|
+
data.tar.gz: 3763936a015d6dcf2d75968b4815aa7d25a6c1e24b9855ef3fead0be806ec79a59d82315203a7017c9eef6f3d7aad4d6c9c2fa9b6d112dc3dc0a1b3e2dc2250c
|
@@ -50,6 +50,15 @@ module Dev
|
|
50
50
|
puts " export AWS_SESSION_TOKEN=#{ENV.fetch('AWS_SESSION_TOKEN', nil)}"
|
51
51
|
puts
|
52
52
|
end
|
53
|
+
|
54
|
+
# Print the export commands for the current credentials
|
55
|
+
def export_info
|
56
|
+
Dev::Aws::Credentials.new.export!
|
57
|
+
puts "export AWS_DEFAULT_REGION=#{ENV.fetch('AWS_DEFAULT_REGION', nil)}"
|
58
|
+
puts "export AWS_ACCESS_KEY_ID=#{ENV.fetch('AWS_ACCESS_KEY_ID', nil)}"
|
59
|
+
puts "export AWS_SECRET_ACCESS_KEY=#{ENV.fetch('AWS_SECRET_ACCESS_KEY', nil)}"
|
60
|
+
puts "export AWS_SESSION_TOKEN=#{ENV.fetch('AWS_SESSION_TOKEN', nil)}"
|
61
|
+
end
|
53
62
|
end
|
54
63
|
end
|
55
64
|
end
|
@@ -31,6 +31,20 @@ module Dev
|
|
31
31
|
task profile: %w(init) do
|
32
32
|
Dev::Aws::Profile.new.info
|
33
33
|
end
|
34
|
+
|
35
|
+
namespace :profile do
|
36
|
+
desc 'Return the commands to export your AWS credentials into your environment'
|
37
|
+
task :export do
|
38
|
+
# Turn off all logging except for errors
|
39
|
+
LOG.level = Logger::ERROR
|
40
|
+
|
41
|
+
# Run the init
|
42
|
+
Rake::Task[:nit].invoke
|
43
|
+
|
44
|
+
# Print the export info
|
45
|
+
Dev::Aws::Profile.new.export_info
|
46
|
+
end
|
47
|
+
end
|
34
48
|
end
|
35
49
|
end
|
36
50
|
end
|
@@ -118,9 +118,9 @@ DEV_COMMANDS_TOP_LEVEL.instance_eval do
|
|
118
118
|
|
119
119
|
# Define an empty _pre_down_hooks handler which can be overridden by the user
|
120
120
|
task :_pre_down_hooks do
|
121
|
-
# The user may define custom
|
122
|
-
# Define this process in the appropriate namespace to add them only to a specific
|
123
|
-
# In that case it is recommended that you call the base
|
121
|
+
# The user may define custom _pre_down_hooks tasks to add any pre-down actions the down process
|
122
|
+
# Define this process in the appropriate namespace to add them only to a specific down
|
123
|
+
# In that case it is recommended that you call the base _pre_down_hooks as a dependency of that task
|
124
124
|
end
|
125
125
|
|
126
126
|
# Define an empty _post_down_hooks handler which can be overridden by the user
|
@@ -130,6 +130,20 @@ DEV_COMMANDS_TOP_LEVEL.instance_eval do
|
|
130
130
|
# In that case it is recommended that you call the base _post_down_hooks as a dependency of that task
|
131
131
|
end
|
132
132
|
|
133
|
+
# Define an empty _pre_stop_hooks handler which can be overridden by the user
|
134
|
+
task :_pre_stop_hooks do
|
135
|
+
# The user may define custom _pre_stop_hooks tasks to add any pre-stop actions the stop process
|
136
|
+
# Define this process in the appropriate namespace to add them only to a specific stop
|
137
|
+
# In that case it is recommended that you call the base _pre_stop_hooks as a dependency of that task
|
138
|
+
end
|
139
|
+
|
140
|
+
# Define an empty _post_stop_hooks handler which can be overridden by the user
|
141
|
+
task :_post_stop_hooks do
|
142
|
+
# The user may define custom _post_stop_hooks tasks to add any post-stop actions the stop process
|
143
|
+
# Define this process in the appropriate namespace to add them only to a specific stop
|
144
|
+
# In that case it is recommended that you call the base _post_stop_hooks as a dependency of that task
|
145
|
+
end
|
146
|
+
|
133
147
|
# Define an empty _pre_reload_hooks handler which can be overridden by the user
|
134
148
|
task :_pre_reload_hooks do
|
135
149
|
# The user may define custom _pre_reload_hooks tasks to add any pre-reload actions the reload process
|
@@ -108,7 +108,7 @@ module Dev
|
|
108
108
|
namespace application do
|
109
109
|
return if exclude.include?(:down)
|
110
110
|
|
111
|
-
desc "
|
111
|
+
desc "Shut down the #{application} container and remove associated resources"
|
112
112
|
task down: %w(init_docker _pre_down_hooks) do
|
113
113
|
LOG.debug "In #{application} down"
|
114
114
|
|
@@ -125,6 +125,25 @@ module Dev
|
|
125
125
|
end
|
126
126
|
end
|
127
127
|
|
128
|
+
# Create the rake task which runs a docker compose stop for the application name
|
129
|
+
def create_stop_task!
|
130
|
+
application = @name
|
131
|
+
exclude = @exclude
|
132
|
+
|
133
|
+
DEV_COMMANDS_TOP_LEVEL.instance_eval do
|
134
|
+
namespace application do
|
135
|
+
return if exclude.include?(:stop)
|
136
|
+
|
137
|
+
desc "Stops the #{application} container"
|
138
|
+
task stop: %w(init_docker _pre_stop_hooks) do
|
139
|
+
LOG.debug "In #{application} stop"
|
140
|
+
Dev::Docker::Compose.new(services: [application]).stop
|
141
|
+
Rake::Task[:_post_stop_hooks].execute
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
128
147
|
# Create the rake task which stops, cleans, and starts the application
|
129
148
|
def create_reload_task!
|
130
149
|
application = @name
|
@@ -76,6 +76,30 @@ module Dev
|
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
79
|
+
# Create the rake task which stops all running containers
|
80
|
+
def create_stop_task!
|
81
|
+
exclude = @exclude
|
82
|
+
|
83
|
+
DEV_COMMANDS_TOP_LEVEL.instance_eval do
|
84
|
+
return if exclude.include?(:stop)
|
85
|
+
|
86
|
+
desc 'Stops all running containers'
|
87
|
+
task stop: %w(init_docker _pre_stop_hooks) do
|
88
|
+
LOG.debug('In base stop')
|
89
|
+
|
90
|
+
containers = ::Docker::Container.all(filters: {status: %w(restarting running)}.to_json)
|
91
|
+
containers.each do |container|
|
92
|
+
next if container&.info&.dig('Names')&.any? { |name| name.start_with?('/windows_tcp') }
|
93
|
+
|
94
|
+
LOG.info "Stopping container #{container.id[0, 12]}"
|
95
|
+
container.stop(timeout: 120)
|
96
|
+
end
|
97
|
+
|
98
|
+
Rake::Task[:_post_stop_hooks].execute
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
79
103
|
# Create the rake task which runs a docker compose down followed by an up
|
80
104
|
def create_reload_task!
|
81
105
|
exclude = @exclude
|
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: 1.4.
|
4
|
+
version: 1.4.1.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-05-
|
11
|
+
date: 2023-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -453,9 +453,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
453
453
|
version: '2.7'
|
454
454
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
455
455
|
requirements:
|
456
|
-
- - "
|
456
|
+
- - ">"
|
457
457
|
- !ruby/object:Gem::Version
|
458
|
-
version:
|
458
|
+
version: 1.3.1
|
459
459
|
requirements: []
|
460
460
|
rubygems_version: 3.1.6
|
461
461
|
signing_key:
|