app_maint 0.0.9 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module AppMaint
2
- VERSION = "0.0.9"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -1,24 +1,30 @@
1
1
  Capistrano::Configuration.instance.load do
2
2
  namespace :unicorn do
3
- with_unicorn = (exists? :unicorn_workers) ? true : false
4
-
5
3
  desc "Setup Unicorn initializer and app configuration"
6
4
  task :setup, roles: :app do
7
- run "mkdir -p #{shared_path}/config"
8
- template "unicorn.rb.erb", "#{shared_path}/config/unicorn.rb"
9
- template "unicorn_init.erb", "/tmp/unicorn_init"
10
- run "chmod +x /tmp/unicorn_init"
11
- run "#{sudo} mv /tmp/unicorn_init /etc/init.d/unicorn_#{application}"
12
- run "#{sudo} update-rc.d -f unicorn_#{application} defaults 1>/dev/null"
5
+ if exists? :unicorn_workers
6
+ run "mkdir -p #{shared_path}/config"
7
+ template "unicorn.rb.erb", "#{shared_path}/config/unicorn.rb"
8
+ template "unicorn_init.erb", "/tmp/unicorn_init"
9
+ run "chmod +x /tmp/unicorn_init"
10
+ run "#{sudo} mv /tmp/unicorn_init /etc/init.d/unicorn_#{application}"
11
+ run "#{sudo} update-rc.d -f unicorn_#{application} defaults 1>/dev/null"
12
+ else
13
+ puts "There's nothing to do."
14
+ end
13
15
  end
14
- after "deploy:setup", "unicorn:setup" if with_unicorn
16
+ after "deploy:setup", "unicorn:setup"
15
17
 
16
18
  %w[start stop restart].each do |command|
17
19
  desc "#{command} unicorn"
18
20
  task command, roles: :app do
19
- run "service unicorn_#{application} #{command}"
21
+ if exists? :unicorn_workers
22
+ run "service unicorn_#{application} #{command}"
23
+ else
24
+ puts "There's nothing to do."
25
+ end
20
26
  end
21
- after "deploy:#{command}", "unicorn:#{command}" if with_unicorn
27
+ after "deploy:#{command}", "unicorn:#{command}"
22
28
  end
23
29
  end
24
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app_maint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-14 00:00:00.000000000 Z
12
+ date: 2013-03-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -110,7 +110,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
110
110
  version: '0'
111
111
  segments:
112
112
  - 0
113
- hash: -4605339574701408258
113
+ hash: 2247933768900697478
114
114
  required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  none: false
116
116
  requirements:
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  version: '0'
120
120
  segments:
121
121
  - 0
122
- hash: -4605339574701408258
122
+ hash: 2247933768900697478
123
123
  requirements: []
124
124
  rubyforge_project:
125
125
  rubygems_version: 1.8.23