mina-extras 0.0.7 → 0.0.8

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: 6e73b3009a52551554f447b5c753572fb5f66e6c
4
- data.tar.gz: 9849a23e62d868a7f3bd7cc7fed41266f3622e7f
3
+ metadata.gz: 9ce6fa4c8ce44da5d61ce6e133194275a38ebb93
4
+ data.tar.gz: e4b55f9022a8c8477a32c196f7a998131e198602
5
5
  SHA512:
6
- metadata.gz: 1bafcb47850202b895fd07f24adefe8f1cfbc9c41d50a71f3a2e42e702c06c810e3972c60c14de49aa47cfb09072c93d2d9d3aac9711e7bab355ee443c995138
7
- data.tar.gz: 0b56db97ede2ba8cd6fc715a2f013823a50b379c6db195f0ba2f148b7c67cd7eea5c38ac8b64d2ad86c05c428ef2b8dfc8a259b59b1c9051a82e7c404f149ab9
6
+ metadata.gz: f36fa0bce7f4a906e873d868db6b43ee7639b171eb612ae987ed9cdcfd93af904e22e1f4ab3f098b6c7ff2d0eab57b5b1edfdd3b0b712cdf43c454860c326c40
7
+ data.tar.gz: b717139ed9a712439c00ce716bb6c4bc344267ad9f401f877129fcdd8692950ed62ab04ea1cf08509568b8901ff5d049423cc9143a6b016c1afd385205df1ec1
@@ -1,17 +1,18 @@
1
1
  namespace :puma do
2
2
  task :config do
3
- cmd_prefix = "cd #{deploy_to}/#{current_path} ; "
4
- cmd_prefix += "RAILS_ENV=#{rails_env!} NEW_RELIC_DISPATCHER=puma bundle exec"
5
- set :puma_start_cmd, "#{cmd_prefix} puma -C #{File.join(deploy_to,current_path,'config','puma.rb')}"
6
- set :puma_stop_cmd, "#{cmd_prefix} pumactl -S #{deploy_to}/#{shared_path}/sockets/puma.state stop"
7
- set :puma_restart_cmd, "#{cmd_prefix} pumactl -S #{deploy_to}/#{shared_path}/sockets/puma.state phased-restart"
3
+ set :puma_cmd_prefix, "cd #{deploy_to}/#{current_path} ; RAILS_ENV=#{rails_env!}"
4
+ set :puma_pid_path, "#{deploy_to}/#{shared_path}/pids/puma.pid"
5
+ set :puma_sock_dir, "#{deploy_to}/#{shared_path}/sockets"
6
+ set :puma_start_cmd, "bundle exec puma -C #{File.join(deploy_to,current_path,'config','puma.rb')}"
7
+ set :puma_stop_cmd, "bundle exec pumactl -S #{puma_sock_dir}/puma.state stop"
8
+ set :puma_restart_cmd, "bundle exec pumactl -S #{puma_sock_dir}/puma.state phased-restart"
8
9
  end
9
10
 
10
11
  desc 'Start puma'
11
12
  task :start => [:config, :environment] do
12
13
  queue %{
13
14
  echo "-----> Starting puma"
14
- #{echo_cmd puma_start_cmd}
15
+ #{echo_cmd "#{puma_cmd_prefix} #{puma_start_cmd}"}
15
16
  }
16
17
  end
17
18
 
@@ -19,23 +20,23 @@ namespace :puma do
19
20
  task :stop => [:config, :environment] do
20
21
  queue %{
21
22
  echo "-----> Stopping puma"
22
- #{echo_cmd puma_stop_cmd}
23
+ #{echo_cmd "#{puma_cmd_prefix} #{puma_stop_cmd}"}
23
24
  }
24
25
  end
25
26
 
26
27
  desc 'Restart puma'
27
28
  task :restart => [:config, :environment] do
28
29
  queue %{
29
- PUMA_PID=$(cat "#{deploy_to}/#{shared_path}/pids/puma.pid")
30
+ PUMA_PID=$(cat "#{puma_pid_path}")
30
31
  kill -0 $PUMA_PID > /dev/null 2>&1
31
32
  if [ $? != 0 ]; then
32
- rm "#{deploy_to}/#{shared_path}/sockets/pumactl.sock" > /dev/null 2>&1
33
- rm "#{deploy_to}/#{shared_path}/sockets/puma.sock" > /dev/null 2>&1
33
+ rm "#{puma_sock_dir}/pumactl.sock" > /dev/null 2>&1
34
+ rm "#{puma_sock_dir}/puma.sock" > /dev/null 2>&1
34
35
  echo "-----> Starting puma"
35
- #{echo_cmd puma_start_cmd}
36
+ #{echo_cmd "#{puma_cmd_prefix} #{puma_start_cmd}"}
36
37
  else
37
38
  echo "-----> Restarting puma"
38
- #{echo_cmd puma_restart_cmd}
39
+ #{echo_cmd "#{puma_cmd_prefix} #{puma_restart_cmd}"}
39
40
  fi
40
41
  }
