railsdock 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +23 -23
- data/lib/railsdock/commands/install.rb +24 -5
- data/lib/railsdock/templates/install/default/default.env.erb +1 -1
- data/lib/railsdock/templates/install/default/dev-entrypoint +0 -3
- data/lib/railsdock/templates/install/default/docker-compose.yml.erb +0 -2
- data/lib/railsdock/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1927b87f309de68f89107bf239d8ce5a44f50674f8596e7d806545ae557579bd
|
4
|
+
data.tar.gz: cffa8d9e1a54ea1f53bc8d5f9f599f3b208bdd6de7f4c9c4dccc436f10692376
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7287a0e7bded459fd739b499fd7d04da601606833abff3a87fae46db5b978091448814fbdfd5f57752bc118db36126c0e96c8a0efa1587f409a12d93e9346946
|
7
|
+
data.tar.gz: ab53a1a71395a2c86eb167e349655a6d3e63bbacdfa070b77acd6a985555bd00493d1e9cb0ff9ac1fa712f7615ea2604ea023af09703fd20756e7473dad7fe33
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
railsdock (0.1.
|
4
|
+
railsdock (0.1.4)
|
5
5
|
bundler (~> 2.0)
|
6
6
|
pastel (~> 0.7.2)
|
7
7
|
railties (>= 4.2, < 6.1)
|
@@ -14,20 +14,20 @@ PATH
|
|
14
14
|
GEM
|
15
15
|
remote: https://rubygems.org/
|
16
16
|
specs:
|
17
|
-
actionpack (6.0.2)
|
18
|
-
actionview (= 6.0.2)
|
19
|
-
activesupport (= 6.0.2)
|
20
|
-
rack (~> 2.0)
|
17
|
+
actionpack (6.0.2.1)
|
18
|
+
actionview (= 6.0.2.1)
|
19
|
+
activesupport (= 6.0.2.1)
|
20
|
+
rack (~> 2.0, >= 2.0.8)
|
21
21
|
rack-test (>= 0.6.3)
|
22
22
|
rails-dom-testing (~> 2.0)
|
23
23
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
24
|
-
actionview (6.0.2)
|
25
|
-
activesupport (= 6.0.2)
|
24
|
+
actionview (6.0.2.1)
|
25
|
+
activesupport (= 6.0.2.1)
|
26
26
|
builder (~> 3.1)
|
27
27
|
erubi (~> 1.4)
|
28
28
|
rails-dom-testing (~> 2.0)
|
29
29
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
30
|
-
activesupport (6.0.2)
|
30
|
+
activesupport (6.0.2.1)
|
31
31
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
32
32
|
i18n (>= 0.7, < 2)
|
33
33
|
minitest (~> 5.1)
|
@@ -39,23 +39,23 @@ GEM
|
|
39
39
|
thor (>= 0.14.0)
|
40
40
|
builder (3.2.4)
|
41
41
|
coderay (1.1.2)
|
42
|
-
concurrent-ruby (1.1.
|
43
|
-
crass (1.0.
|
42
|
+
concurrent-ruby (1.1.6)
|
43
|
+
crass (1.0.6)
|
44
44
|
diff-lcs (1.3)
|
45
45
|
equatable (0.6.1)
|
46
46
|
erubi (1.9.0)
|
47
|
-
i18n (1.
|
47
|
+
i18n (1.8.2)
|
48
48
|
concurrent-ruby (~> 1.0)
|
49
49
|
loofah (2.4.0)
|
50
50
|
crass (~> 1.0.2)
|
51
51
|
nokogiri (>= 1.5.9)
|
52
52
|
method_source (0.9.2)
|
53
53
|
mini_portile2 (2.4.0)
|
54
|
-
minitest (5.
|
54
|
+
minitest (5.14.0)
|
55
55
|
necromancer (0.5.1)
|
56
|
-
nokogiri (1.10.
|
56
|
+
nokogiri (1.10.9)
|
57
57
|
mini_portile2 (~> 2.4.0)
|
58
|
-
pastel (0.7.
|
58
|
+
pastel (0.7.4)
|
59
59
|
equatable (~> 0.6)
|
60
60
|
tty-color (~> 0.5)
|
61
61
|
pry (0.12.2)
|
@@ -63,7 +63,7 @@ GEM
|
|
63
63
|
method_source (~> 0.9.0)
|
64
64
|
pry-rails (0.3.9)
|
65
65
|
pry (>= 0.10.4)
|
66
|
-
rack (2.
|
66
|
+
rack (2.2.2)
|
67
67
|
rack-test (1.1.0)
|
68
68
|
rack (>= 1.0, < 3)
|
69
69
|
rails-dom-testing (2.0.3)
|
@@ -71,9 +71,9 @@ GEM
|
|
71
71
|
nokogiri (>= 1.6)
|
72
72
|
rails-html-sanitizer (1.3.0)
|
73
73
|
loofah (~> 2.3)
|
74
|
-
railties (6.0.2)
|
75
|
-
actionpack (= 6.0.2)
|
76
|
-
activesupport (= 6.0.2)
|
74
|
+
railties (6.0.2.1)
|
75
|
+
actionpack (= 6.0.2.1)
|
76
|
+
activesupport (= 6.0.2.1)
|
77
77
|
method_source
|
78
78
|
rake (>= 0.8.7)
|
79
79
|
thor (>= 0.20.3, < 2.0)
|
@@ -95,10 +95,10 @@ GEM
|
|
95
95
|
rspec-support (3.9.0)
|
96
96
|
thor (1.0.0)
|
97
97
|
thread_safe (0.3.6)
|
98
|
-
tty-color (0.5.
|
98
|
+
tty-color (0.5.1)
|
99
99
|
tty-command (0.8.2)
|
100
100
|
pastel (~> 0.7.0)
|
101
|
-
tty-cursor (0.7.
|
101
|
+
tty-cursor (0.7.1)
|
102
102
|
tty-file (0.7.1)
|
103
103
|
diff-lcs (~> 1.3)
|
104
104
|
pastel (~> 0.7.2)
|
@@ -112,8 +112,8 @@ GEM
|
|
112
112
|
tty-cursor (~> 0.7)
|
113
113
|
tty-screen (~> 0.7)
|
114
114
|
wisper (~> 2.0.0)
|
115
|
-
tty-screen (0.7.
|
116
|
-
tzinfo (1.2.
|
115
|
+
tty-screen (0.7.1)
|
116
|
+
tzinfo (1.2.6)
|
117
117
|
thread_safe (~> 0.1)
|
118
118
|
wisper (2.0.1)
|
119
119
|
zeitwerk (2.2.2)
|
@@ -130,4 +130,4 @@ DEPENDENCIES
|
|
130
130
|
rspec (~> 3.0)
|
131
131
|
|
132
132
|
BUNDLED WITH
|
133
|
-
2.
|
133
|
+
2.1.4
|
@@ -11,7 +11,11 @@ module Railsdock
|
|
11
11
|
OPTIONS_HASH = {
|
12
12
|
database: {
|
13
13
|
name: 'Database',
|
14
|
-
options: %i[postgres mysql]
|
14
|
+
options: %i[postgres mysql],
|
15
|
+
default_port: {
|
16
|
+
postgres: 5432,
|
17
|
+
mysql: 3306
|
18
|
+
}
|
15
19
|
},
|
16
20
|
mem_store: {
|
17
21
|
name: 'In-Memory Store',
|
@@ -49,8 +53,12 @@ module Railsdock
|
|
49
53
|
append_erb_to_compose_file(service)
|
50
54
|
file.inject_into_file('./docker-compose.yml', "\n #{service}:", after: "\nvolumes:")
|
51
55
|
append_service_config_to_env(service)
|
52
|
-
|
56
|
+
if type == :database
|
57
|
+
copy_db_yml("#{BASE_TEMPLATE_DIR}/#{service}/database.yml.erb")
|
58
|
+
inject_db_script_into_entrypoint(service)
|
59
|
+
end
|
53
60
|
end
|
61
|
+
cmd.run('chmod +x ./dev-entrypoint')
|
54
62
|
output.puts POST_INSTALL_MESSAGE
|
55
63
|
end
|
56
64
|
|
@@ -64,6 +72,16 @@ module Railsdock
|
|
64
72
|
file.copy_file(erb_file, './config/database.yml', context: @variables)
|
65
73
|
end
|
66
74
|
|
75
|
+
def inject_db_script_into_entrypoint(service)
|
76
|
+
file.inject_into_file('./dev-entrypoint', after: "echo \"DB is not ready, sleeping...\"\n") do
|
77
|
+
<<~BASH
|
78
|
+
until nc -vz #{service} #{OPTIONS_HASH[:database][:default_port][service]}; do
|
79
|
+
sleep 1
|
80
|
+
done
|
81
|
+
BASH
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
67
85
|
def collect_service_selections
|
68
86
|
prompt.collect do
|
69
87
|
OPTIONS_HASH.each do |key, value|
|
@@ -74,9 +92,9 @@ module Railsdock
|
|
74
92
|
|
75
93
|
def inject_driver_config(service)
|
76
94
|
file.inject_into_file('./docker-compose.yml', after: " node_modules:\n driver: ${VOLUMES_DRIVER}\n") do
|
77
|
-
|
78
|
-
|
79
|
-
|
95
|
+
<<~YAML
|
96
|
+
#{service}:
|
97
|
+
driver: ${VOLUMES_DRIVER}
|
80
98
|
YAML
|
81
99
|
end
|
82
100
|
end
|
@@ -102,6 +120,7 @@ module Railsdock
|
|
102
120
|
file.safe_append_to_file('./docker-compose.yml') do
|
103
121
|
generate_erb("#{BASE_TEMPLATE_DIR}/#{service}/docker-compose.yml.erb")
|
104
122
|
end
|
123
|
+
file.inject_into_file('./docker-compose.yml', " - #{service}\n", after: "depends_on:\n")
|
105
124
|
end
|
106
125
|
|
107
126
|
def append_service_config_to_env(service)
|
@@ -19,9 +19,6 @@ trap unlock_setup HUP INT QUIT KILL TERM EXIT
|
|
19
19
|
|
20
20
|
# 3: Wait for postgres to come up
|
21
21
|
echo "DB is not ready, sleeping..."
|
22
|
-
until nc -vz postgres 5432; do
|
23
|
-
sleep 1
|
24
|
-
done
|
25
22
|
echo "DB is ready, starting Rails."
|
26
23
|
|
27
24
|
# 4: Specify a default command, in case it wasn't issued:
|
data/lib/railsdock/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: railsdock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kyle Boe
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2020-05-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|