orats 0.9.0 → 0.9.1

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: 06d673cccc421756a9ce6a7398c8a5953245f7c7
4
- data.tar.gz: 9bea9a885137b89ff186287604a54bec948ff159
3
+ metadata.gz: 98a4802b7b1d109d7bd50407c2fb82082a0fd51c
4
+ data.tar.gz: 26e2ff60d48cd9b36b884c4dd1bf15ff22d1a94b
5
5
  SHA512:
6
- metadata.gz: 0b6b7592f901be422559dca5b4409e9fd2db5ff579100d5e472d6d522a44cdcfc8e68614a1172ce046f3371385ad414b62a743e014ecdc9ec7691ea32a6bc55e
7
- data.tar.gz: 52d2a71d2b084bb80a55e0f97531d3fe6d1738bad452d623452c900d74af8520d43f2f85c27d9a79e1dccee7c00893e46b734e49aa5ef02c21f001a9d1252c3e
6
+ metadata.gz: dd92db4f7de6310a1da383eff6bcbe9e8cccd4a672adad6da092d434d8a0c59cb5f4bf8f9640f108de81bb2ff22682d37351fd9a67f0f7e42249a81504661910
7
+ data.tar.gz: 8bcbffa756969375179cf174002003bb7f5c6ab07377b0d53f702e2e9a6c191b469f106508bc443157bcd9d0b093a48d726e9ef4a69dc40127b4a0226ce997e6
@@ -38,6 +38,7 @@ module Orats
38
38
  end
39
39
 
40
40
  def rails_template_actions
41
+ create_env_paths
41
42
  gsub_postgres_info
42
43
  gsub_redis_info
43
44
  gsub_readme
@@ -52,6 +53,17 @@ module Orats
52
53
  generate_favicons
53
54
  end
54
55
 
56
+ def create_env_paths
57
+ task 'Create the log and run state paths'
58
+
59
+ service = File.basename(@target_path)
60
+ paths = "log/#{service} tmp/#{service} log/sidekiq tmp/sidekiq"
61
+
62
+ run_from @target_path, "mkdir #{paths}"
63
+
64
+ commit 'Add log and run state paths'
65
+ end
66
+
55
67
  def gsub_postgres_info
56
68
  task 'Update the DATABASE_URL'
57
69
 
@@ -36,17 +36,20 @@ THREADS_MIN: 0
36
36
  THREADS_MAX: 1
37
37
 
38
38
  # this should equal the number of CPU cores in production
39
- # in development mode it set to 0 so puma does not go into cluster mode, unicorn
40
- # will also correctly function with 0 workers in development mode
39
+ # it is reasonable to keep it at 1 for development
41
40
  WORKERS: 1
42
41
 
43
42
  # this should equal the database pool size
44
43
  SIDEKIQ_CONCURRENCY: 5
45
44
 
45
+ # the name of the service
46
+ # this gets combined with LOG_PATH and RUN_STATE_PATH to form a full path
47
+ SERVICE: 'app_name'
48
+
46
49
  # the path where logs get written to
47
- # in production you might consider /var/log/app_name
50
+ # in production you might consider /var/log
48
51
  LOG_PATH: 'log'
49
52
 
50
53
  # the path that will contain pids and sockets
51
- # in production you will likely want to set this to '/var/run/app_name'
54
+ # in production you will likely want to set this to '/var/run'
52
55
  RUN_STATE_PATH: 'tmp'
@@ -6,15 +6,17 @@ workers ENV['WORKERS'].to_i
6
6
  if ENV['RAILS_ENV'] == 'development' || ENV['RAILS_ENV'] == 'test'
7
7
  bind 'tcp://0.0.0.0:3000'
8
8
  else
9
- bind "unix:#{ENV['RUN_STATE_PATH']}/app_name"
9
+ bind "unix:#{ENV['RUN_STATE_PATH']}/#{ENV['SERVICE']}/#{ENV['SERVICE']}"
10
10
  end
11
11
 
12
- pidfile "#{ENV['RUN_STATE_PATH']}/app_name.pid"
12
+ pidfile "#{ENV['RUN_STATE_PATH']}/#{ENV['SERVICE']}/#{ENV['SERVICE']}.pid"
13
13
 
14
14
  worker_timeout 30
15
15
 
16
- stdout_redirect "#{ENV['LOG_PATH']}/app_name.stdout.log",
17
- "#{ENV['LOG_PATH']}/app_name.stderr.log"
16
+ stdout_redirect "#{ENV['LOG_PATH']}/#{ENV['SERVICE']}/" + \
17
+ "#{ENV['SERVICE']}.access.log",
18
+ "#{ENV['LOG_PATH']}/#{ENV['SERVICE']}/" + \
19
+ "#{ENV['SERVICE']}.error.log"
18
20
 
19
21
  preload_app!
20
22
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- :pidfile: "<%= ENV['RUN_STATE_PATH'] %>/sidekiq.pid"
2
+ :pidfile: "<%= ENV['RUN_STATE_PATH'] %>/sidekiq/sidekiq.pid"
3
3
  :concurrency: <%= ENV['SIDEKIQ_CONCURRENCY'].to_i %>
4
4
  :queues:
5
5
  - default
@@ -6,15 +6,16 @@ worker_processes ENV['WORKERS'].to_i
6
6
  if ENV['RAILS_ENV'] == 'development' || ENV['RAILS_ENV'] == 'test'
7
7
  listen '0.0.0.0:3000'
8
8
  else
9
- listen "unix:#{ENV['RUN_STATE_PATH']}/app_name", backlog: 64
9
+ listen "unix:#{ENV['RUN_STATE_PATH']}/#{ENV['SERVICE']}/#{ENV['SERVICE']}",
10
+ backlog: 64
10
11
  end
11
12
 
12
- pid "#{ENV['RUN_STATE_PATH']}/app_name.pid"
13
+ pid "#{ENV['RUN_STATE_PATH']}/#{ENV['SERVICE']}/#{ENV['SERVICE']}.pid"
13
14
 
14
15
  timeout 30
15
16
 
16
- stdout_path "#{ENV['LOG_PATH']}/app_name.stdout.log"
17
- stderr_path "#{ENV['LOG_PATH']}/app_name.stderr.log"
17
+ stdout_path "#{ENV['LOG_PATH']}/#{ENV['SERVICE']}/#{ENV['SERVICE']}.access.log"
18
+ stderr_path "#{ENV['LOG_PATH']}/#{ENV['SERVICE']}/#{ENV['SERVICE']}.error.log"
18
19
 
19
20
  preload_app true
20
21
 
data/lib/orats/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # set the version of this gem
2
2
  module Orats
3
- VERSION = '0.9.0'
3
+ VERSION = '0.9.1'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: orats
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Janetakis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-04 00:00:00.000000000 Z
11
+ date: 2014-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor