development
881 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh
set -e
export RAILS_ENV=development
stop() {
echo "Stopping ..."
./script/delayed_job stop
./script/feed-updater stop
whenever --clear-crontab
if [ -f tmp/pids/unicorn.pid ]; then
kill -9 $(cat tmp/pids/unicorn.pid)
rm -f tmp/pids/unicorn.pid
fi
exit
}
start() {
rake db:abort_if_pending_migrations
./script/feed-updater start
./script/delayed_job start
trap stop INT TERM EXIT
whenever --write-crontab --set 'environment=development'
mkdir -p log
touch log/development.log log/development_api.log
if [ -z "$RAILS_RELATIVE_URL_ROOT" ]; then
unicorn_rails --config-file lib/noosfero/unicorn.rb --daemonize $@
else
unicorn_rails \
--path "$RAILS_RELATIVE_URL_ROOT" \
--config-file lib/noosfero/unicorn.rb \
--daemonize
fi
tail -n 0 -f log/development.log log/development_api.log || true
}
start $@