Commit 95f60309888c2a645896698c6fdc1533f481bfd5
Exists in
master
and in
29 other branches
Merge branch 'stable'
Conflicts: script/production
Showing
1 changed file
with
8 additions
and
10 deletions
Show diff stats
script/production
@@ -35,7 +35,7 @@ do_start() { | @@ -35,7 +35,7 @@ do_start() { | ||
35 | 35 | ||
36 | clear_cache | 36 | clear_cache |
37 | ./script/ferret_server -e $RAILS_ENV start | 37 | ./script/ferret_server -e $RAILS_ENV start |
38 | - environments_loop | 38 | + environments_loop start |
39 | ruby -S thin -C config/thin.yml start | 39 | ruby -S thin -C config/thin.yml start |
40 | } | 40 | } |
41 | 41 | ||
@@ -49,11 +49,8 @@ do_stop() { | @@ -49,11 +49,8 @@ do_stop() { | ||
49 | ruby -S thin -C config/thin.yml stop || | 49 | ruby -S thin -C config/thin.yml stop || |
50 | stop_via_pid_file tmp/pids/thin.*.pid | 50 | stop_via_pid_file tmp/pids/thin.*.pid |
51 | 51 | ||
52 | - ./script/delayed_job stop || | ||
53 | - stop_via_pid_file tmp/pids/delayed_job.pid | ||
54 | - | ||
55 | - ./script/feed-updater stop || | ||
56 | - stop_via_pid_file tmp/pids/feed-updater.default.pid | 52 | + environments_loop stop || |
53 | + stop_via_pid_file tmp/pids/delayed_job.pid tmp/pids/delayed_job.*.pid tmp/pids/feed-updater.*.pid | ||
57 | 54 | ||
58 | ./script/ferret_server -e $RAILS_ENV stop || | 55 | ./script/ferret_server -e $RAILS_ENV stop || |
59 | stop_via_pid_file tmp/pids/ferret.production.pid | 56 | stop_via_pid_file tmp/pids/ferret.production.pid |
@@ -71,16 +68,17 @@ stop_via_pid_file() { | @@ -71,16 +68,17 @@ stop_via_pid_file() { | ||
71 | } | 68 | } |
72 | 69 | ||
73 | environments_loop() { | 70 | environments_loop() { |
71 | + action="$1" | ||
74 | environments=$(find ./config/environments -name *_$RAILS_ENV.rb) | 72 | environments=$(find ./config/environments -name *_$RAILS_ENV.rb) |
75 | if [ "$environments" ]; then | 73 | if [ "$environments" ]; then |
76 | for environment in $environments; do | 74 | for environment in $environments; do |
77 | env=$(basename $environment | cut -d. -f1) | 75 | env=$(basename $environment | cut -d. -f1) |
78 | - RAILS_ENV=$env ./script/delayed_job -i $env start | ||
79 | - RAILS_ENV=$env ./script/feed-updater start -i $env | 76 | + RAILS_ENV=$env ./script/delayed_job -i $env "$action" |
77 | + RAILS_ENV=$env ./script/feed-updater "$action" -i $env | ||
80 | done | 78 | done |
81 | else | 79 | else |
82 | - ./script/delayed_job start | ||
83 | - ./script/feed-updater start | 80 | + ./script/delayed_job "$action" |
81 | + ./script/feed-updater "$action" | ||
84 | fi | 82 | fi |
85 | } | 83 | } |
86 | 84 |