railman 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eea88cb63a0d2137adc11bd0ed5dd9fce26ac383
4
- data.tar.gz: b75caf3b59e3937873c87ab4b6ca08f98045d9e5
3
+ metadata.gz: e7dd8f9ea6008b9afb27376763c562163572b470
4
+ data.tar.gz: 20e7645221bce277f9d603b159b73450908214bb
5
5
  SHA512:
6
- metadata.gz: f26aef2d81f4af9401cdcc7b773600f635cae460f0eb529db25f5f44834022ae6c034a27a5d02d4c90c4fbe447437fcec37baf91b4cec5218b11cadd5305cb83
7
- data.tar.gz: 12734bf0fb0244b0b04f2da35299d7636c566559f2f4289b9cd863102603b53ee393da5cd362ed23f9c5409d4505b97bb9ebf368a61f54c20720006bb3f8d97e
6
+ metadata.gz: ee6352c4ee9f16190cd5a9fbfcb3b16dad3503a93a8bc3e8fcd5700002e5f15acc8bf7fb731fd13552eadedc980907ae20c6ecaf43e752c4f4c516a5acdad2fa
7
+ data.tar.gz: 6718d82038478ca897fef10eb8e0d0869e2475980403dca45041d88bec78f622d9b6ee673e29c70992ed1071aa8416cd9070f40161b3d6eb8882dc04853427d7
data/CUSTOMIZATION.md CHANGED
@@ -14,11 +14,28 @@ If you install direnv, you don't have to use `bundle exec` any more, as the bin
14
14
 
15
15
  Add following gems:
16
16
  pg - postgres database driver
17
+ jquery-turbolinks - ?
18
+ bootstrap-sass - ?
19
+ bootstrap_form - ?
20
+ bootstrap-datepicker-rails - ?
21
+ active_link_to - ?
22
+ dalli & kgio - memcached client
23
+ unicorn & unicorn_rails - use unicorn in development and production
24
+ capistrano & capistrano-* - deployment with capistrano
17
25
  exception_notification - notify me per email on each exception
26
+ better_errors & binding_of_caller - better error page with repl in development
27
+ quiet_assets - less noise in development log
18
28
  letter_opener - open emails in popup window in the browser in development mode
29
+ minitest-reporters - generate xml for jenkins
30
+ simplecov & simplecov-rcov - generate coverage reports locally and for jenkins
31
+ capybara & capybara_minitest_spec - for webtests
32
+ selenium-webdriver - use real browser for webtests
33
+ poltergeist - headless tests with phantom.js
19
34
 
20
35
  Remove following gems:
21
36
  sqlite3 - we are using postgres per default
37
+ jbuilder - not every application needs it
38
+ byebug - we don't use it, we use the RubyMine debugger instead
22
39
 
23
40
  Add the application-specific gems to Gemfile.local, so it can be kept separate from the base Gemfile.
24
41
 
@@ -79,3 +96,48 @@ Use database user and password from .env
79
96
 
80
97
  Use SECRET_TOKEN from .env
81
98
 
99
+ ## config/deploy.rb
100
+
101
+ Custom capistrano deployment script
102
+
103
+ ## Capfile
104
+
105
+ Capistrano main file (generated by capify!)
106
+
107
+ ## app/assets/stylesheets
108
+
109
+ Delete application.css
110
+ Add application.sass
111
+
112
+ ## app/assets/javascripts/application.js
113
+
114
+ Add:
115
+ //= require jquery.turbolinks
116
+ //= require bootstrap-sprockets
117
+ //= require bootstrap-datepicker
118
+
119
+ ## views/layouts
120
+
121
+ Modify application.html.erb
122
+ Add _messages.html.erb
123
+
124
+ ## app/controllers/home_controller.rb
125
+
126
+ Home controller shows the main page
127
+
128
+ ## app/views/home/index.html.erb
129
+
130
+ Dummy welcome page
131
+
132
+ ## config/routes.rb
133
+
134
+ Remove comments and set root
135
+
136
+ ## README
137
+
138
+ Remove README.rdoc
139
+ Add README.md
140
+
141
+ ## .gitignore
142
+
143
+ Ignore: .env, .idea, .DS_Store
data/lib/railman/cli.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'thor'
2
2
  require 'creategem'
