kapify 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. data/.gitignore +18 -0
  2. data/Gemfile +4 -0
  3. data/LICENSE.txt +22 -0
  4. data/README.md +51 -0
  5. data/Rakefile +1 -0
  6. data/kapify.gemspec +22 -0
  7. data/lib/generators/kapify/base.rb +9 -0
  8. data/lib/generators/kapify/logrotate/USAGE +9 -0
  9. data/lib/generators/kapify/logrotate/logrotate_generator.rb +14 -0
  10. data/lib/generators/kapify/logrotate/templates/logrotate.erb +8 -0
  11. data/lib/generators/kapify/nginx/USAGE +9 -0
  12. data/lib/generators/kapify/nginx/nginx_generator.rb +14 -0
  13. data/lib/generators/kapify/nginx/templates/nginx_conf.erb +85 -0
  14. data/lib/generators/kapify/pg/USAGE +9 -0
  15. data/lib/generators/kapify/pg/pg_generator.rb +14 -0
  16. data/lib/generators/kapify/pg/templates/database.yml.erb +8 -0
  17. data/lib/generators/kapify/resque/USAGE +9 -0
  18. data/lib/generators/kapify/resque/resque_generator.rb +14 -0
  19. data/lib/generators/kapify/resque/templates/resque_init.erb +89 -0
  20. data/lib/generators/kapify/unicorn/USAGE +9 -0
  21. data/lib/generators/kapify/unicorn/templates/unicorn.rb.erb +48 -0
  22. data/lib/generators/kapify/unicorn/templates/unicorn_init.erb +84 -0
  23. data/lib/generators/kapify/unicorn/unicorn_generator.rb +15 -0
  24. data/lib/kapify/base.rb +17 -0
  25. data/lib/kapify/logrotate/README.md +83 -0
  26. data/lib/kapify/logrotate/configuration.rb +15 -0
  27. data/lib/kapify/logrotate.rb +1 -0
  28. data/lib/kapify/nginx/README.md +105 -0
  29. data/lib/kapify/nginx/configuration.rb +41 -0
  30. data/lib/kapify/nginx.rb +1 -0
  31. data/lib/kapify/pg/README.md +118 -0
  32. data/lib/kapify/pg/configuration.rb +52 -0
  33. data/lib/kapify/pg.rb +1 -0
  34. data/lib/kapify/resque/README.md +104 -0
  35. data/lib/kapify/resque/configuration.rb +34 -0
  36. data/lib/kapify/resque.rb +1 -0
  37. data/lib/kapify/unicorn/README.md +109 -0
  38. data/lib/kapify/unicorn/configuration.rb +35 -0
  39. data/lib/kapify/unicorn.rb +2 -0
  40. data/lib/kapify/version.rb +3 -0
  41. data/lib/kapify.rb +5 -0
  42. metadata +125 -0
