lucy_dockerunner 0.1.8 → 0.1.9
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/Gemfile.lock +1 -1
- data/lib/lucy_dockerunner/version.rb +1 -1
- data/lib/tasks/compose.rake +37 -27
- data/lib/tasks/compose_logs.rake +48 -0
- data/lib/tasks/compose_prod.rake +6 -6
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5982619210e56d52470c5a60eb936282f0e37f958c993c0511c25c546b25004
|
4
|
+
data.tar.gz: b6a090ac20f0d81b44c2a78c1488ba354ab43d5f261945fb053c43d182d17058
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f08537f76a386d8c07cbe474a3297d56851984103a07e8dae69f64585687088b607e2e6ed260e5cf01903462546e5ecec13a4320f0f704bf8f2fd4939b63ae07
|
7
|
+
data.tar.gz: 253c9000552f954a2522c8104a69e7474b2c88b80691fd713216dbea5cecdd97043956e0a1c3032f9e43999ed9e9805f1b9fcd8174960f7fc53cc1bc3e1806e3
|
data/Gemfile.lock
CHANGED
data/lib/tasks/compose.rake
CHANGED
@@ -69,6 +69,30 @@ namespace :compose do
|
|
69
69
|
system "sudo #{compose_command} down"
|
70
70
|
puts "Stopping Compose... Done!"
|
71
71
|
end
|
72
|
+
|
73
|
+
task :bot_detach do
|
74
|
+
puts "Running Bot Detached..."
|
75
|
+
system "sudo #{compose_command} up -d bot"
|
76
|
+
puts "Running Bot Detached... Done!"
|
77
|
+
end
|
78
|
+
|
79
|
+
task :telegram_detach do
|
80
|
+
puts "Running Telegram Detached..."
|
81
|
+
system "sudo #{compose_command} up -d telegram"
|
82
|
+
puts "Running Telegram Detached... Done!"
|
83
|
+
end
|
84
|
+
|
85
|
+
task :discord_detach do
|
86
|
+
puts "Running Discord Detached..."
|
87
|
+
system "sudo #{compose_command} up -d discord"
|
88
|
+
puts "Running Discord Detached... Done!"
|
89
|
+
end
|
90
|
+
|
91
|
+
task :nginx_detach do
|
92
|
+
puts "Running Nginx Detached..."
|
93
|
+
system "sudo #{compose_command} up -d nginx"
|
94
|
+
puts "Running Nginx Detached... Done!"
|
95
|
+
end
|
72
96
|
|
73
97
|
task :db_detach do
|
74
98
|
puts "Running Database Detached..."
|
@@ -82,11 +106,11 @@ namespace :compose do
|
|
82
106
|
puts "Running Redis Detached... Done!"
|
83
107
|
end
|
84
108
|
|
85
|
-
task :back_detach do
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
end
|
109
|
+
# task :back_detach do
|
110
|
+
# puts "Running Backend Detached..."
|
111
|
+
# system "sudo #{compose_command} up -d --remove-orphans db redis sidekiq"
|
112
|
+
# puts "Running Backend Detached... Done!"
|
113
|
+
# end
|
90
114
|
|
91
115
|
task :restart do
|
92
116
|
puts "Restarting Compose..."
|
@@ -112,21 +136,7 @@ namespace :compose do
|
|
112
136
|
|
113
137
|
task :clean_all do
|
114
138
|
puts "Cleaning Compose..."
|
115
|
-
|
116
|
-
system "sudo #{compose_command} down"
|
117
|
-
puts "Stopping Compose... Done!"
|
118
|
-
puts "Removing Containers..."
|
119
|
-
system "sudo #{compose_command} rm -f"
|
120
|
-
puts "Removing Containers... Done!"
|
121
|
-
puts "Removing Images..."
|
122
|
-
system "sudo #{compose_command} rmi -f"
|
123
|
-
puts "Removing Images... Done!"
|
124
|
-
puts "Removing Volumes..."
|
125
|
-
system "sudo #{compose_command} down -v"
|
126
|
-
puts "Removing Volumes... Done!"
|
127
|
-
puts "Removing Orphans..."
|
128
|
-
system "sudo #{compose_command} down --remove-orphans"
|
129
|
-
puts "Removing Networks... Done!"
|
139
|
+
system "sudo docker system prune"
|
130
140
|
puts "Cleaning Compose... Done!"
|
131
141
|
end
|
132
142
|
|
@@ -175,20 +185,20 @@ namespace :compose do
|
|
175
185
|
end
|
176
186
|
end
|
177
187
|
|
178
|
-
def
|
179
|
-
|
188
|
+
def compose_exist?
|
189
|
+
File.exist?(compose_file)
|
180
190
|
end
|
181
191
|
|
182
|
-
def
|
183
|
-
|
192
|
+
def dockerfile_exist?
|
193
|
+
File.exist?("Dockerfile")
|
184
194
|
end
|
185
195
|
|
186
196
|
tasks_names.each do |task|
|
187
197
|
before_action = "#{namesp}:#{task}"
|
188
198
|
Rake::Task[before_action].enhance do
|
189
199
|
docker_abort_error = "Dockerfile not found.\nYou must have a Dockerfile file."
|
190
|
-
compose_abort_error = "Compose file not found.\nYou must have a docker-compose.
|
191
|
-
|
192
|
-
|
200
|
+
compose_abort_error = "Compose file not found.\nYou must have a docker-compose.yml file."
|
201
|
+
abort(docker_abort_error) unless dockerfile_exist?
|
202
|
+
abort(compose_abort_error) unless compose_exist?
|
193
203
|
end
|
194
204
|
end
|
data/lib/tasks/compose_logs.rake
CHANGED
@@ -12,6 +12,30 @@ def compose_command
|
|
12
12
|
end
|
13
13
|
|
14
14
|
namespace :compose_logs do
|
15
|
+
task :discord do
|
16
|
+
puts "Showing Discord Logs..."
|
17
|
+
system "sudo #{compose_command} logs discord"
|
18
|
+
puts "Showing Discord Logs... Done!"
|
19
|
+
end
|
20
|
+
|
21
|
+
task :telegram do
|
22
|
+
puts "Showing Telegram Logs..."
|
23
|
+
system "sudo #{compose_command} logs telegram"
|
24
|
+
puts "Showing Telegram Logs... Done!"
|
25
|
+
end
|
26
|
+
|
27
|
+
task :bot do
|
28
|
+
puts "Showing Bot Logs..."
|
29
|
+
system "sudo #{compose_command} logs bot"
|
30
|
+
puts "Showing Bot Logs... Done!"
|
31
|
+
end
|
32
|
+
|
33
|
+
task :nginx do
|
34
|
+
puts "Showing Nginx Logs..."
|
35
|
+
system "sudo #{compose_command} logs nginx"
|
36
|
+
puts "Showing Nginx Logs... Done!"
|
37
|
+
end
|
38
|
+
|
15
39
|
task :web do
|
16
40
|
puts "Showing Web Logs..."
|
17
41
|
system "sudo #{compose_command} logs web"
|
@@ -42,6 +66,30 @@ namespace :compose_logs do
|
|
42
66
|
puts "Showing All Logs... Done!"
|
43
67
|
end
|
44
68
|
|
69
|
+
task :tail_discord do
|
70
|
+
puts "Tailing Discord Logs..."
|
71
|
+
system "sudo #{compose_command} logs -f discord"
|
72
|
+
puts "Tailing Discord Logs... Done!"
|
73
|
+
end
|
74
|
+
|
75
|
+
task :tail_telegram do
|
76
|
+
puts "Tailing Telegram Logs..."
|
77
|
+
system "sudo #{compose_command} logs -f telegram"
|
78
|
+
puts "Tailing Telegram Logs... Done!"
|
79
|
+
end
|
80
|
+
|
81
|
+
task :tail_bot do
|
82
|
+
puts "Tailing Bot Logs..."
|
83
|
+
system "sudo #{compose_command} logs -f bot"
|
84
|
+
puts "Tailing Bot Logs... Done!"
|
85
|
+
end
|
86
|
+
|
87
|
+
task :tail_nginx do
|
88
|
+
puts "Tailing Nginx Logs..."
|
89
|
+
system "sudo #{compose_command} logs -f nginx"
|
90
|
+
puts "Tailing Nginx Logs... Done!"
|
91
|
+
end
|
92
|
+
|
45
93
|
task :tail_web do
|
46
94
|
puts "Tailing Web Logs..."
|
47
95
|
system "sudo #{compose_command} logs -f web"
|
data/lib/tasks/compose_prod.rake
CHANGED
@@ -231,12 +231,12 @@ namespace :compose_prod do
|
|
231
231
|
end
|
232
232
|
end
|
233
233
|
|
234
|
-
def
|
235
|
-
|
234
|
+
def compose_exist?
|
235
|
+
File.exist?(compose_file)
|
236
236
|
end
|
237
237
|
|
238
|
-
def
|
239
|
-
|
238
|
+
def dockerfile_exist?
|
239
|
+
File.exist?("Dockerfile")
|
240
240
|
end
|
241
241
|
|
242
242
|
tasks_names.each do |task|
|
@@ -244,8 +244,8 @@ tasks_names.each do |task|
|
|
244
244
|
Rake::Task[before_action].enhance do
|
245
245
|
docker_abort_error = "Dockerfile not found.\nYou must have a Dockerfile file."
|
246
246
|
compose_abort_error = "Compose file not found.\nYou must have a docker-compose.prod.yml file."
|
247
|
-
|
248
|
-
|
247
|
+
abort(docker_abort_error) unless dockerfile_exist?
|
248
|
+
abort(compose_abort_error) unless compose_exist?
|
249
249
|
end
|
250
250
|
end
|
251
251
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lucy_dockerunner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JesusGautamah
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |-
|
14
14
|
This gem is a tool to run docker containers with rake commands, good for CI/CD and Rails projects.
|
@@ -65,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
65
65
|
- !ruby/object:Gem::Version
|
66
66
|
version: '0'
|
67
67
|
requirements: []
|
68
|
-
rubygems_version: 3.4.
|
68
|
+
rubygems_version: 3.4.6
|
69
69
|
signing_key:
|
70
70
|
specification_version: 4
|
71
71
|
summary: This gem is a tool to run docker containers with rake commands, good for
|