3
+ require 'railman/secret'
3
4
 
4
5
  module Railman
5
6
  class CLI < Thor
@@ -28,17 +29,23 @@ module Railman
28
29
  @domains = [@domain]
29
30
  end
30
31
  @server = ask("What is the name of the production server?")
32
+ @repository = Creategem::Repository.new(vendor: :bitbucket,
33
+ user: git_repository_user_name(:bitbucket),
34
+ name: app_name,
35
+ gem_server_url: gem_server_url(:bitbucket))
36
+ @rake_secret = "TODO: generate with: rake secret"
37
+ @unicorn_behind_nginx = true
31
38
  directory "rails_app", app_name
32
- repository = Creategem::Repository.new(vendor: :bitbucket,
33
- user: git_repository_user_name(:bitbucket),
34
- name: app_name,
35
- gem_server_url: gem_server_url(:bitbucket))
39
+ @rake_secret = Railman::Secret.generate_secret
40
+ @unicorn_behind_nginx = false
41
+ template "rails_app/.env.example.tt", "#{app_name}/.env"
36
42
  Dir.chdir app_name do
37
- create_local_git_repository
38
43
  run "bundle install"
39
- create_remote_git_repository(repository) if yes?("Do you want me to create bitbucket repository named #{app_name}? (y/n)")
44
+ create_local_git_repository
45
+ create_remote_git_repository(@repository) if yes?("Do you want me to create bitbucket repository named #{app_name}? (y/n)")
40
46
  end
41
47
  say "The rails application '#{app_name}' was successfully created.", :green
48
+ say "Please check the settings in .env", :blue
42
49
  end
43
50
 
44
51
  desc "update APPNAME", "Update the rails upplication named APPNAME"
@@ -0,0 +1,9 @@
1
+ require 'securerandom'
2
+
3
+ module Railman
4
+ module Secret
5
+ def self.generate_secret
6
+ SecureRandom.hex(64)
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module Railman
2
- VERSION = '0.0.3'
2
+ VERSION = '0.1.0'
3
3
  end
@@ -12,7 +12,7 @@ DB_PASSWORD = 'password'
12
12
 
13
13
 
14
14
  # Session secret - generate with: rake secret
15
- SECRET_TOKEN = 'todo: generate with: rake secret'
15
+ SECRET_TOKEN = '<%= @rake_secret %>'
16
16
 
17
17
 
18
18
  # SMTP server settings
@@ -30,11 +30,10 @@ EXCEPTION_NOTIFICATION_EMAIL_PREFIX = '[<%= @class_name %>] '
30
30
  EXCEPTION_NOTIFICATION_SENDER = 'server@<%= @domain %>'
31
31
 
32
32
  # Unicorn settings
33
- UNICORN_PORT = 3000
34
- # UNICORN_SOCK = '/tmp/unicorn.<%= app_name %>.sock'
35
- UNICORN_WORKERS = 2
36
- UNICORN_TIMEOUT = 60
37
-
33
+ UNICORN_BEHIND_NGINX = <%= @unicorn_behind_nginx %>
34
+ # UNICORN_WORKERS = 1
35
+ # UNICORN_PORT = 3000
36
+ # UNICORN_TIMEOUT = 60
38
37
 
39
38
  # Rails environment
40
39
  RAILS_ENV = 'development'
@@ -1,17 +1,7 @@
1
- # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
- #
3
- # If you find yourself ignoring temporary files generated by your text editor
4
- # or operating system, you probably want to add a global ignore instead:
5
- # git config --global core.excludesfile '~/.gitignore_global'
6
-
7
- # Ignore bundler config.
1
+ .DS_Store
2
+ /.idea
8
3
  /.bundle
