[Git][noosfero/noosfero][master] script: add script/server to start only unicorn
Rodrigo Souto
gitlab at mg.gitlab.com
Mon Apr 10 17:40:27 BRT 2017
Rodrigo Souto pushed to branch master at Noosfero / noosfero
Commits:
ddde5f10 by Rodrigo Souto at 2017-04-10T17:40:09-03:00
script: add script/server to start only unicorn
- - - - -
1 changed file:
- + script/server
Changes:
=====================================
script/server
=====================================
--- /dev/null
+++ b/script/server
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+set -e
+
+export RAILS_ENV=development
+
+stop() {
+ echo "Stopping ..."
+ 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
+ trap stop INT TERM EXIT
+ 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 $@
View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/ddde5f104315c8cce3a39081d7c87fad2a5beb4f
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20170410/c7f3acf9/attachment-0001.html>
More information about the Noosfero-dev
mailing list