capistrano-background 0.1.3 → 0.2.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: c7cf30a97b71b01cd667c9e7532d3df8bd7aa059
4
- data.tar.gz: 2aeaeae84fd996c505c0b30365a558f3d037a2f7
3
+ metadata.gz: cf36b42b2735b7e571137771f131ffc4e979454a
4
+ data.tar.gz: 12f0d135735a6d1f0a17195cbef3342297f6e4f1
5
5
  SHA512:
6
- metadata.gz: e1be3ae22efe69e4fc54b990f82eb00642e1fefd93ffbe91a2676c2a9a17d720cd904fd3947818a6b6cb630dfdd9d70fe10297d872933606449ee2a04776bc94
7
- data.tar.gz: f7aa6be5d1509f1ee1aa89ad826bc37e6e76eb71695fcf51e7a51709c40279cc93a1fcf570d12a403dac6bab864bce0f21162960613ae8dcb72f4d29b88d21ac
6
+ metadata.gz: 53d8cb1b7d8b40520812000265f5dd9bbcbf43e1b5c375107404f75f138d7a919631b11804ceb35eacb6d7bc5918e8a054c8dcc89e3e35c398433899ed9e02f2
7
+ data.tar.gz: 47adfc11b15c3ba8a0880a8044260859a278611b3027b83f83ac47399dd1197bdc9a532d02d85c75d850d794f236f5ee0fdd04e76c8d19369a3a0254bd7bf659
@@ -1,3 +1,8 @@
1
+ # v0.2.0 / 2015-11-15
2
+
3
+ * Fixed quiet bug.
4
+ * Remove add_background_process method.
5
+
1
6
  # v0.1.3 / 2015-11-02
2
7
 
3
8
  Termniate process correctly.
data/README.md CHANGED
@@ -26,11 +26,12 @@ require 'capistrano/background'
26
26
  ```
27
27
  Add your background processes.
28
28
  ```Ruby
29
- add_background_process({
30
- :id => :scheduler,
31
- :execute => [:rake, 'scheduler'],
32
- :timeout => 60 # kill process after waiting this time (seconds)
33
- })
29
+ set :background_processes, {
30
+ :scheduler => {
31
+ :execute => [:rake, 'scheduler'],
32
+ :timeout => 60 # kill process after waiting this time (seconds)
33
+ }
34
+ }
34
35
  ```
35
36
  It will run `rake scheduler` in background when deploy. You can also use command:
36
37
 
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Background
3
- VERSION = "0.1.3"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
@@ -15,8 +15,6 @@ namespace :deploy do
15
15
  end
16
16
 
17
17
  namespace :background do
18
- processes = []
19
-
20
18
  def get_pid_file(options)
21
19
  options[:pid_file] || File.join(shared_path, 'tmp', 'pids', "#{options[:id]}.pid")
22
20
  end
@@ -30,7 +28,7 @@ namespace :background do
30
28
  end
31
29
 
32
30
  def quiet_process(pid_file)
33
- if file_exists? pid_file
31
+ if pid_process_exists? pid_file
34
32
  background "kill -TERM `cat #{pid_file}`"
35
33
  end
36
34
  end
@@ -47,7 +45,7 @@ namespace :background do
47
45
  def stop_process(pid_file, timeout)
48
46
  if file_exists? pid_file
49
47
  if pid_process_exists? pid_file
50
- rake "terminate `cat #{pid_file}` -- -t #{timeout}"
48
+ execute :bundle, :exec, *%{terminate `cat #{pid_file}` -t #{timeout}}
51
49
  end
52
50
  execute "rm #{pid_file}"
53
51
  end
@@ -63,7 +61,8 @@ namespace :background do
63
61
  desc 'Quiet background processes'
64
62
  task :quiet do
65
63
  background_processes = fetch :background_processes
66
- background_processes.each do |options|
64
+ background_processes.each do |id, options|
65
+ options[:id] = id
67
66
  role = options[:role] || :app
68
67
  on roles role do
69
68
  within release_path do
@@ -76,7 +75,8 @@ namespace :background do
76
75
  desc 'Stop background processes'
77
76
  task :stop do
78
77
  background_processes = fetch :background_processes
79
- background_processes.each do |options|
78
+ background_processes.each do |id, options|
79
+ options[:id] = id
80
80
  role = options[:role] || :app
81
81
  on roles role do
82
82
  within release_path do
@@ -89,7 +89,8 @@ namespace :background do
89
89
  desc 'Start background processes'
90
90
  task :start do
91
91
  background_processes = fetch :background_processes
92
- background_processes.each do |options|
92
+ background_processes.each do |id, options|
93
+ options[:id] = id
93
94
  role = options[:role] || :app
94
95
  on roles role do
95
96
  within release_path do
@@ -106,8 +107,3 @@ namespace :background do
106
107
  invoke 'background:start'
107
108
  end
108
109
  end
109
-
110
- def add_background_process(options)
111
- background_processes = fetch :background_processes
112
- background_processes << options
113
- end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-background
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chen Yi-Cyuan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-02 00:00:00.000000000 Z
11
+ date: 2015-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -95,8 +95,6 @@ files:
95
95
  - LICENSE.txt
96
96
  - README.md
97
97
  - Rakefile
98
- - bin/console
99
- - bin/setup
100
98
  - capistrano-background.gemspec
101
99
  - lib/capistrano-background.rb
102
100
  - lib/capistrano/background.rb
@@ -123,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
121
  version: '0'
124
122
  requirements: []
125
123
  rubyforge_project:
126
- rubygems_version: 2.4.5
124
+ rubygems_version: 2.4.8
127
125
  signing_key:
128
126
  specification_version: 4
129
127
  summary: Run background process for capistrano.
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "capistrano/background"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start
data/bin/setup DELETED
@@ -1,7 +0,0 @@
1
- #!/bin/bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
-
5
- bundle install
6
-
7
- # Do any other automated setup that you need to do here