9
-
10
- # Ignore the default SQLite database.
11
- /db/*.sqlite3
12
- /db/*.sqlite3-journal
13
-
14
- # Ignore all logfiles and tempfiles.
15
4
  /log/*
16
5
  !/log/.keep
17
6
  /tmp
7
+ .env
@@ -0,0 +1,5 @@
1
+ # Load DSL and Setup Up Stages
2
+ require 'capistrano/setup'
3
+
4
+ # Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
5
+ Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }
@@ -10,14 +10,19 @@ gem 'uglifier', '>= 1.3.0'
10
10
  gem 'coffee-rails', '~> 4.1.0'
11
11
  gem 'jquery-rails'
12
12
  gem 'turbolinks'
13
+ gem 'jquery-turbolinks'
13
14
 
14
- # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
15
- gem 'jbuilder', '~> 2.0'
15
+ gem 'bootstrap-sass', '3.3.4.1'
16
+ gem 'bootstrap_form', '2.3.0' # form helper for twitter bootstrap
17
+ gem 'bootstrap-datepicker-rails', '1.4.0' # bootstrap-datepicker
18
+ gem 'active_link_to', '1.0.3' # automatically mark navigation link as active
16
19
 
17
- # Use ActiveModel has_secure_password
18
- # gem 'bcrypt', '~> 3.1.7'
20
+ gem 'dalli' # memcached client
21
+ gem 'kgio' # gives dalli 20-30% performance boost
19
22
 
20
- gem 'unicorn', '4.8.2' # use unicorn as production server
23
+ # todo add sidekiq for backgroud jobs
24
+
25
+ gem 'unicorn', '4.8.3' # use unicorn as production server
21
26
  gem 'unicorn-rails', '1.1.0' # use unicorn as local server
22
27
 
23
28
  # capistrano deployment
@@ -26,21 +31,28 @@ gem 'capistrano-rails', '1.1.1'
26
31
  gem 'capistrano-rbenv', '2.0.2'
27
32
  gem 'capistrano-bundler', '1.1.2'
28
33
 
29
- group :development, :test do
30
- # Call 'byebug' anywhere in the code to stop execution and get a debugger console
31
- gem 'byebug'
32
- end
34
+ gem 'exception_notification', '4.1.2' # exception notification per email
33
35
 
34
36
  group :development do
35
- # Access an IRB console on exception pages or by using <%= console %> in views
36
- gem 'web-console', '~> 2.0'
37
-
38
- # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
39
- gem 'spring'
37
+ gem 'better_errors' # better error pages in development
38
+ gem 'binding_of_caller' # repl on the error page
39
+ gem 'spring' # Spring speeds up development by keeping your application running in the background
40
+ gem 'quiet_assets' # less noise in development log
41
+ # gem 'rack-mini-profiler'
42
+ # gem 'flamegraph' # mini-profiler flamegraph extension (?pp=flamegraph)
40
43
  end
41
44
 
42
- gem 'exception_notification', '4.1.2' # exception notification per email
45
+ group :test do
46
+ gem 'minitest-reporters', '1.1.7' # generate xml for jenkins
47
+ gem 'simplecov', require: false # generate coverage reports
48
+ gem 'simplecov-rcov', '0.2.3', require: false # generate coverage reports for jenkins
49
+ gem 'capybara', '2.6.0' # dsl for browser tests
50
+ gem 'capybara_minitest_spec', '1.0.5' # capybara rspec-style matchers (must_have...)
51
+ gem 'selenium-webdriver', '2.49.0' # use real browser for webtests
52
+ gem 'poltergeist', '1.8.1' # headless tests with phantom.js
53
+ end
43
54
 
55
+ # put additional application-specific gems to Gemfile.local
44
56
  local_gemfile = File.join(File.dirname(__FILE__), "Gemfile.local")
45
57
  eval_gemfile(local_gemfile) if File.exists?(local_gemfile)
46
58
 
@@ -1,4 +1,4 @@
1
- == README
1
+ ## README
2
2
 
3
3
  This README would normally document whatever steps are necessary to get the
4
4
  application up and running.
@@ -2,13 +2,14 @@
2
2
 
3
3
  This file describes what you have to customize after you create a new rails application with railman
4
4
 
5
- ## .env.example and .env
5
+ ## .env
6
6
 
7
- Copy .env.example, name the copy .env, and modify .env for your local development environment.
7
+ Check your settings in .env (database user/password, smpt server, emails, ...)
8
8
 
9
9
  .env is gitignored. This is intended. You should create a local .env file on every server your deploy your rails application to, and modify the settings for that server.
10
10
 
11
- Create secret token with `rake secret` and copy the secret to your .env file.
12
-
13
11
  Try to keep all the application/server/environment specific settings, as well as all passwords here, as .env is not commited to git and exists only on a server or local user machine. This will also make future rails upgrades and changes in the configuration files less painful.
14
-
12
+
13
+ ## create local database
14
+
15
+ todo: rake tasks
@@ -11,6 +11,9 @@
11
11
  // about supported directives.
12
12
  //
13
13
  //= require jquery
14
+ //= require jquery.turbolinks
14
15
  //= require jquery_ujs
15
16
  //= require turbolinks
17
+ //= require bootstrap-sprockets
18
+ //= require bootstrap-datepicker
16
19
  //= require_tree .
@@ -0,0 +1,6 @@
1
+ @import "bootstrap-sprockets"
2
+ @import "bootstrap"
3
+ @import "rails_bootstrap_forms"
4
+ @import "bootstrap-datepicker3"
5
+
6
+
@@ -0,0 +1,4 @@
1
+ class HomeController < ApplicationController
2
+ def index
3
+ end
4
+ end
@@ -0,0 +1 @@
1
+ <p>Welcome to: <%= @class_name %></p>
@@ -0,0 +1,7 @@
1
+ <% flash.each do |name, msg| %>
2
+ <div class="alert alert-<%= name == "notice" ? "success" : "danger" %> alert-dismissible">
3
+ <button type="button" class="close" data-dismiss="alert"><span>&times;</span></button>
4
+ <%= msg %>
5
+ </div>
6
+ <% end %>
7
+
@@ -1,14 +1,32 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
3
  <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1">
7
+ <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
8
+
4
9
  <title><%= @class_name %></title>
5
10
  <%%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
6
11
  <%%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
12
+
13
+ <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
14
+ <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
15
+ <!--[if lt IE 9]>
16
+ <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
17
+ <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
18
+ <![endif]-->
19
+
7
20
  <%%= csrf_meta_tags %>
8
21
  </head>
9
22
  <body>
10
-
11
- <%%= yield %>
12
-
23
+ <div class="container">
24
+ <%%= render 'layouts/messages' %>
25
+ <%%= yield %>
26
+ </div>
27
+ <script>
28
+ window.current_language = "<%%= I18n.locale %>";
29
+ window.date_format = "<%%= I18n.t('date.formats.datepicker') %>";
30
+ </script>
13
31
  </body>
14
32
  </html>
@@ -4,8 +4,8 @@ development:
4
4
  port: 5432
5
5
  host: localhost
6
6
  database: <%= app_name %>_development
7
- username: <%= ENV['DB_USER'] %>
8
- password: <%= ENV['DB_PASSWORD'] %>
7
+ username: <%%= ENV['DB_USER'] %>
8
+ password: <%%= ENV['DB_PASSWORD'] %>
9
9
  pool: 5
10
10
  timeout: 5000
11
11
 
@@ -15,8 +15,8 @@ test:
15
15
  port: 5432
16
16
  host: localhost
17
17
  database: <%= app_name %>_test
18
- username: <%= ENV['DB_USER'] %>
19
- password: <%= ENV['DB_PASSWORD'] %>
18
+ username: <%%= ENV['DB_USER'] %>
19
+ password: <%%= ENV['DB_PASSWORD'] %>
20
20
  pool: 5
21
21
  timeout: 5000
22
22
 
@@ -26,7 +26,7 @@ production:
26
26
  port: 5432
27
27
  host: localhost
28
28
  database: <%= app_name %>_production
29
- username: <%= ENV['DB_USER'] %>
30
- password: <%= ENV['DB_PASSWORD'] %>
29
+ username: <%%= ENV['DB_USER'] %>
30
+ password: <%%= ENV['DB_PASSWORD'] %>
31
31
  pool: 15
32
32
  timeout: 5000
@@ -0,0 +1,113 @@
1
+ # Capistrano deployment tasks
2
+ lock '3.1.0'
3
+
4
+ set :application, '<%= app_name %>'
5
+ set :repo_url, '<%= @repository.origin %>'
6
+ set :deploy_to, "/home/deploy/apps/#{fetch(:application)}"
7
+ set :rbenv_home, '/home/deploy/.rbenv'
8
+ set :environment, {path: "#{fetch(:rbenv_home)}/shims:#{fetch(:rbenv_home)}/bin:$PATH", rails_env: 'production'}
9
+ set :log_level, :info
10
+
11
+ SSHKit.config.command_map[:rake] = "#{fetch(:deploy_to)}/bin/rake"
12
+ %w(ln service start restart stop status).each do |cmd|
13
+ SSHKit.config.command_map[cmd.to_sym] = "sudo #{cmd}"
14
+ end
15
+ SSHKit.config.command_map[:eye] = "#{fetch(:rbenv_home)}/shims/eye"
16
+ SSHKit.config.command_map[:su_rm] = "sudo rm"
17
+ SSHKit.config.command_map[:letsencrypt] = "/opt/letsencrypt/letsencrypt-auto"
18
+
19
+ desc "Setup rails application for the first time on a server"
20
+ task :setup do
21
+ on roles(:all) do
22
+ with fetch(:environment) do
23
+ execute :git, :clone, fetch(:repo_url), fetch(:deploy_to)
24
+ within fetch(:deploy_to) do
25
+ execute :bundle, :install
26
+ execute :rake, 'db:create'
27
+ execute :psql, "-d #{fetch(:application)}_production", "-f db/#{fetch(:application)}.sql"
28
+ execute :rake, 'db:migrate'
29
+ execute :rake, 'assets:precompile'
30
+ execute :mkdir, "-p #{fetch(:deploy_to)}/tmp/pids"
31
+ end
32
+ server_conf_dir = "#{fetch(:deploy_to)}/config/server"
33
+ execute :ln, "-s #{server_conf_dir}/nginx.conf /etc/nginx/conf.d/#{fetch(:application)}.conf"
34
+ execute :ln, "-s #{server_conf_dir}/letsencrypt.conf /etc/nginx/letsencrypt/#{fetch(:application)}.conf"
35
+ execute :ln, "-s #{server_conf_dir}/logrotate.conf /etc/logrotate.d/#{fetch(:application)}"
36
+ execute :eye, :load, 'Eyefile'
37
+ execute :eye, :start, fetch(:application)
38
+ execute :service, "nginx stop"
39
+ execute :letsencrypt, "--config /etc/nginx/letsencrypt/#{fetch(:application)}.conf --standalone certonly"
40
+ execute :service, "nginx start"
41
+ end
42
+ end
43
+ end
44
+
45
+ desc "Remove the application completely from the server"
46
+ task :remove do
47
+ on roles(:all) do
48
+ with fetch(:environment) do
49
+ within fetch(:deploy_to) do
50
+ execute :rake, 'db:drop'
51
+ end if test "[ -d #{fetch(:deploy_to)} ]"
52
+ execute :eye, :load, 'Eyefile'
53
+ execute :eye, :stop, fetch(:application)
54
+ execute :su_rm, "-f /etc/init/#{fetch(:application)}*"
55
+ execute :su_rm, "-rf #{fetch(:deploy_to)}"
56
+ execute :su_rm, "-f /etc/nginx/conf.d/#{fetch(:application)}.conf"
57
+ execute :su_rm, "-f /etc/nginx/conf.d/#{fetch(:application)}_ssl.conf"
58
+ execute :su_rm, "-f /etc/logrotate.d/#{fetch(:application)}"
59
+ execute :service, "nginx restart"
60
+ end
61
+ end
62
+ end
63
+
64
+ desc "Deploy rails application"
65
+ task :deploy do
66
+ on roles(:all) do
67
+ with fetch(:environment) do
68
+ within fetch(:deploy_to) do
69
+ execute :git, :fetch, 'origin'
70
+ execute :git, :reset, '--hard origin/master'
71
+ execute :bundle, :install
72
+ execute :rake, 'db:migrate'
73
+ execute :rake, 'assets:precompile'
74
+ execute :eye, :load, 'Eyefile'
75
+ execute :eye, :restart, fetch(:application)
76
+ execute :service, "nginx restart"
77
+ end
78
+ end
79
+ end
80
+ end
81
+
82
+ desc "Copy database from the server to the local machine"
83
+ task :sync_local do
84
+ on roles(:all) do
85
+ within fetch(:deploy_to) do
86
+ execute :pg_dump, "-U deploy --clean #{fetch(:application)}_production > db/#{fetch(:application)}.sql"
87
+ download! "#{fetch(:deploy_to)}/db/#{fetch(:application)}.sql", 'db'
88
+ end
89
+ end
90
+ run_locally do
91
+ execute "psql -d #{fetch(:application)}_development -f db/#{fetch(:application)}.sql"
92
+ end
93
+ end
94
+
95
+ desc "Recreate server database from db/#{fetch(:application)}.sql"
96
+ task :reset_server do
97
+ on roles(:all) do
98
+ with fetch(:environment) do
99
+ within fetch(:deploy_to) do
100
+ execute :eye, :load, 'Eyefile'
101
+ execute :eye, :stop, fetch(:application)
102
+ execute :git, :fetch, 'origin'
103
+ execute :git, :reset, '--hard origin/master'
104
+ execute :rake, 'db:drop'
105
+ execute :rake, 'db:create'
106
+ execute :psql, "-d #{fetch(:application)}_production", "-f db/#{fetch(:application)}.sql"
107
+ execute :rake, 'db:migrate'
108
+ execute :eye, :start, fetch(:application)
109
+ execute :service, "nginx restart"
110
+ end
111
+ end
112
+ end
113
+ end
@@ -1,56 +1,3 @@
1
1
  Rails.application.routes.draw do
2
- # The priority is based upon order of creation: first created -> highest priority.
3
- # See how all your routes lay out with "rake routes".
4
-
5
- # You can have the root of your site routed with "root"
6
- # root 'welcome#index'
7
-
8
- # Example of regular route:
9
- # get 'products/:id' => 'catalog#view'
10
-
11
- # Example of named route that can be invoked with purchase_url(id: product.id)
12
- # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
13
-
14
- # Example resource route (maps HTTP verbs to controller actions automatically):
15
- # resources :products
16
-
17
- # Example resource route with options:
18
- # resources :products do
19
- # member do
20
- # get 'short'
21
- # post 'toggle'
22
- # end
23
- #
24
- # collection do
25
- # get 'sold'
26
- # end
27
- # end
28
-
29
- # Example resource route with sub-resources:
30
- # resources :products do
31
- # resources :comments, :sales
32
- # resource :seller
33
- # end
34
-
35
- # Example resource route with more complex sub-resources:
36
- # resources :products do
37
- # resources :comments
38
- # resources :sales do
39
- # get 'recent', on: :collection
40
- # end
41
- # end
42
-
43
- # Example resource route with concerns:
44
- # concern :toggleable do
45
- # post 'toggle'
46
- # end
47
- # resources :posts, concerns: :toggleable
48
- # resources :photos, concerns: :toggleable
49
-
50
- # Example resource route within a namespace:
51
- # namespace :admin do
52
- # # Directs /admin/products/* to Admin::ProductsController
53
- # # (app/controllers/admin/products_controller.rb)
54
- # resources :products
55
- # end
2
+ root 'home#index'
56
3
  end
@@ -5,13 +5,13 @@ APP_ROOT = File.expand_path('../..', __FILE__)
5
5
  require 'dotenv'
6
6
  Dotenv.load
7
7
 
8
- timeout Integer(ENV['UNICORN_TIMEOUT'])
9
- if ENV['UNICORN_SOCK'] # behind nginx
10
- listen ENV['UNICORN_SOCK']
8
+ timeout Integer(ENV['UNICORN_TIMEOUT'] || 60)
9
+ if ENV['UNICORN_BEHIND_NGINX']
10
+ listen '/tmp/unicorn.<%= app_name %>.sock'
11
11
  else
12
- listen Integer(ENV['UNICORN_PORT'])
12
+ listen Integer(ENV['UNICORN_PORT'] || 3000)
13
13
  end
14
- worker_processes Integer(ENV['UNICORN_WORKERS'])
14
+ worker_processes Integer(ENV['UNICORN_WORKERS'] || 1)
15
15
  working_directory APP_ROOT
16
16
  pid "#{APP_ROOT}/tmp/pids/unicorn.pid"
17
17
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Jancev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-04-16 00:00:00.000000000 Z
11
+ date: 2016-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -157,26 +157,31 @@ files:
157
157
  - exe/railman
158
158
  - lib/railman.rb
159
159
  - lib/railman/cli.rb
160
+ - lib/railman/secret.rb
160
161
  - lib/railman/version.rb
161
162
  - railman.gemspec
162
163
  - templates/rails_app/.env.example.tt
163
164
  - templates/rails_app/.envrc
164
165
  - templates/rails_app/.gitignore
165
166
  - templates/rails_app/.ruby-version
167
+ - templates/rails_app/Capfile
166
168
  - templates/rails_app/Eyefile.tt
167
169
  - templates/rails_app/Gemfile
168
- - templates/rails_app/README.rdoc
170
+ - templates/rails_app/README.md
169
171
  - templates/rails_app/Rakefile
170
172
  - templates/rails_app/TODO.md
171
173
  - templates/rails_app/app/assets/images/.keep
172
174
  - templates/rails_app/app/assets/javascripts/application.js
173
- - templates/rails_app/app/assets/stylesheets/application.css
175
+ - templates/rails_app/app/assets/stylesheets/application.sass
174
176
  - templates/rails_app/app/controllers/application_controller.rb
175
177
  - templates/rails_app/app/controllers/concerns/.keep
178
+ - templates/rails_app/app/controllers/home_controller.rb
176
179
  - templates/rails_app/app/helpers/application_helper.rb
177
180
  - templates/rails_app/app/mailers/.keep
178
181
  - templates/rails_app/app/models/.keep
179
182
  - templates/rails_app/app/models/concerns/.keep
183
+ - templates/rails_app/app/views/home/index.html.erb.tt
184
+ - templates/rails_app/app/views/layouts/_messages.html.erb
180
185
  - templates/rails_app/app/views/layouts/application.html.erb.tt
181
186
  - templates/rails_app/bin/bundle
182
187
  - templates/rails_app/bin/rails
@@ -187,6 +192,7 @@ files:
187
192
  - templates/rails_app/config/application.rb.tt
188
193
  - templates/rails_app/config/boot.rb
189
194
  - templates/rails_app/config/database.yml.tt
195
+ - templates/rails_app/config/deploy.rb.tt
190
196
  - templates/rails_app/config/deploy/production.rb.tt
191
197
  - templates/rails_app/config/environment.rb
192
198
  - templates/rails_app/config/environments/development.rb
@@ -1,15 +0,0 @@
1
- /*
2
- * This is a manifest file that'll be compiled into application.css, which will include all the files
3
- * listed below.
4
- *
5
- * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
- * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
- *
8
- * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
- * compiled file so the styles you add here take precedence over styles defined in any styles
10
- * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
- * file per style scope.
12
- *
13
- *= require_tree .
14
- *= require_self
15
- */