41
42
  end
@@ -0,0 +1,57 @@
1
+ namespace :unicorn do
2
+ task :config do
3
+ cmd_prefix = "cd #{deploy_to}/#{current_path} ; "
4
+ cmd_prefix += "RAILS_ENV=#{rails_env!} bundle exec"
5
+ config_file_path = "#{File.join(deploy_to,current_path,'config','unicorn.rb')}"
6
+ pid_path = "#{File.join(deploy_to,current_path,'tmp','pids')}"
7
+ pid_file = "#{File.join(pid_path,'unicorn.pid')}"
8
+
9
+ set :unicorn_start_cmd, "#{cmd_prefix} unicorn -c #{config_file_path} -D -E production"
10
+ set :unicorn_stop_cmd, "kill -s QUIT `cat #{pid_file}`"
11
+ set :unicorn_terminate_cmd, "kill -s TERM `cat #{pid_file}`"
12
+ set :unicorn_setup_cmd, "mkdir -p #{pid_path}"
13
+ end
14
+
15
+ desc 'Start Unicorn'
16
+ task :start => [:config, :environment] do
17
+ queue %{
18
+ echo "------> Starting Unicorn"
19
+ #{echo_cmd unicorn_start_cmd}
20
+ }
21
+ end
22
+
23
+ desc 'Stop Unicorn'
24
+ task :stop => [:config, :environment] do
25
+ queue %{
26
+ echo "------> Stopping Unicorn"
27
+ #{echo_cmd unicorn_stop_cmd}
28
+ }
29
+ end
30
+
31
+ desc 'Stop Unicorn'
32
+ task 'force-stop' => [:config, :environment] do
33
+ queue %{
34
+ echo "------> Force stopping Unicorn"
35
+ #{echo_cmd unicorn_terminate_cmd}
36
+ }
37
+ end
38
+
39
+ desc 'Restart Unicorn'
40
+ task :restart => [:config, :environment] do
41
+ queue %{
42
+ echo "------> Stopping Unicorn"
43
+ #{echo_cmd unicorn_stop_cmd}
44
+ echo "------> Starting Unicorn"
45
+ #{echo_cmd unicorn_start_cmd}
46
+ }
47
+ end
48
+
49
+ desc 'Setup paths'
50
+ task :setup => [:config, :environment] do
51
+ queue %{
52
+ echo "------> creating pid folder"
53
+ #{echo_cmd unicorn_setup_cmd}
54
+ }
55
+ end
56
+
57
+ end
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mina-extras
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Berdajs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-08 00:00:00.000000000 Z
11
+ date: 2014-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mina
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  description: Provides extra Mina deploy tasks for Puma, RVM, Faye.
@@ -35,6 +35,7 @@ files:
35
35
  - lib/mina-extras/jruby-patch.rb
36
36
  - lib/mina-extras/puma.rb
37
37
  - lib/mina-extras/rvm.rb
38
+ - lib/mina-extras/unicorn.rb
38
39
  - lib/mina-extras/whenever.rb
39
40
  homepage: https://github.com/mrbrdo/mina-extras
40
41
  licenses:
@@ -46,17 +47,17 @@ require_paths:
46
47
  - lib
47
48
  required_ruby_version: !ruby/object:Gem::Requirement
48
49
  requirements:
49
- - - '>='
50
+ - - ">="
50
51
  - !ruby/object:Gem::Version
51
52
  version: '0'
52
53
  required_rubygems_version: !ruby/object:Gem::Requirement
53
54
  requirements:
54
- - - '>='
55
+ - - ">="
55
56
  - !ruby/object:Gem::Version
56
57
  version: '0'
57
58
  requirements: []
58
59
  rubyforge_project:
59
- rubygems_version: 2.0.6
60
+ rubygems_version: 2.2.2
60
61
  signing_key:
61
62
  specification_version: 4
62
63
  summary: extra mina deploy tasks