Commit 85198748e0cb593574b093bdefbe77bc8a42e6a4
1 parent
b7399ea9
Exists in
master
and in
29 other branches
Update scripts to start/stop Solr
Showing
5 changed files
with
15 additions
and
17 deletions
Show diff stats
etc/init.d/noosfero
... | ... | @@ -43,7 +43,7 @@ if [ -z "$NOOSFERO_DIR" ] || [ -z "$NOOSFERO_USER" ]; then |
43 | 43 | fi |
44 | 44 | |
45 | 45 | ###################### |
46 | -FERRET_PID_FILE=$NOOSFERO_DIR/tmp/pids/ferret.production.pid | |
46 | +SOLR_PID_FILE=$NOOSFERO_DIR/tmp/pids/solr.production.pid | |
47 | 47 | |
48 | 48 | main_script() { |
49 | 49 | cd $NOOSFERO_DIR |
... | ... | @@ -90,8 +90,8 @@ do_setup() { |
90 | 90 | |
91 | 91 | do_start() { |
92 | 92 | |
93 | - # FIXME should not test for ferret only | |
94 | - if [ -e $FERRET_PID_FILE ]; then | |
93 | + # FIXME should not test for solr only | |
94 | + if [ -e $SOLR_PID_FILE ]; then | |
95 | 95 | echo 'noosfero already running, cannot start.' |
96 | 96 | exit 2 |
97 | 97 | fi |
... | ... | @@ -104,8 +104,8 @@ do_start() { |
104 | 104 | |
105 | 105 | do_stop() { |
106 | 106 | |
107 | - # FIXME should not test for ferret only | |
108 | - if [ ! -e $FERRET_PID_FILE ]; then | |
107 | + # FIXME should not test for solr only | |
108 | + if [ ! -e $SOLR_PID_FILE ]; then | |
109 | 109 | echo 'noosfero not running, cannot stop' |
110 | 110 | exit 2 |
111 | 111 | fi | ... | ... |
lib/tasks/test.rake
... | ... | @@ -7,6 +7,9 @@ else |
7 | 7 | end |
8 | 8 | |
9 | 9 | task :test do |
10 | + ENV['RAILS_ENV'] = 'test' | |
11 | + Rake::Task['solr:stop'].invoke | |
12 | + Rake::Task['solr:start'].invoke | |
10 | 13 | errors = %w(test:units test:functionals test:integration cucumber selenium).collect do |task| |
11 | 14 | begin |
12 | 15 | Rake::Task[task].invoke |
... | ... | @@ -15,6 +18,7 @@ task :test do |
15 | 18 | task |
16 | 19 | end |
17 | 20 | end.compact |
21 | + Rake::Task['solr:stop'].invoke | |
18 | 22 | abort "Errors running #{errors.to_sentence}!" if errors.any? |
19 | 23 | end |
20 | 24 | ... | ... |
script/development
1 | 1 | #!/bin/sh |
2 | 2 | |
3 | +export RAILS_ENV=development | |
4 | + | |
3 | 5 | stop() { |
4 | 6 | ./script/delayed_job stop |
5 | 7 | ./script/feed-updater stop |
8 | + rake -s solr:stop | |
6 | 9 | } |
7 | 10 | |
8 | 11 | start() { |
9 | 12 | ./script/feed-updater start |
10 | 13 | ./script/delayed_job start |
14 | + rake -s solr:start | |
11 | 15 | trap stop INT TERM |
12 | 16 | ./script/server $@ |
13 | 17 | } | ... | ... |
script/ferret_server
script/production
... | ... | @@ -22,7 +22,7 @@ do_start() { |
22 | 22 | fi |
23 | 23 | |
24 | 24 | clear_cache |
25 | - ./script/ferret_server -e $RAILS_ENV start | |
25 | + rake -s solr:start | |
26 | 26 | environments_loop |
27 | 27 | mongrel_rails cluster::start |
28 | 28 | } |
... | ... | @@ -31,7 +31,7 @@ do_stop() { |
31 | 31 | mongrel_rails cluster::stop |
32 | 32 | ./script/delayed_job stop |
33 | 33 | ./script/feed-updater stop |
34 | - ./script/ferret_server -e $RAILS_ENV stop | |
34 | + rake -s solr:stop | |
35 | 35 | } |
36 | 36 | |
37 | 37 | environments_loop() { | ... | ... |