lucy_dockerunner 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +10 -3
- data/lib/lucy_dockerunner/version.rb +1 -1
- data/lib/tasks/compose.rake +5 -7
- data/lib/tasks/compose_assets.rake +0 -1
- data/lib/tasks/compose_prod.rake +3 -3
- metadata +1 -2
- data/lib/rake/lucyd_hooks.rb +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3a36c58434b995bf29542f0db7573c35b54c152a134eb4d36098e6ba86ca3a6
|
4
|
+
data.tar.gz: 10d72d8711a338fe1c71711de7bbfca41979c8787a243d916f2fcfe351198502
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08efb3fa738f8664743422d43833e638cda59446854388789a012c3b5203c86b0a3bd370426122c9b3f7299d44f16fa088c3171907b3303169417268b8f867db'
|
7
|
+
data.tar.gz: c12c37d2031dbaf034c649e18f30ccec090a4aeafdd93b6185498e93976c5ea61c0fba5d38653fac9618371332b4897b238dabf14d42dc8bd92412639a39874e
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -28,6 +28,16 @@ It's important to have .env files separated by environment, for example:
|
|
28
28
|
- .env.production
|
29
29
|
|
30
30
|
And remember to add the .env files to the .gitignore file and reference them in the docker-compose.yml and docker-compose.prod.yml files.
|
31
|
+
|
32
|
+
## Services
|
33
|
+
This gem requires the following services names to be included in the docker-compose.yml and docker-compose.prod.yml files:
|
34
|
+
<!-- db - redis - web - sidekiq -->
|
35
|
+
* db
|
36
|
+
* redis
|
37
|
+
* web
|
38
|
+
* sidekiq
|
39
|
+
|
40
|
+
##### more services will be added in the future, for example: mailcatcher, elasticsearch, webpack, etc.
|
31
41
|
## Installation
|
32
42
|
|
33
43
|
You can install the gem by executing:
|
@@ -127,9 +137,6 @@ LucyDockerunner.load_tasks
|
|
127
137
|
````bash
|
128
138
|
$ rake compose:up
|
129
139
|
````
|
130
|
-
|
131
|
-
## References
|
132
|
-
The code code inside the 'lib/rake/lucyd_hooks.rb' file is based on the code of the [rake-hooks](https://github.com/guillermo/rake-hooks) from Guillermo Iguaran, Joel Moss as described in the [Ruby Toolbox](https://www.ruby-toolbox.com/projects/rake-hooks) page.
|
133
140
|
## Contributing
|
134
141
|
|
135
142
|
Bug reports and pull requests are welcome on GitHub at https://github.com/JesusGautamah/lucy_dockerunner. 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/JesusGautamah/lucy_dockerunner/blob/master/CODE_OF_CONDUCT.md).
|
data/lib/tasks/compose.rake
CHANGED
@@ -2,11 +2,9 @@
|
|
2
2
|
|
3
3
|
require "rake"
|
4
4
|
require_relative "task_helpers/compose_taskhelper"
|
5
|
-
require_relative "../rake/lucyd_hooks"
|
6
5
|
|
7
6
|
def tasks_names
|
8
|
-
@tasks_names = %w[install build up down restart clean_all clean_volumes clean_orphans clean_images
|
9
|
-
clean_stopped]
|
7
|
+
@tasks_names = %w[install build up down restart clean_all clean_volumes clean_orphans clean_images]
|
10
8
|
end
|
11
9
|
|
12
10
|
def namesp
|
@@ -187,10 +185,10 @@ end
|
|
187
185
|
|
188
186
|
tasks_names.each do |task|
|
189
187
|
before_action = "#{namesp}:#{task}"
|
190
|
-
|
188
|
+
Rake::Task[before_action].enhance do
|
191
189
|
docker_abort_error = "Dockerfile not found.\nYou must have a Dockerfile file."
|
192
|
-
compose_abort_error = "Compose file not found.\
|
193
|
-
dockerfile_checker ? abort(docker_abort_error) : puts("Dockerfile found
|
194
|
-
compose_checker ? abort(compose_abort_error) : puts("Compose file found
|
190
|
+
compose_abort_error = "Compose file not found.\nYou must have a docker-compose.prod.yml file."
|
191
|
+
dockerfile_checker ? abort(docker_abort_error) : puts("Dockerfile found")
|
192
|
+
compose_checker ? abort(compose_abort_error) : puts("Compose Production file found")
|
195
193
|
end
|
196
194
|
end
|
data/lib/tasks/compose_prod.rake
CHANGED
@@ -4,8 +4,7 @@ require "rake"
|
|
4
4
|
require_relative "task_helpers/compose_taskhelper"
|
5
5
|
|
6
6
|
def tasks_names
|
7
|
-
@tasks_names = %w[install build up down restart clean_all clean_volumes clean_orphans clean_images
|
8
|
-
clean_stopped]
|
7
|
+
@tasks_names = %w[install build up down restart clean_all clean_volumes clean_orphans clean_images]
|
9
8
|
end
|
10
9
|
|
11
10
|
def namesp
|
@@ -242,10 +241,11 @@ end
|
|
242
241
|
|
243
242
|
tasks_names.each do |task|
|
244
243
|
before_action = "#{namesp}:#{task}"
|
245
|
-
|
244
|
+
Rake::Task[before_action].enhance do
|
246
245
|
docker_abort_error = "Dockerfile not found.\nYou must have a Dockerfile file."
|
247
246
|
compose_abort_error = "Compose file not found.\nYou must have a docker-compose.prod.yml file."
|
248
247
|
dockerfile_checker ? abort(docker_abort_error) : puts("Dockerfile found")
|
249
248
|
compose_checker ? abort(compose_abort_error) : puts("Compose Production file found")
|
250
249
|
end
|
251
250
|
end
|
251
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JesusGautamah
|
@@ -31,7 +31,6 @@ files:
|
|
31
31
|
- Rakefile
|
32
32
|
- lib/lucy_dockerunner.rb
|
33
33
|
- lib/lucy_dockerunner/version.rb
|
34
|
-
- lib/rake/lucyd_hooks.rb
|
35
34
|
- lib/tasks/.keep
|
36
35
|
- lib/tasks/compose.rake
|
37
36
|
- lib/tasks/compose_assets.rake
|
data/lib/rake/lucyd_hooks.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# from https://github.com/guillermo/rake-hooks, authors Guillermo Iguaran, Joel Moss
|
4
|
-
module Rake
|
5
|
-
# module Rake::Hooks
|
6
|
-
module LucydHooks
|
7
|
-
def bef(*task_names, &new_task)
|
8
|
-
task_names.each do |task_name|
|
9
|
-
old_task = Rake.application.instance_variable_get("@tasks").delete(task_name.to_s)
|
10
|
-
next unless old_task
|
11
|
-
|
12
|
-
desc old_task.full_comment if old_task.respond_to?(:full_comment)
|
13
|
-
task task_name => old_task.prerequisites do
|
14
|
-
new_task.call
|
15
|
-
old_task.invoke
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
Rake::DSL.include Rake::LucydHooks if defined?(Rake::DSL)
|
22
|
-
include Rake::LucydHooks unless self.class.included_modules.include?(Rake::LucydHooks)
|
23
|
-
end
|