pushapp 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 581802672a70b770190de57da287d0b9a642b729
4
- data.tar.gz: ff36bd457647002226a93f6e1333fe6595bfe945
3
+ metadata.gz: 98a8bbfa81a6ec450adb340f2d5c8210b265ed4b
4
+ data.tar.gz: c188d207ccc5b569cb5c46a239679e38ee24e8c1
5
5
  SHA512:
6
- metadata.gz: 6d180c3770161ae1b9902bbd472c012c6f4b7891065d0f8f36dcf9e5d2d0ce443d293bace1fa40654a3724dbeaaf9c2e99e1f9c5967d3238d7db5d6544ef5d2d
7
- data.tar.gz: 65fe24e674fdfbe7b07dd6a8a4aa761f87ce0689353f0b113e1c44c693510ac5b9d7bd1a6a73bb16ed6b89cf887380e85f541721951af8dce6d03b973b4a9fe8
6
+ metadata.gz: 03bb4b8fbd3fe162315affabdb4aa6b18c3249b2ed9bc4579384fc782e9224dfcb15ed9efdd00bca05a3bb022a613d8831b5e4ccab0e6582d54f61784979e3c1
7
+ data.tar.gz: df2a3f65d229521cf013be4a56f37eadde3893fec76d6783781f5ce86120b1c4a688ee6fc262d3a5e2098fc5cc93cb0ab07a1ba2b32eb5eeb8c2b4f1cc75ac7c
@@ -49,7 +49,7 @@ module Pushapp
49
49
  template 'unicorn.rb.erb', 'config/unicorn.rb'
50
50
  end
51
51
 
52
- desc 'chef-solor REMOTE', 'generates chef solo with knife solo configs'
52
+ desc 'chef-solo REMOTE', 'generates chef solo with knife solo configs'
53
53
  method_option :database,
54
54
  type: :string,
55
55
  default: 'postgresql',
@@ -1,3 +1,3 @@
1
1
  module Pushapp
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
@@ -1,13 +1,23 @@
1
1
  #!/bin/bash
2
2
 
3
- if [ -f tmp/pids/unicorn.pid ]; then
4
- unicorn_pid_file=tmp/pids/unicorn.pid
3
+ unicorn_pid_file=tmp/pids/unicorn.pid
4
+
5
+ if [ -f $unicorn_pid_file ]; then
5
6
  # Someone restarted the master; wait for the new master to exit.
6
- PID=`cat $unicorn_pid_file`
7
7
 
8
- while kill -0 $PID; do
8
+ function graceful_shutdown {
9
+ echo "Initializing graceful shutdown"
10
+ kill -QUIT `cat $unicorn_pid_file`
11
+
12
+ # Git unicorn some time to stop
13
+ sleep 1
14
+ }
15
+
16
+ # Trap upstart stop (TERM) and send QUIT to unicorn
17
+ trap graceful_shutdown TERM
18
+
19
+ while [ -f $unicorn_pid_file ] && kill -0 `cat $unicorn_pid_file`; do
9
20
  sleep 2
10
- PID=`cat $unicorn_pid_file`
11
21
  done
12
22
 
13
23
  # If we get here, the master has exited, either because someone restarted
@@ -16,8 +26,8 @@ if [ -f tmp/pids/unicorn.pid ]; then
16
26
  # The sleep above is a tradeoff between polling load and mimizing the
17
27
  # restart delay when the master dies for real (which should hopefully be
18
28
  # rare).
19
- rm $unicorn_pid_file
29
+ rm -f $unicorn_pid_file
20
30
  else
21
31
  # Run the unicorn master process (this won't return until it exits).
22
- bundle exec unicorn -E $RAILS_ENV -c config/unicorn.rb
32
+ exec bundle exec unicorn -E $RAILS_ENV -c config/unicorn.rb
23
33
  fi
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pushapp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yury Korolev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-05 00:00:00.000000000 Z
11
+ date: 2013-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor