roro 0.3.4 → 0.3.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/.gitignore +15 -2
- data/Guardfile +3 -6
- data/lib/roro.rb +1 -1
- data/lib/roro/cli.rb +75 -6
- data/lib/roro/cli/base/base.rb +2 -1
- data/lib/roro/cli/base/base_files.rb +4 -18
- data/lib/roro/cli/base/check_dependencies.rb +98 -0
- data/lib/roro/cli/base/insert_gems.rb +15 -7
- data/lib/roro/cli/base/insertions.rb +3 -1
- data/lib/roro/cli/base/utilities.rb +22 -0
- data/lib/roro/cli/cli.rb +99 -0
- data/lib/roro/cli/configuration.rb +69 -0
- data/lib/roro/cli/expose.rb +8 -7
- data/lib/roro/cli/generate/config.rb +13 -0
- data/lib/roro/cli/generate/config/rails.rb +17 -0
- data/lib/roro/cli/generate/generate.rb +1 -0
- data/lib/roro/cli/generate/generate_keys.rb +47 -0
- data/lib/roro/cli/greenfield.rb +22 -91
- data/lib/roro/cli/obfuscate.rb +10 -11
- data/lib/roro/cli/rollon.rb +74 -18
- data/lib/roro/cli/rollon/stories.rb +2 -0
- data/{.keep → lib/roro/cli/rollon/stories/database.rb} +0 -0
- data/lib/roro/cli/rollon/stories/rails.rb +1 -0
- data/lib/roro/cli/{templates/base/roro → rollon/stories/rails}/.keep +0 -0
- data/lib/roro/cli/rollon/stories/rails/database.rb +33 -0
- data/lib/roro/cli/rollon/stories/rails/database/with_mysql.rb +22 -0
- data/lib/roro/cli/rollon/stories/rails/database/with_postgresql.rb +21 -0
- data/lib/roro/cli/rollon/stories/ruby_gem.rb +77 -0
- data/lib/roro/cli/rollon/stories/ruby_gem/with_ci_cd.rb +81 -0
- data/lib/roro/cli/rollon/stories/stories.rb +3 -0
- data/lib/roro/cli/roro_configurator.yml +157 -0
- data/lib/roro/cli/ruby_gem.rb +60 -47
- data/lib/roro/cli/templates/base/.dockerignore +48 -10
- data/lib/roro/cli/templates/base/.roro_config.yml +15 -0
- data/lib/roro/cli/templates/base/Dockerfile.tt +82 -0
- data/lib/roro/cli/templates/base/config/database.mysql.yml +19 -0
- data/lib/roro/cli/templates/base/config/{database.yml → database.pg.yml} +0 -0
- data/lib/roro/cli/templates/greenfield/Dockerfile.tt +29 -7
- data/lib/roro/cli/templates/{base/livereload → livereload}/hosts.example +0 -0
- data/lib/roro/cli/templates/{base/roro/containers → roro}/.keep +0 -0
- data/lib/roro/cli/templates/{dockerize/docker-compose.yml → roro/docker-compose.yml.tt} +18 -18
- data/lib/roro/cli/templates/{base/roro/containers/app → roro/roro}/.keep +0 -0
- data/lib/roro/cli/templates/{base/roro/containers/frontend → roro/roro/containers}/.keep +0 -0
- data/lib/roro/cli/templates/{dockerize/.env → roro/roro/containers/app}/.keep +0 -0
- data/lib/roro/cli/templates/{dockerize/.env/development → roro/roro/containers/frontend}/.keep +0 -0
- data/lib/roro/cli/templates/{quickstart/entrypoint.sh → roro/roro/docker-entrypoint.sh.tt} +1 -1
- data/lib/roro/cli/templates/ruby_gem/.circleci/config.yml +17 -0
- data/lib/roro/cli/templates/ruby_gem/docker-compose.yml +6 -4
- data/lib/roro/cli/templates/ruby_gem/roro/ci.env.tt +1 -0
- data/lib/roro/cli/templates/{dockerize → ruby_gem/roro/containers}/.keep +0 -0
- data/lib/roro/cli/templates/ruby_gem/roro/containers/ruby_image/Dockerfile.tt +16 -0
- data/lib/roro/cli/templates/ruby_gem/{docker/env_files → roro/keys}/.keep +0 -0
- data/lib/roro/cli/templates/{ruby_gem/docker/keys → stories}/.keep +0 -0
- data/lib/roro/cli/templates/stories/with_mysql/_service.yml +10 -0
- data/lib/roro/cli/templates/stories/with_postgresql/.keep +0 -0
- data/lib/roro/cli/templates/stories/with_postgresql/_service.yml +7 -0
- data/lib/roro/version.rb +1 -1
- data/roro.gemspec +5 -4
- data/sandbox/.keep +0 -0
- data/vendor/cache/concurrent-ruby-1.1.7.gem +0 -0
- data/vendor/cache/gem-release-2.1.1.gem +0 -0
- data/vendor/cache/mocha-1.11.2.gem +0 -0
- metadata +86 -55
- data/lib/roro/cli/base/configuration.rb +0 -63
- data/lib/roro/cli/generate_keys.rb +0 -79
- data/lib/roro/cli/rollon/as_dockerize.rb +0 -28
- data/lib/roro/cli/rollon/as_quickstart.rb +0 -17
- data/lib/roro/cli/rollon/as_roro.rb +0 -30
- data/lib/roro/cli/rollon/use_cases.rb +0 -3
- data/lib/roro/cli/templates/base/circleci/config.yml.tt +0 -70
- data/lib/roro/cli/templates/base/docker-compose.yml.tt +0 -53
- data/lib/roro/cli/templates/base/roro/containers/app/Dockerfile.tt +0 -32
- data/lib/roro/cli/templates/base/roro/containers/app/development.env.tt +0 -1
- data/lib/roro/cli/templates/base/roro/containers/app/docker-entrypoint.sh +0 -8
- data/lib/roro/cli/templates/base/roro/containers/app/test.env.tt +0 -1
- data/lib/roro/cli/templates/base/roro/containers/database/development.env.tt +0 -4
- data/lib/roro/cli/templates/base/roro/containers/database/test.env.tt +0 -4
- data/lib/roro/cli/templates/dockerize/.env/development/database +0 -3
- data/lib/roro/cli/templates/dockerize/.env/development/web +0 -1
- data/lib/roro/cli/templates/dockerize/Dockerfile.tt +0 -23
- data/lib/roro/cli/templates/dockerize/docker-entrypoint.sh +0 -9
- 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
- data/lib/roro/cli/templates/quickstart/Dockerfile.tt +0 -20
- data/lib/roro/cli/templates/quickstart/database.yml +0 -85
- data/lib/roro/cli/templates/quickstart/docker-compose.yml +0 -17
- data/lib/roro/cli/templates/ruby_gem/.gitignore +0 -8
- data/lib/roro/cli/templates/ruby_gem/config.yml +0 -122
- data/lib/roro/cli/templates/ruby_gem/docker/containers/app/Dockerfile.tt +0 -10
- data/vendor/cache/concurrent-ruby-1.1.6.gem +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module Roro
|
|
2
|
+
|
|
3
|
+
class CLI < Thor
|
|
4
|
+
|
|
5
|
+
no_commands do
|
|
6
|
+
|
|
7
|
+
def configure_for_mysql
|
|
8
|
+
insert_db_gem('mysql2')
|
|
9
|
+
copy_file 'base/config/database.mysql.yml', 'config/database.yml', force: true
|
|
10
|
+
config = @config.app.clone
|
|
11
|
+
|
|
12
|
+
%w(development production test staging ci).each do |environment|
|
|
13
|
+
config['rails_env'] = environment
|
|
14
|
+
|
|
15
|
+
source = 'base/.env/database.mysql.env.tt'
|
|
16
|
+
target = "roro/containers/database/#{environment}.env"
|
|
17
|
+
template( source, target, config )
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module Roro
|
|
2
|
+
|
|
3
|
+
class CLI < Thor
|
|
4
|
+
|
|
5
|
+
no_commands do
|
|
6
|
+
|
|
7
|
+
def configure_for_pg
|
|
8
|
+
insert_db_gem('pg')
|
|
9
|
+
copy_file 'base/config/database.pg.yml', 'config/database.yml', force: true
|
|
10
|
+
config = @config.app.clone
|
|
11
|
+
%w(development production test staging ci).each do |environment|
|
|
12
|
+
config['rails_env'] = environment
|
|
13
|
+
|
|
14
|
+
source = 'base/.env/database.pg.env.tt'
|
|
15
|
+
target = "roro/containers/database/#{environment}.env"
|
|
16
|
+
template( source, target, config )
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
require 'roro/cli/rollon/stories/ruby_gem/with_ci_cd.rb'
|
|
2
|
+
# class RubyGem
|
|
3
|
+
# attr_reader :getsome
|
|
4
|
+
|
|
5
|
+
# def initialize
|
|
6
|
+
# @getsome = 'getsome'
|
|
7
|
+
# end
|
|
8
|
+
# end
|
|
9
|
+
|
|
10
|
+
# include Stories::RubyGem
|
|
11
|
+
# module Rollon
|
|
12
|
+
# module Story
|
|
13
|
+
|
|
14
|
+
# end
|
|
15
|
+
# end
|
|
16
|
+
# class Rollon::Story::RubyGem < Roro::CLI
|
|
17
|
+
# attr_reader :getsome
|
|
18
|
+
# def initialize
|
|
19
|
+
# @getsome = 'getsome'
|
|
20
|
+
# end
|
|
21
|
+
# end
|
|
22
|
+
|
|
23
|
+
# # module Roro
|
|
24
|
+
|
|
25
|
+
# # class CLI < Thor
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
# # no_commands do
|
|
29
|
+
|
|
30
|
+
# # def ruby_gem(*args)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# # end
|
|
34
|
+
# # def copy_ruby_gem_files
|
|
35
|
+
# # copy_file 'ruby_gem/config.yml', '.circleci/config.yml'
|
|
36
|
+
# # end
|
|
37
|
+
# # end
|
|
38
|
+
|
|
39
|
+
# # def ruby_gem
|
|
40
|
+
# # rubies = options["rubies"] || ["2.5.3", "2.6.0"]
|
|
41
|
+
# # copy_file 'ruby_gem/docker-compose.yml', 'docker-compose.yml'
|
|
42
|
+
# # copy_file 'ruby_gem/config.yml', '.circleci/config.yml'
|
|
43
|
+
# # copy_file 'ruby_gem/setup-gem-credentials.sh', '.circleci/setup-gem-credentials.sh'
|
|
44
|
+
# # directory 'ruby_gem/docker', 'docker', { ruby_version: "2.5"}
|
|
45
|
+
|
|
46
|
+
# # rubies.each do |ruby|
|
|
47
|
+
# # rubydash = ruby.gsub('.', '-')
|
|
48
|
+
# # rubyunderscore = ruby.gsub('.', '_')
|
|
49
|
+
# # doc_loc = "docker/containers/#{rubyunderscore}/Dockerfile"
|
|
50
|
+
# # content = <<-EOM
|
|
51
|
+
|
|
52
|
+
# # app-#{rubydash}:
|
|
53
|
+
# # build:
|
|
54
|
+
# # context: .
|
|
55
|
+
# # dockerfile: #{doc_loc}
|
|
56
|
+
# # command: rake test
|
|
57
|
+
# # EOM
|
|
58
|
+
# # append_to_file 'docker-compose.yml', content
|
|
59
|
+
# # template 'ruby_gem/docker/containers/app/Dockerfile.tt', doc_loc, {ruby_version: ruby}
|
|
60
|
+
# # # append_to_file 'docker-compose.yml', "\n app-#{ruby}:\n build:\n\s\s\s\s\s\scontext:"
|
|
61
|
+
# # end
|
|
62
|
+
|
|
63
|
+
# # # end
|
|
64
|
+
# # # <<EOF
|
|
65
|
+
# # # This is the first way of creating
|
|
66
|
+
# # # here document ie. multiple line string.
|
|
67
|
+
# # # EOF
|
|
68
|
+
# # # %w[app web].each do |container|
|
|
69
|
+
# # # options = {
|
|
70
|
+
# # # email: @env_hash['DOCKERHUB_EMAIL'],
|
|
71
|
+
# # # app_name: @env_hash['APP_NAME'] }
|
|
72
|
+
# # #
|
|
73
|
+
# # # template("docker/containers/#{container}/Dockerfile.tt", "docker/containers/#{container}/Dockerfile", options)
|
|
74
|
+
# # # end
|
|
75
|
+
# # end
|
|
76
|
+
# # end
|
|
77
|
+
# # end
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
module Roro
|
|
2
|
+
class CLI < Thor
|
|
3
|
+
|
|
4
|
+
desc "rollon::ruby_gem::with_ci_cd", "Generate files for containerized gem testing, CircleCI, and releasing to RubyGems."
|
|
5
|
+
method_option :rubies, type: :array, banner: "2.5.3 2.4.2"
|
|
6
|
+
map "rollon::ruby_gem::with_ci_cd" => "rollon_ruby_gem_with_ci_cd"
|
|
7
|
+
|
|
8
|
+
def rollon_ruby_gem_with_ci_cd(*args)
|
|
9
|
+
ruby_gem_with_ci_cd(*args)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
no_commands do
|
|
13
|
+
def ruby_gem_with_ci_cd(*args)
|
|
14
|
+
configure_for_rollon
|
|
15
|
+
answer = ask("\nYou can add your rubygems api key in\n\t
|
|
16
|
+
'./roro/ci.env' \n\nlater, or we'll try to add it here:",
|
|
17
|
+
default: '')
|
|
18
|
+
rubygems_api_key = (answer.eql?("") ? 'some-key' : answer)
|
|
19
|
+
@config.app['rubygems_api_key'] = rubygems_api_key
|
|
20
|
+
@config.app['rubies'] = []
|
|
21
|
+
3.times do |index|
|
|
22
|
+
newruby = @config.app['ruby_version'].gsub('.', '').to_i - index
|
|
23
|
+
@config.app['rubies'] << newruby.to_s.split('').join('.')
|
|
24
|
+
end
|
|
25
|
+
directory 'ruby_gem/roro', './roro', @config.app
|
|
26
|
+
directory 'ruby_gem/.circleci', './.circleci', @config.app
|
|
27
|
+
copy_file 'ruby_gem/docker-compose.yml', './docker-compose.yml'
|
|
28
|
+
|
|
29
|
+
@config.app['rubies'].each do |ruby|
|
|
30
|
+
img_name = 'ruby_gem:' + ruby
|
|
31
|
+
file = '.circleci/config.yml'
|
|
32
|
+
|
|
33
|
+
run_build = "\n - run: RUBY_IMAGE=ruby:#{ruby}-alpine docker-compose build ruby_gem"
|
|
34
|
+
run_test = "\n - run: RUBY_IMAGE=ruby:#{ruby}-alpine docker-compose run ruby_gem rake test"
|
|
35
|
+
append_to_file file, run_build + run_test, after: 'gem install roro'
|
|
36
|
+
end
|
|
37
|
+
append_to_file ".gitignore", "\nGemfile.lock"
|
|
38
|
+
gitignore_sensitive_files
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
# # def ruby_gem
|
|
44
|
+
# # rubies = options["rubies"] || ["2.5.3", "2.6.0"]
|
|
45
|
+
# # copy_file 'ruby_gem/docker-compose.yml', 'docker-compose.yml'
|
|
46
|
+
# # copy_file 'ruby_gem/config.yml', '.circleci/config.yml'
|
|
47
|
+
# # copy_file 'ruby_gem/setup-gem-credentials.sh', '.circleci/setup-gem-credentials.sh'
|
|
48
|
+
# # directory 'ruby_gem/docker', 'docker', { ruby_version: "2.5"}
|
|
49
|
+
|
|
50
|
+
# # rubies.each do |ruby|
|
|
51
|
+
# # rubydash = ruby.gsub('.', '-')
|
|
52
|
+
# # rubyunderscore = ruby.gsub('.', '_')
|
|
53
|
+
# # doc_loc = "docker/containers/#{rubyunderscore}/Dockerfile"
|
|
54
|
+
# # content = <<-EOM
|
|
55
|
+
|
|
56
|
+
# # app-#{rubydash}:
|
|
57
|
+
# # build:
|
|
58
|
+
# # context: .
|
|
59
|
+
# # dockerfile: #{doc_loc}
|
|
60
|
+
# # command: rake test
|
|
61
|
+
# # EOM
|
|
62
|
+
# # append_to_file 'docker-compose.yml', content
|
|
63
|
+
# # template 'ruby_gem/docker/containers/app/Dockerfile.tt', doc_loc, {ruby_version: ruby}
|
|
64
|
+
# # # append_to_file 'docker-compose.yml', "\n app-#{ruby}:\n build:\n\s\s\s\s\s\scontext:"
|
|
65
|
+
# # end
|
|
66
|
+
|
|
67
|
+
# # # end
|
|
68
|
+
# # # <<EOF
|
|
69
|
+
# # # This is the first way of creating
|
|
70
|
+
# # # here document ie. multiple line string.
|
|
71
|
+
# # # EOF
|
|
72
|
+
# # # %w[app web].each do |container|
|
|
73
|
+
# # # options = {
|
|
74
|
+
# # # email: @env_hash['DOCKERHUB_EMAIL'],
|
|
75
|
+
# # # app_name: @env_hash['APP_NAME'] }
|
|
76
|
+
# # #
|
|
77
|
+
# # # template("docker/containers/#{container}/Dockerfile.tt", "docker/containers/#{container}/Dockerfile", options)
|
|
78
|
+
# # # end
|
|
79
|
+
# # end
|
|
80
|
+
# # end
|
|
81
|
+
# # end
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
---
|
|
2
|
+
main_app_name: <%= Dir.pwd.split('/').last %>
|
|
3
|
+
developer:
|
|
4
|
+
name: your-name
|
|
5
|
+
email: your.email@example.com
|
|
6
|
+
|
|
7
|
+
services:
|
|
8
|
+
server_app:
|
|
9
|
+
name: app
|
|
10
|
+
vendors:
|
|
11
|
+
rails:
|
|
12
|
+
version:
|
|
13
|
+
image:
|
|
14
|
+
official_name: ruby
|
|
15
|
+
variants:
|
|
16
|
+
- alpine
|
|
17
|
+
- buster
|
|
18
|
+
- slim
|
|
19
|
+
- slim-buster
|
|
20
|
+
- stretch
|
|
21
|
+
|
|
22
|
+
choices:
|
|
23
|
+
|
|
24
|
+
config_std_out_true:
|
|
25
|
+
question: |
|
|
26
|
+
The team at Heroku, among others, recommend logging to STDOUT
|
|
27
|
+
and treating your logs as streams. We'll set this to
|
|
28
|
+
true as an environment variable but it may also be helpful
|
|
29
|
+
to configure './config/boot.rb' with '$stdout.sync = true'
|
|
30
|
+
just in case that doesn't work.
|
|
31
|
+
Would you like to configure this?
|
|
32
|
+
choices:
|
|
33
|
+
y: 'Yes'
|
|
34
|
+
n: 'No'
|
|
35
|
+
default: y
|
|
36
|
+
|
|
37
|
+
insert_roro_gem_into_gemfile:
|
|
38
|
+
question: |
|
|
39
|
+
Many developers believe it's good idea to secure sensitive
|
|
40
|
+
environment files and variables. You can use RoRo to
|
|
41
|
+
generate secret keys known only to you for use in any
|
|
42
|
+
environment, and then use them to encrypt and decrypt
|
|
43
|
+
these files. Would you like to add RoRo to your Gemfile?
|
|
44
|
+
choices:
|
|
45
|
+
y: 'Yes'
|
|
46
|
+
n: 'No'
|
|
47
|
+
default: y
|
|
48
|
+
|
|
49
|
+
gitignore_sensitive_files:
|
|
50
|
+
question: |
|
|
51
|
+
If you plan to use the environment files RoRo generates for
|
|
52
|
+
your own environment variables, it's a good idea to keep
|
|
53
|
+
these files out of source control. Would you like RoRo to
|
|
54
|
+
modify your .gitignore file to accomplish this for you ?
|
|
55
|
+
choices:
|
|
56
|
+
y: 'Yes'
|
|
57
|
+
n: 'No'
|
|
58
|
+
default: y
|
|
59
|
+
|
|
60
|
+
insert_hfci_gem_into_gemfile:
|
|
61
|
+
question: |
|
|
62
|
+
Jim Weirich passed too soon and remains missed. In addition
|
|
63
|
+
to Rake, Jim wrote a beautiful gem called 'Given' that makes
|
|
64
|
+
Rspec and Minitest less ugly and thus your tests more easy to
|
|
65
|
+
write. Would you like to install a gem called
|
|
66
|
+
handsome_fencer-test that allows you to try it out?
|
|
67
|
+
choices:
|
|
68
|
+
y: 'Yes'
|
|
69
|
+
n: 'No'
|
|
70
|
+
default: n
|
|
71
|
+
|
|
72
|
+
backup_existing_files:
|
|
73
|
+
question: |
|
|
74
|
+
RoRo will be generating a number of files, some of which will
|
|
75
|
+
replace existing ones. Would you like to back them up?
|
|
76
|
+
choices:
|
|
77
|
+
y: 'Yes'
|
|
78
|
+
n: 'No'
|
|
79
|
+
default: n
|
|
80
|
+
|
|
81
|
+
copy_dockerignore:
|
|
82
|
+
question: |
|
|
83
|
+
Would you like to create a .dockerignore file?
|
|
84
|
+
choices:
|
|
85
|
+
y: 'Yes'
|
|
86
|
+
n: 'No'
|
|
87
|
+
default: y
|
|
88
|
+
|
|
89
|
+
configure_database:
|
|
90
|
+
question: |
|
|
91
|
+
RoRo can reliably dockerize your Rails app with either
|
|
92
|
+
MySQL or PostgreSQL stories. Which story would you prefer
|
|
93
|
+
to roll on?
|
|
94
|
+
choices:
|
|
95
|
+
p: PostgreSQL
|
|
96
|
+
m: MySQL
|
|
97
|
+
default: p
|
|
98
|
+
|
|
99
|
+
env_vars:
|
|
100
|
+
DATABASE_HOST: database
|
|
101
|
+
|
|
102
|
+
database:
|
|
103
|
+
name: database
|
|
104
|
+
vendor: postgresql
|
|
105
|
+
vendors:
|
|
106
|
+
postgresql:
|
|
107
|
+
images:
|
|
108
|
+
official_name:
|
|
109
|
+
versions:
|
|
110
|
+
- latest
|
|
111
|
+
env_vars:
|
|
112
|
+
POSTGRES_USER: postgres
|
|
113
|
+
POSTGRES_PASSWORD: your-postgres-password
|
|
114
|
+
|
|
115
|
+
mysql:
|
|
116
|
+
env_vars:
|
|
117
|
+
MYSQL_ROOT_PASSWORD: root
|
|
118
|
+
MYSQL_PASSWORD: root
|
|
119
|
+
MYSQL_USERNAME: root
|
|
120
|
+
MYSQL_DATABASE_PORT: '3306'
|
|
121
|
+
|
|
122
|
+
frontend:
|
|
123
|
+
name: frontend
|
|
124
|
+
vendors:
|
|
125
|
+
|
|
126
|
+
- frontend
|
|
127
|
+
- vuejs
|
|
128
|
+
- react
|
|
129
|
+
- angular
|
|
130
|
+
webserver:
|
|
131
|
+
default: nginx
|
|
132
|
+
vendors:
|
|
133
|
+
- nginx
|
|
134
|
+
application_server:
|
|
135
|
+
name: appserver
|
|
136
|
+
vendors:
|
|
137
|
+
- unicorn:
|
|
138
|
+
- puma:
|
|
139
|
+
registries:
|
|
140
|
+
dockerhub:
|
|
141
|
+
env_vars:
|
|
142
|
+
DOCKERHUB_EMAIL: your-docker-hub-email
|
|
143
|
+
DOCKERHUB_ORG: your-docker-hub-org-name
|
|
144
|
+
DOCKERHUB_PASSWORD: your-docker-hub-password
|
|
145
|
+
DOCKERHUB_USER: your-docker-hub-user-name
|
|
146
|
+
|
|
147
|
+
ci_cd:
|
|
148
|
+
semaphore:
|
|
149
|
+
circleci:
|
|
150
|
+
env_vars:
|
|
151
|
+
DEPLOY_TAG: "${CIRCLE_SHA1:0:7}"
|
|
152
|
+
|
|
153
|
+
deployment:
|
|
154
|
+
env_vars:
|
|
155
|
+
SERVER_HOST: "ip-address-of-your-server"
|
|
156
|
+
SERVER_PORT: '22'
|
|
157
|
+
SERVER_USER: root
|
data/lib/roro/cli/ruby_gem.rb
CHANGED
|
@@ -1,54 +1,67 @@
|
|
|
1
|
-
module
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# module Rollon
|
|
2
|
+
# module Story
|
|
3
|
+
|
|
4
|
+
# end
|
|
5
|
+
# end
|
|
6
|
+
# class Rollon::Story::RubyGem < Roro::CLI
|
|
7
|
+
# attr_reader :getsome
|
|
8
|
+
# def initialize
|
|
9
|
+
# @getsome = 'getsome'
|
|
10
|
+
# end
|
|
11
|
+
# end
|
|
4
12
|
|
|
5
|
-
|
|
13
|
+
# # module Roro
|
|
6
14
|
|
|
7
|
-
|
|
8
|
-
method_option :rubies, type: :array, banner: "2.5.3 2.4.2"
|
|
15
|
+
# # class CLI < Thor
|
|
9
16
|
|
|
10
|
-
no_commands do
|
|
11
|
-
def copy_ruby_gem_files
|
|
12
|
-
copy_file 'ruby_gem/config.yml', '.circleci/config.yml'
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
# # no_commands do
|
|
19
|
+
|
|
20
|
+
# # def ruby_gem(*args)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
# # end
|
|
24
|
+
# # def copy_ruby_gem_files
|
|
25
|
+
# # copy_file 'ruby_gem/config.yml', '.circleci/config.yml'
|
|
26
|
+
# # end
|
|
27
|
+
# # end
|
|
28
|
+
|
|
29
|
+
# # def ruby_gem
|
|
30
|
+
# # rubies = options["rubies"] || ["2.5.3", "2.6.0"]
|
|
31
|
+
# # copy_file 'ruby_gem/docker-compose.yml', 'docker-compose.yml'
|
|
32
|
+
# # copy_file 'ruby_gem/config.yml', '.circleci/config.yml'
|
|
33
|
+
# # copy_file 'ruby_gem/setup-gem-credentials.sh', '.circleci/setup-gem-credentials.sh'
|
|
34
|
+
# # directory 'ruby_gem/docker', 'docker', { ruby_version: "2.5"}
|
|
22
35
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
36
|
+
# # rubies.each do |ruby|
|
|
37
|
+
# # rubydash = ruby.gsub('.', '-')
|
|
38
|
+
# # rubyunderscore = ruby.gsub('.', '_')
|
|
39
|
+
# # doc_loc = "docker/containers/#{rubyunderscore}/Dockerfile"
|
|
40
|
+
# # content = <<-EOM
|
|
28
41
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
42
|
+
# # app-#{rubydash}:
|
|
43
|
+
# # build:
|
|
44
|
+
# # context: .
|
|
45
|
+
# # dockerfile: #{doc_loc}
|
|
46
|
+
# # command: rake test
|
|
47
|
+
# # EOM
|
|
48
|
+
# # append_to_file 'docker-compose.yml', content
|
|
49
|
+
# # template 'ruby_gem/docker/containers/app/Dockerfile.tt', doc_loc, {ruby_version: ruby}
|
|
50
|
+
# # # append_to_file 'docker-compose.yml', "\n app-#{ruby}:\n build:\n\s\s\s\s\s\scontext:"
|
|
51
|
+
# # end
|
|
39
52
|
|
|
40
|
-
|
|
41
|
-
# <<EOF
|
|
42
|
-
# This is the first way of creating
|
|
43
|
-
# here document ie. multiple line string.
|
|
44
|
-
# EOF
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
end
|
|
53
|
+
# # # end
|
|
54
|
+
# # # <<EOF
|
|
55
|
+
# # # This is the first way of creating
|
|
56
|
+
# # # here document ie. multiple line string.
|
|
57
|
+
# # # EOF
|
|
58
|
+
# # # %w[app web].each do |container|
|
|
59
|
+
# # # options = {
|
|
60
|
+
# # # email: @env_hash['DOCKERHUB_EMAIL'],
|
|
61
|
+
# # # app_name: @env_hash['APP_NAME'] }
|
|
62
|
+
# # #
|
|
63
|
+
# # # template("docker/containers/#{container}/Dockerfile.tt", "docker/containers/#{container}/Dockerfile", options)
|
|
64
|
+
# # # end
|
|
65
|
+
# # end
|
|
66
|
+
# # end
|
|
67
|
+
# # end
|