roro 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Guardfile +6 -3
- data/lib/roro/cli.rb +0 -1
- data/lib/roro/cli/base/base_files.rb +4 -12
- data/lib/roro/cli/base/configuration.rb +69 -14
- data/lib/roro/cli/base/insertions.rb +1 -1
- data/lib/roro/cli/base/utilities.rb +22 -0
- data/lib/roro/cli/greenfield.rb +14 -72
- data/lib/roro/cli/rollon.rb +21 -11
- data/lib/roro/cli/rollon/rollon_as_dockerize.rb +42 -0
- data/lib/roro/cli/rollon/{as_quickstart.rb → rollon_as_quickstart.rb} +0 -0
- data/lib/roro/cli/rollon/{as_roro.rb → rollon_as_roro.rb} +0 -0
- data/lib/roro/cli/rollon/stories.rb +3 -0
- data/lib/roro/cli/templates/base/.dockerignore +48 -10
- data/lib/roro/cli/templates/base/config/{database.yml → database.yml.pg.tt} +0 -0
- data/lib/roro/cli/templates/base/pg/config/database.yml.pg.tt +20 -0
- data/lib/roro/cli/templates/base/pg/database.yml.pg.tt +20 -0
- data/lib/roro/cli/templates/dockerize/{docker-compose.yml → docker-compose.yml.tt} +0 -0
- data/lib/roro/cli/templates/greenfield/docker-compose.yml.tt +55 -0
- data/lib/roro/version.rb +1 -1
- data/roro-0.3.4.gem +0 -0
- data/roro.gemspec +1 -0
- data/vendor/cache/mocha-1.11.2.gem +0 -0
- metadata +27 -13
- data/lib/roro/cli/rollon/as_dockerize.rb +0 -28
- data/lib/roro/cli/rollon/use_cases.rb +0 -3
- data/lib/roro/cli/templates/greenfield/Gemfile +0 -2
- data/lib/roro/cli/templates/greenfield/config/database.yml.example +0 -16
- data/lib/roro/cli/templates/greenfield/docker-compose.yml +0 -17
- data/lib/roro/cli/templates/greenfield/docker-entrypoint.sh +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1748207f4c1b87ab2301b252cd90eac18dc36107544b404b031e9ba9b0df62f
|
4
|
+
data.tar.gz: eda27e549ca1789b75f5f0af646415b92c8c82f5e3b05dcf612a7d591326c33d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec101f6fba2f50fe296792633d606e3ee2a0680e798c7fef0508706ef37d58dd979f04ea6be7e0fffe044596315aca2933d9ca7416d5694b4f083b18de923182
|
7
|
+
data.tar.gz: 3b89bd8d48d381ef5461deb8b99712cea71a8c2708cc32fdd5c195f931001736598ca48ddbebc0269f09e6c7cbd9e5294e7c7fcb943c1627b8c48e5bdcdae684
|
data/Guardfile
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
# More info at https://github.com/guard/guard#readme
|
3
3
|
|
4
4
|
options = {
|
5
|
-
cli: '',
|
6
|
-
all_after_run: true,
|
7
|
-
all_after_pass: true
|
5
|
+
# cli: '',
|
6
|
+
# all_after_run: true,
|
7
|
+
# all_after_pass: true
|
8
8
|
}
|
9
9
|
|
10
10
|
guard :minitest, options do
|
@@ -12,6 +12,9 @@ guard :minitest, options do
|
|
12
12
|
watch(%r{^test/(.*)\/?test_(.*)\.rb$})
|
13
13
|
watch(%r{^test/(.*)\/?(.*)_test\.rb$})
|
14
14
|
watch(%r{^lib/roro/cli/(.+)\.rb$}) { |m| "test/generators/#{m[1]}_test.rb" }
|
15
|
+
watch(%r{^lib/roro/cli/rollon/*.rb$}) { 'test/generators' }
|
16
|
+
watch(%r{^lib/roro/cli/(.+).rb$}) { 'test' }
|
17
|
+
|
15
18
|
|
16
19
|
watch(%r{^test/thor_helper\.rb$}) { 'test' }
|
17
20
|
|
data/lib/roro/cli.rb
CHANGED
@@ -5,8 +5,7 @@ module Roro
|
|
5
5
|
no_commands do
|
6
6
|
|
7
7
|
def copy_dockerignore
|
8
|
-
copy_file 'base/.dockerignore', '.dockerignore'
|
9
|
-
|
8
|
+
copy_file 'base/.dockerignore', '.dockerignore'
|
10
9
|
end
|
11
10
|
|
12
11
|
def copy_host_example
|
@@ -14,7 +13,7 @@ module Roro
|
|
14
13
|
end
|
15
14
|
|
16
15
|
def copy_docker_compose
|
17
|
-
template "base/docker-compose.yml", 'docker-compose.yml', @env_hash
|
16
|
+
template "base/docker-compose.yml", 'docker-compose.yml', @env_hash
|
18
17
|
end
|
19
18
|
|
20
19
|
def copy_roro
|
@@ -23,15 +22,8 @@ module Roro
|
|
23
22
|
directory 'base/roro/containers/frontend', "roro/containers/#{@env_hash[:frontend_container]}", @env_hash
|
24
23
|
end
|
25
24
|
|
26
|
-
def
|
27
|
-
copy_file "base/config/database.yml", 'config/database.yml', @env_hash[:use_force]
|
28
|
-
end
|
29
|
-
|
30
|
-
def copy_base_files
|
31
|
-
copy_circleci
|
32
|
-
copy_roro
|
33
|
-
copy_docker_compose
|
34
|
-
copy_config_database_yml
|
25
|
+
def copy_database_yml_pg
|
26
|
+
copy_file "base/config/database.yml.pg", 'config/database.yml', force: @env_hash[:use_force]
|
35
27
|
end
|
36
28
|
end
|
37
29
|
end
|
@@ -5,8 +5,9 @@ module Roro
|
|
5
5
|
|
6
6
|
no_commands do
|
7
7
|
|
8
|
-
def get_configuration_variables
|
8
|
+
def get_configuration_variables(hash={})
|
9
9
|
options["interactive"] ? set_interactively : set_from_defaults
|
10
|
+
hash.each { |k,v| @env_hash[k] = v } unless hash.nil?
|
10
11
|
@env_hash[:deploy_tag] = "${CIRCLE_SHA1:0:7}"
|
11
12
|
@env_hash[:server_port] = "22"
|
12
13
|
@env_hash[:server_user] = "root"
|
@@ -27,36 +28,90 @@ module Roro
|
|
27
28
|
answer = ask("Please provide #{prompt.keys.first} or hit enter to accept: \[ #{prompt.values.first} \]")
|
28
29
|
@env_hash[key] = (answer == "") ? prompt.values.first : answer
|
29
30
|
end
|
30
|
-
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def confirm_dependencies
|
34
|
+
dependencies = [
|
35
|
+
{
|
36
|
+
system_query: "which docker",
|
37
|
+
warning: "Docker isn't installed",
|
38
|
+
suggestion: "https://docs.docker.com/install/"
|
39
|
+
}, {
|
40
|
+
system_query: "which docker-compose",
|
41
|
+
warning: "Docker Compose isn't installed",
|
42
|
+
suggestion: "https://docs.docker.com/compose/install/"
|
43
|
+
|
44
|
+
}, {
|
45
|
+
system_query: "docker info",
|
46
|
+
warning: "the Docker daemon isn't running",
|
47
|
+
suggestion: "https://docs.docker.com/config/daemon/#start-the-daemon-manually"
|
48
|
+
}
|
49
|
+
]
|
50
|
+
|
51
|
+
dependencies.each do |dependency|
|
52
|
+
confirm_dependency(dependency)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
def confirm_dependency(options)
|
59
|
+
msg = []
|
60
|
+
msg << ""
|
61
|
+
msg << delineator
|
62
|
+
msg << "It looks like #{options[:warning]}. The following bash command returns false:"
|
63
|
+
msg << "\t$ #{options[:system_query]}"
|
64
|
+
msg << "Please try these instructions:"
|
65
|
+
msg << ("\t" + options[:suggestion])
|
66
|
+
msg << delineator
|
67
|
+
conditional = options[:conditional] ? eval(options[:conditional]) : system(options[:system_query])
|
68
|
+
if conditional == false
|
69
|
+
raise(Roro::Error.new(msg.join("\n\n")))
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
31
73
|
|
32
74
|
private
|
33
75
|
|
34
76
|
def configuration_hash
|
35
77
|
{
|
36
78
|
app_name: {
|
37
|
-
"the name of your app" => `pwd`.split('/').last.strip!
|
79
|
+
"the name of your app" => `pwd`.split('/').last.strip!
|
80
|
+
},
|
38
81
|
ruby_version: {
|
39
|
-
"the version of ruby you'd like" => `ruby -v`.scan(/\d.\d/).first
|
82
|
+
"the version of ruby you'd like" => `ruby -v`.scan(/\d.\d/).first
|
83
|
+
},
|
40
84
|
server_host: {
|
41
|
-
"the ip address of your server" => "ip-address-of-your-server"
|
85
|
+
"the ip address of your server" => "ip-address-of-your-server"
|
86
|
+
},
|
42
87
|
database_container: {
|
43
|
-
"the name of your database container" => "database"
|
88
|
+
"the name of your database container" => "database"
|
89
|
+
},
|
44
90
|
frontend_container: {
|
45
|
-
"the name of your frontend container" => "frontend"
|
91
|
+
"the name of your frontend container" => "frontend"
|
92
|
+
},
|
46
93
|
server_container: {
|
47
|
-
"the name of your server container" => "nginx"
|
94
|
+
"the name of your server container" => "nginx"
|
95
|
+
},
|
48
96
|
dockerhub_email: {
|
49
|
-
"your Docker Hub email" => "your-docker-hub-email"
|
97
|
+
"your Docker Hub email" => "your-docker-hub-email"
|
98
|
+
},
|
50
99
|
dockerhub_user: {
|
51
|
-
"your Docker Hub username" => "your-docker-hub-user-name"
|
100
|
+
"your Docker Hub username" => "your-docker-hub-user-name"
|
101
|
+
},
|
52
102
|
dockerhub_org: {
|
53
|
-
"your Docker Hub organization name" => "your-docker-hub-org-name"
|
103
|
+
"your Docker Hub organization name" => "your-docker-hub-org-name"
|
104
|
+
},
|
54
105
|
dockerhub_password: {
|
55
|
-
"your Docker Hub password" => "your-docker-hub-password"
|
106
|
+
"your Docker Hub password" => "your-docker-hub-password"
|
107
|
+
},
|
56
108
|
postgres_user: {
|
57
|
-
"your Postgres username" => "postgres"
|
109
|
+
"your Postgres username" => "postgres"
|
110
|
+
},
|
58
111
|
postgres_password: {
|
59
|
-
"your Postgres password" => "your-postgres-password"
|
112
|
+
"your Postgres password" => "your-postgres-password"
|
113
|
+
}
|
114
|
+
}
|
60
115
|
end
|
61
116
|
end
|
62
117
|
end
|
@@ -6,7 +6,7 @@ module Roro
|
|
6
6
|
no_commands do
|
7
7
|
|
8
8
|
def config_std_out_true
|
9
|
-
prepend_to_file('config/boot.rb', "$stdout.sync = true\n\n", @env_hash[:use_force])
|
9
|
+
prepend_to_file('config/boot.rb', "$stdout.sync = true\n\n", force: @env_hash[:use_force])
|
10
10
|
end
|
11
11
|
|
12
12
|
def gitignore_sensitive_files
|
@@ -12,6 +12,28 @@ module Roro
|
|
12
12
|
def own_if_required
|
13
13
|
system 'sudo chown -R $USER .'
|
14
14
|
end
|
15
|
+
|
16
|
+
def as_system(command)
|
17
|
+
command = OS.linux? ? "sudo #{command}" : command
|
18
|
+
system command
|
19
|
+
end
|
20
|
+
|
21
|
+
def chown_if_required()
|
22
|
+
warning = "It looks like you're running Docker on some flavor of Linux, in which case the files created by your containers are owned by the root user of the container, and not by the user of the host machine. Please change their ownership by supplying your password at the prompt.",
|
23
|
+
action = "system 'sudo chown -R $USER .'"
|
24
|
+
msg = []
|
25
|
+
msg << ""
|
26
|
+
msg << delineator
|
27
|
+
msg << warning
|
28
|
+
msg << ""
|
29
|
+
msg.join("\n\n")
|
30
|
+
puts msg
|
31
|
+
eval(action)
|
32
|
+
end
|
33
|
+
|
34
|
+
def delineator
|
35
|
+
("-" * 80)
|
36
|
+
end
|
15
37
|
end
|
16
38
|
end
|
17
39
|
end
|
data/lib/roro/cli/greenfield.rb
CHANGED
@@ -14,86 +14,28 @@ module Roro
|
|
14
14
|
|
15
15
|
|
16
16
|
def greenfield
|
17
|
+
confirm_dependencies
|
18
|
+
confirm_dependency({
|
19
|
+
system_query: "ls -A",
|
20
|
+
warning: "this is not an empty directory. Roro will not greenfield a new Rails app unless either a) the current directory is empty or b) you run greenfield with the --force flag",
|
21
|
+
suggestion: "$ roro greenfield --force",
|
22
|
+
conditional: "Dir.glob('*').empty?" })
|
17
23
|
get_configuration_variables
|
24
|
+
copy_greenfield_files
|
25
|
+
copy_greenfield_to_host
|
18
26
|
@env_hash[:use_force] = { force: true }
|
19
|
-
|
20
|
-
system "DOCKER_BUILDKIT=1 docker build --file Dockerfile --output . ."
|
21
|
-
rollon_as_dockerized
|
27
|
+
rollon
|
22
28
|
end
|
23
29
|
|
24
30
|
no_commands do
|
25
|
-
|
31
|
+
|
26
32
|
def copy_greenfield_files
|
27
33
|
template 'greenfield/Dockerfile.tt', 'Dockerfile', @env_hash
|
28
|
-
template 'greenfield/docker-compose.yml', 'docker-compose.yml'
|
29
|
-
copy_file 'greenfield/Gemfile', 'Gemfile'
|
30
|
-
copy_file 'greenfield/Gemfile.lock', 'Gemfile.lock'
|
31
|
-
end
|
32
|
-
|
33
|
-
def as_system(command)
|
34
|
-
command = OS.linux? ? "sudo #{command}" : command
|
35
|
-
system command
|
36
|
-
end
|
37
|
-
|
38
|
-
def chown_if_required()
|
39
|
-
warning = "It looks like you're running Docker on some flavor of Linux, in which case the files created by your containers are owned by the root user of the container, and not by the user of the host machine. Please change their ownership by supplying your password at the prompt.",
|
40
|
-
action = "system 'sudo chown -R $USER .'"
|
41
|
-
msg = []
|
42
|
-
msg << ""
|
43
|
-
msg << delineator
|
44
|
-
msg << warning
|
45
|
-
msg << ""
|
46
|
-
msg.join("\n\n")
|
47
|
-
puts msg
|
48
|
-
eval(action)
|
49
|
-
end
|
50
|
-
|
51
|
-
def delineator
|
52
|
-
("-" * 80)
|
34
|
+
template 'greenfield/docker-compose.yml.tt', 'docker-compose.yml', @env_hash
|
53
35
|
end
|
54
|
-
|
55
|
-
def
|
56
|
-
|
57
|
-
msg << ""
|
58
|
-
msg << delineator
|
59
|
-
msg << "It looks like #{options[:warning]}. The following bash command returns false:"
|
60
|
-
msg << "\t$ #{options[:system_query]}"
|
61
|
-
msg << "Please try these instructions:"
|
62
|
-
msg << ("\t" + options[:suggestion])
|
63
|
-
msg << delineator
|
64
|
-
conditional = options[:conditional] ? eval(options[:conditional]) : system(options[:system_query])
|
65
|
-
if conditional == false
|
66
|
-
raise(Roro::Error.new(msg.join("\n\n")))
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
def confirm_dependencies
|
71
|
-
dependencies = [
|
72
|
-
{
|
73
|
-
system_query: "ls -A",
|
74
|
-
warning: "this is not an empty directory. Roro will not greenfield a new Rails app unless either a) the current directory is empty or b) you run greenfield with the --force flag",
|
75
|
-
suggestion: "$ roro greenfield --force",
|
76
|
-
conditional: "Dir.glob('*').empty?"
|
77
|
-
}, {
|
78
|
-
|
79
|
-
system_query: "which docker",
|
80
|
-
warning: "Docker isn't installed",
|
81
|
-
suggestion: "https://docs.docker.com/install/"
|
82
|
-
}, {
|
83
|
-
system_query: "which docker-compose",
|
84
|
-
warning: "Docker Compose isn't installed",
|
85
|
-
suggestion: "https://docs.docker.com/compose/install/"
|
86
|
-
|
87
|
-
}, {
|
88
|
-
system_query: "docker info",
|
89
|
-
warning: "the Docker daemon isn't running",
|
90
|
-
suggestion: "https://docs.docker.com/config/daemon/#start-the-daemon-manually"
|
91
|
-
}
|
92
|
-
]
|
93
|
-
|
94
|
-
dependencies.each do |dependency|
|
95
|
-
confirm_dependency(dependency)
|
96
|
-
end
|
36
|
+
|
37
|
+
def copy_greenfield_to_host
|
38
|
+
system "DOCKER_BUILDKIT=1 docker build --file Dockerfile --output . ."
|
97
39
|
end
|
98
40
|
end
|
99
41
|
end
|
data/lib/roro/cli/rollon.rb
CHANGED
@@ -1,20 +1,26 @@
|
|
1
|
-
require_relative 'rollon/
|
1
|
+
require_relative 'rollon/stories'
|
2
2
|
|
3
3
|
module Roro
|
4
4
|
|
5
5
|
class CLI < Thor
|
6
6
|
|
7
|
-
desc "rollon", "Generates files and makes changes to your rails app
|
8
|
-
|
9
|
-
method_option :interactive, desc: "Set up your environment variables as
|
7
|
+
desc "rollon", "Generates files and makes changes to your rails app
|
8
|
+
necessary to run it using Docker containers."
|
9
|
+
method_option :interactive, desc: "Set up your environment variables as
|
10
|
+
you go."
|
10
11
|
|
11
12
|
def rollon
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
confirm_dependencies
|
14
|
+
confirm_dependency({
|
15
|
+
system_query: "ls -A",
|
16
|
+
warning: "This is an empty directory. You can generate a new and fully
|
17
|
+
dockerized Rails app using the 'greenfield' command here here but if
|
18
|
+
you want to containerize an existing app -- which is what the 'rollon'
|
19
|
+
command is for -- you'll need to navigate to a directory with an app we
|
20
|
+
can roll onto.",
|
21
|
+
suggestion: "$ roro greenfield",
|
22
|
+
conditional: "!Dir.glob('*').empty?" })
|
23
|
+
@env_hash || get_configuration_variables
|
18
24
|
# case ask("Configure using the Quickstart, Curated, or HandsomeFencer way?\n\n(1) Quikstart\n\n(2) Curated\n\n(3) HandsomeFencer\n\n", { default: '2', limited_to: %w(1 2 3) })
|
19
25
|
# when '1'
|
20
26
|
# rollon_as_quickstart
|
@@ -22,7 +28,11 @@ module Roro
|
|
22
28
|
# rollon_as_dockerized
|
23
29
|
# when '3'
|
24
30
|
# end
|
25
|
-
|
31
|
+
rollon_as_dockerize
|
32
|
+
end
|
33
|
+
|
34
|
+
no_commands do
|
35
|
+
|
26
36
|
end
|
27
37
|
end
|
28
38
|
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module Roro
|
2
|
+
|
3
|
+
class CLI < Thor
|
4
|
+
|
5
|
+
no_commands do
|
6
|
+
|
7
|
+
def rollon_as_dockerize
|
8
|
+
rollon_dockerize_files
|
9
|
+
system 'docker-compose build'
|
10
|
+
system 'docker-compose run --no-deps web bin/rails webpacker:install'
|
11
|
+
system 'docker-compose up'
|
12
|
+
end
|
13
|
+
|
14
|
+
def
|
15
|
+
|
16
|
+
def configure_for_pg
|
17
|
+
service = [
|
18
|
+
" database:",
|
19
|
+
" image: postgres",
|
20
|
+
" env_file:",
|
21
|
+
" - .env/development/database",
|
22
|
+
" volumes:",
|
23
|
+
" - db_data:var/lib/postgresql/data"
|
24
|
+
].join("\n")
|
25
|
+
|
26
|
+
@env_hash[:database_service] = service
|
27
|
+
end
|
28
|
+
|
29
|
+
def rollon_dockerize_files
|
30
|
+
directory 'dockerize', '.', @env_hash
|
31
|
+
copy_dockerignore
|
32
|
+
if ask('Configure $stdout.sync for docker?', choices).eql?('y')
|
33
|
+
config_std_out_true
|
34
|
+
end
|
35
|
+
if ask('Configure your app to use Postgresql?', choices).eql?('y')
|
36
|
+
copy_database_yml_pg
|
37
|
+
insert_pg_gem_into_gemfile
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
File without changes
|
File without changes
|
@@ -1,13 +1,51 @@
|
|
1
|
-
|
2
|
-
.
|
3
|
-
.
|
1
|
+
.git
|
2
|
+
.gitignore
|
3
|
+
README.md
|
4
4
|
|
5
|
-
#
|
6
|
-
|
5
|
+
#
|
6
|
+
# OS X
|
7
|
+
#
|
8
|
+
.DS_Store
|
9
|
+
.AppleDouble
|
10
|
+
.LSOverride
|
11
|
+
# Icon must end with two \r
|
12
|
+
Icon
|
13
|
+
# Thumbnails
|
14
|
+
._*
|
15
|
+
# Files that might appear on external disk
|
16
|
+
.Spotlight-V100
|
17
|
+
.Trashes
|
18
|
+
# Directories potentially created on remote AFP share
|
19
|
+
.AppleDB
|
20
|
+
.AppleDesktop
|
21
|
+
Network Trash Folder
|
22
|
+
Temporary Items
|
23
|
+
.apdisk
|
7
24
|
|
8
|
-
#
|
9
|
-
|
25
|
+
#
|
26
|
+
# Rails
|
27
|
+
#
|
28
|
+
.env
|
29
|
+
.env.sample
|
30
|
+
*.rbc
|
31
|
+
capybara-*.html
|
32
|
+
log
|
33
|
+
tmp
|
34
|
+
db/*.sqlite3
|
35
|
+
db/*.sqlite3-journal
|
36
|
+
public/system
|
37
|
+
coverage/
|
38
|
+
spec/tmp
|
39
|
+
**.orig
|
10
40
|
|
11
|
-
|
12
|
-
|
13
|
-
|
41
|
+
.bundle
|
42
|
+
|
43
|
+
.ruby-version
|
44
|
+
.ruby-gemset
|
45
|
+
|
46
|
+
.rvmrc
|
47
|
+
|
48
|
+
# if using bower-rails ignore default bower_components path bower.json files
|
49
|
+
vendor/assets/bower_components
|
50
|
+
*.bowerrc
|
51
|
+
bower.json
|
File without changes
|
@@ -0,0 +1,20 @@
|
|
1
|
+
default: &default
|
2
|
+
adapter: postgresql
|
3
|
+
encoding: unicode
|
4
|
+
host: <%= ENV.fetch('DATABASE_HOST') %>
|
5
|
+
username: <%= ENV.fetch('POSTGRES_USER') %>
|
6
|
+
password: <%= ENV.fetch('POSTGRES_PASSWORD') %>
|
7
|
+
database: <%= ENV.fetch('POSTGRES_DB') %>
|
8
|
+
pool: 5
|
9
|
+
variables:
|
10
|
+
statement_timeout: 5000
|
11
|
+
|
12
|
+
development:
|
13
|
+
<<: *default
|
14
|
+
|
15
|
+
test:
|
16
|
+
<<: *default
|
17
|
+
|
18
|
+
|
19
|
+
production:
|
20
|
+
<<: *default
|
@@ -0,0 +1,20 @@
|
|
1
|
+
default: &default
|
2
|
+
adapter: postgresql
|
3
|
+
encoding: unicode
|
4
|
+
host: <%= ENV.fetch('DATABASE_HOST') %>
|
5
|
+
username: <%= ENV.fetch('POSTGRES_USER') %>
|
6
|
+
password: <%= ENV.fetch('POSTGRES_PASSWORD') %>
|
7
|
+
database: <%= ENV.fetch('POSTGRES_DB') %>
|
8
|
+
pool: 5
|
9
|
+
variables:
|
10
|
+
statement_timeout: 5000
|
11
|
+
|
12
|
+
development:
|
13
|
+
<<: *default
|
14
|
+
|
15
|
+
test:
|
16
|
+
<<: *default
|
17
|
+
|
18
|
+
|
19
|
+
production:
|
20
|
+
<<: *default
|
File without changes
|
@@ -0,0 +1,55 @@
|
|
1
|
+
version: '3'
|
2
|
+
|
3
|
+
services:
|
4
|
+
|
5
|
+
web:
|
6
|
+
build: .
|
7
|
+
depends_on:
|
8
|
+
- database
|
9
|
+
- webpack_dev_server
|
10
|
+
- redis
|
11
|
+
# entrypoint: ./docker-entrypoint.sh
|
12
|
+
command: ["bin/rails", "s", "-b", "0.0.0.0"]
|
13
|
+
|
14
|
+
ports:
|
15
|
+
- "3000:3000"
|
16
|
+
- "4000:4000"
|
17
|
+
volumes:
|
18
|
+
- .:/usr/src/app
|
19
|
+
- gem_cache:/gems
|
20
|
+
env_file:
|
21
|
+
- .env/development/web
|
22
|
+
- .env/development/database
|
23
|
+
environment:
|
24
|
+
- WEBPACKER_DEV_SERVER_HOST=webpack_dev_server
|
25
|
+
|
26
|
+
webpack_dev_server:
|
27
|
+
build: .
|
28
|
+
command: ./bin/webpack-dev-server
|
29
|
+
ports:
|
30
|
+
- 3035:3035
|
31
|
+
volumes:
|
32
|
+
- .:/usr/src/app
|
33
|
+
- gem_cache:/gems
|
34
|
+
env_file:
|
35
|
+
- .env/development/database
|
36
|
+
- .env/development/web
|
37
|
+
environment:
|
38
|
+
- WEBPACKER_DEV_SERVER_HOST=0.0.0.0
|
39
|
+
|
40
|
+
redis:
|
41
|
+
image: redis
|
42
|
+
|
43
|
+
<%= config[:database_service] %>
|
44
|
+
|
45
|
+
system_tests:
|
46
|
+
image: selenium/standalone-chrome-debug
|
47
|
+
logging:
|
48
|
+
driver: none
|
49
|
+
ports:
|
50
|
+
- "35729:35729"
|
51
|
+
- "5900:5900"
|
52
|
+
|
53
|
+
volumes:
|
54
|
+
db_data:
|
55
|
+
gem_cache:
|
data/lib/roro/version.rb
CHANGED
data/roro-0.3.4.gem
ADDED
Binary file
|
data/roro.gemspec
CHANGED
@@ -45,6 +45,7 @@ Gem::Specification.new do |spec|
|
|
45
45
|
spec.add_development_dependency "bundler"
|
46
46
|
spec.add_development_dependency "rake", ">= 12.3"
|
47
47
|
spec.add_development_dependency "handsome_fencer-test", "0.1.1"
|
48
|
+
spec.add_development_dependency "mocha"
|
48
49
|
spec.add_development_dependency "byebug"
|
49
50
|
|
50
51
|
end
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- schadenfred
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-08-
|
11
|
+
date: 2020-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - '='
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 0.1.1
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: mocha
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: byebug
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -159,17 +173,19 @@ files:
|
|
159
173
|
- lib/roro/cli/greenfield.rb
|
160
174
|
- lib/roro/cli/obfuscate.rb
|
161
175
|
- lib/roro/cli/rollon.rb
|
162
|
-
- lib/roro/cli/rollon/
|
163
|
-
- lib/roro/cli/rollon/
|
164
|
-
- lib/roro/cli/rollon/
|
165
|
-
- lib/roro/cli/rollon/
|
176
|
+
- lib/roro/cli/rollon/rollon_as_dockerize.rb
|
177
|
+
- lib/roro/cli/rollon/rollon_as_quickstart.rb
|
178
|
+
- lib/roro/cli/rollon/rollon_as_roro.rb
|
179
|
+
- lib/roro/cli/rollon/stories.rb
|
166
180
|
- lib/roro/cli/ruby_gem.rb
|
167
181
|
- lib/roro/cli/templates/base/.dockerignore
|
168
182
|
- lib/roro/cli/templates/base/.keep
|
169
183
|
- lib/roro/cli/templates/base/circleci/config.yml.tt
|
170
|
-
- lib/roro/cli/templates/base/config/database.yml
|
184
|
+
- lib/roro/cli/templates/base/config/database.yml.pg.tt
|
171
185
|
- lib/roro/cli/templates/base/docker-compose.yml.tt
|
172
186
|
- lib/roro/cli/templates/base/livereload/hosts.example
|
187
|
+
- lib/roro/cli/templates/base/pg/config/database.yml.pg.tt
|
188
|
+
- lib/roro/cli/templates/base/pg/database.yml.pg.tt
|
173
189
|
- lib/roro/cli/templates/base/roro/.keep
|
174
190
|
- lib/roro/cli/templates/base/roro/containers/.keep
|
175
191
|
- lib/roro/cli/templates/base/roro/containers/app/.keep
|
@@ -186,14 +202,10 @@ files:
|
|
186
202
|
- lib/roro/cli/templates/dockerize/.env/development/web
|
187
203
|
- lib/roro/cli/templates/dockerize/.keep
|
188
204
|
- lib/roro/cli/templates/dockerize/Dockerfile.tt
|
189
|
-
- lib/roro/cli/templates/dockerize/docker-compose.yml
|
205
|
+
- lib/roro/cli/templates/dockerize/docker-compose.yml.tt
|
190
206
|
- lib/roro/cli/templates/dockerize/docker-entrypoint.sh
|
191
207
|
- lib/roro/cli/templates/greenfield/Dockerfile.tt
|
192
|
-
- lib/roro/cli/templates/greenfield/
|
193
|
-
- lib/roro/cli/templates/greenfield/Gemfile.lock
|
194
|
-
- lib/roro/cli/templates/greenfield/config/database.yml.example
|
195
|
-
- lib/roro/cli/templates/greenfield/docker-compose.yml
|
196
|
-
- lib/roro/cli/templates/greenfield/docker-entrypoint.sh
|
208
|
+
- lib/roro/cli/templates/greenfield/docker-compose.yml.tt
|
197
209
|
- lib/roro/cli/templates/jumpstart/.env/.keep
|
198
210
|
- lib/roro/cli/templates/jumpstart/.env/development/.keep
|
199
211
|
- lib/roro/cli/templates/jumpstart/.env/development/database
|
@@ -215,6 +227,7 @@ files:
|
|
215
227
|
- lib/roro/cli/templates/ruby_gem/setup-gem-credentials.sh
|
216
228
|
- lib/roro/version.rb
|
217
229
|
- lib/tasks/deploy.rake
|
230
|
+
- roro-0.3.4.gem
|
218
231
|
- roro.gemspec
|
219
232
|
- vendor/bundle/.keep
|
220
233
|
- vendor/cache/actionpack-6.0.3.2.gem
|
@@ -250,6 +263,7 @@ files:
|
|
250
263
|
- vendor/cache/minitest-given-3.8.0.gem
|
251
264
|
- vendor/cache/minitest-matchers_vaccine-1.0.4.gem
|
252
265
|
- vendor/cache/minitest-rails-6.0.1.gem
|
266
|
+
- vendor/cache/mocha-1.11.2.gem
|
253
267
|
- vendor/cache/multi_json-1.15.0.gem
|
254
268
|
- vendor/cache/nenv-0.3.0.gem
|
255
269
|
- vendor/cache/net-scp-3.0.0.gem
|
@@ -1,28 +0,0 @@
|
|
1
|
-
module Roro
|
2
|
-
|
3
|
-
class CLI < Thor
|
4
|
-
|
5
|
-
no_commands do
|
6
|
-
|
7
|
-
def rollon_as_dockerized
|
8
|
-
copy_dockerignore
|
9
|
-
if @env_hash[:use_force][:force]
|
10
|
-
config_std_out_true
|
11
|
-
else
|
12
|
-
if ask('Configure $stdout.sync for docker?', choices).eql?('y')
|
13
|
-
end
|
14
|
-
end
|
15
|
-
copy_config_database_yml
|
16
|
-
insert_pg_gem_into_gemfile
|
17
|
-
copy_file 'dockerize/docker-compose.yml', 'docker-compose.yml'
|
18
|
-
template "dockerize/Dockerfile", 'Dockerfile', @env_hash
|
19
|
-
copy_file 'dockerize/docker-entrypoint.sh', 'docker-entrypoint.sh'
|
20
|
-
directory 'dockerize/.env', '.env'
|
21
|
-
system 'docker-compose build'
|
22
|
-
system 'docker-compose run --no-deps web bin/rails webpacker:install'
|
23
|
-
system 'docker-compose up'
|
24
|
-
copy_host_example
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|