@@ -0,0 +1,35 @@
1
+ require 'capistrano'
2
+ require 'kapify/base'
3
+
4
+ Capistrano::Configuration.instance.load do
5
+ set_default(:unicorn_pid, "#{current_path}/tmp/pids/unicorn.pid")
6
+ set_default(:unicorn_config, "#{shared_path}/config/unicorn.rb")
7
+ set_default(:unicorn_log, "#{shared_path}/log/unicorn.log")
8
+ set_default(:unicorn_user, user)
9
+ set_default(:unicorn_workers) { Capistrano::CLI.ui.ask "Number of unicorn workers: " }
10
+
11
+ namespace :kapify do
12
+ namespace :unicorn do
13
+ desc "Setup Unicorn initializer and app configuration"
14
+ task :setup, roles: :app do
15
+ run "mkdir -p #{shared_path}/config"
16
+ kapify_template "unicorn", "unicorn.rb.erb", unicorn_config
17
+ kapify_template "unicorn", "unicorn_init.erb", "/tmp/unicorn_init"
18
+ run "chmod +x /tmp/unicorn_init"
19
+ run "#{sudo} mv /tmp/unicorn_init /etc/init.d/unicorn_#{application}"
20
+ run "#{sudo} update-rc.d -f unicorn_#{application} defaults"
21
+ end
22
+
23
+ after "deploy:setup", "kapify:unicorn:setup"
24
+
25
+ %w[start stop restart].each do |command|
26
+ desc "#{command} unicorn"
27
+ task command, roles: :app do
28
+ run "service unicorn_#{application} #{command}"
29
+ end
30
+
31
+ after "deploy:#{command}", "kapify:unicorn:#{command}"
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,2 @@
1
+ require 'kapify/unicorn/configuration'
2
+
@@ -0,0 +1,3 @@
1
+ module Kapify
2
+ VERSION = "0.0.1"
3
+ end
data/lib/kapify.rb ADDED
@@ -0,0 +1,5 @@
1
+ require "kapify/version"
2
+
3
+ module Kapify
4
+ # Your code goes here...
5
+ end
metadata ADDED
@@ -0,0 +1,125 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: kapify
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Ivan Tkalin
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-12-12 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ prerelease: false
16
+ name: capistrano
17
+ version_requirements: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '2.0'
22
+ none: false
23
+ requirement: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ! '>='
26
+ - !ruby/object:Gem::Version
27
+ version: '2.0'
28
+ none: false
29
+ type: :runtime
30
+ - !ruby/object:Gem::Dependency
31
+ prerelease: false
32
+ name: rake
33
+ version_requirements: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ none: false
39
+ requirement: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ none: false
45
+ type: :development
46
+ description: Capistrano recipes useful for rails app deployment. Includes repices
47
+ for nginx, unicorn, postgres, logrotate, resque
48
+ email:
49
+ - itkalin@gmail.com
50
+ executables: []
51
+ extensions: []
52
+ extra_rdoc_files: []
53
+ files:
54
+ - .gitignore
55
+ - Gemfile
56
+ - LICENSE.txt
57
+ - README.md
58
+ - Rakefile
59
+ - kapify.gemspec
60
+ - lib/generators/kapify/base.rb
61
+ - lib/generators/kapify/logrotate/USAGE
62
+ - lib/generators/kapify/logrotate/logrotate_generator.rb
63
+ - lib/generators/kapify/logrotate/templates/logrotate.erb
64
+ - lib/generators/kapify/nginx/USAGE
65
+ - lib/generators/kapify/nginx/nginx_generator.rb
66
+ - lib/generators/kapify/nginx/templates/nginx_conf.erb
67
+ - lib/generators/kapify/pg/USAGE
68
+ - lib/generators/kapify/pg/pg_generator.rb
69
+ - lib/generators/kapify/pg/templates/database.yml.erb
70
+ - lib/generators/kapify/resque/USAGE
71
+ - lib/generators/kapify/resque/resque_generator.rb
72
+ - lib/generators/kapify/resque/templates/resque_init.erb
73
+ - lib/generators/kapify/unicorn/USAGE
74
+ - lib/generators/kapify/unicorn/templates/unicorn.rb.erb
75
+ - lib/generators/kapify/unicorn/templates/unicorn_init.erb
76
+ - lib/generators/kapify/unicorn/unicorn_generator.rb
77
+ - lib/kapify.rb
78
+ - lib/kapify/base.rb
79
+ - lib/kapify/logrotate.rb
80
+ - lib/kapify/logrotate/README.md
81
+ - lib/kapify/logrotate/configuration.rb
82
+ - lib/kapify/nginx.rb
83
+ - lib/kapify/nginx/README.md
84
+ - lib/kapify/nginx/configuration.rb
85
+ - lib/kapify/pg.rb
86
+ - lib/kapify/pg/README.md
87
+ - lib/kapify/pg/configuration.rb
88
+ - lib/kapify/resque.rb
89
+ - lib/kapify/resque/README.md
90
+ - lib/kapify/resque/configuration.rb
91
+ - lib/kapify/unicorn.rb
92
+ - lib/kapify/unicorn/README.md
93
+ - lib/kapify/unicorn/configuration.rb
94
+ - lib/kapify/version.rb
95
+ homepage: https://github.com/ivalkeen/kapify
96
+ licenses: []
97
+ post_install_message:
98
+ rdoc_options: []
99
+ require_paths:
100
+ - lib
101
+ required_ruby_version: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - ! '>='
104
+ - !ruby/object:Gem::Version
105
+ version: '0'
106
+ segments:
107
+ - 0
108
+ hash: -2257984664969805780
109
+ none: false
110
+ required_rubygems_version: !ruby/object:Gem::Requirement
111
+ requirements:
112
+ - - ! '>='
113
+ - !ruby/object:Gem::Version
114
+ version: '0'
115
+ segments:
116
+ - 0
117
+ hash: -2257984664969805780
118
+ none: false
119
+ requirements: []
120
+ rubyforge_project:
121
+ rubygems_version: 1.8.23
122
+ signing_key:
123
+ specification_version: 3
124
+ summary: Capistrano recipes useful for rails app deployment
125
+ test_files: []