added unicorn support
This commit is contained in:
parent
0affcbd836
commit
cac85e853a
@ -1,10 +1,23 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
ZAMMAD_DIR="/home/zammad"
|
ZAMMAD_DIR="/home/zammad"
|
||||||
DEBUG="no"
|
#GIT_URL="https://github.com/zammad/zammad.git"
|
||||||
|
#GIT_BRANCH="develop"
|
||||||
|
GIT_URL="https://github.com/monotek/zammad.git"
|
||||||
|
GIT_BRANCH="unicorn"
|
||||||
|
FRESH_INSTALL="yes"
|
||||||
|
RAILS_SERVER="unicorn"
|
||||||
|
DEBUG="yes"
|
||||||
|
|
||||||
export RAILS_ENV="production"
|
export RAILS_ENV="production"
|
||||||
|
|
||||||
|
shopt -s dotglob
|
||||||
|
|
||||||
|
if [ "${FRESH_INSTALL}" == "yes" ]; then
|
||||||
|
echo "fresh install requested. delting everything in ${ZAMMAD_DIR}"
|
||||||
|
rm -rf ${ZAMMAD_DIR}/*
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$1" = 'zammad' ]; then
|
if [ "$1" = 'zammad' ]; then
|
||||||
|
|
||||||
# get zammad
|
# get zammad
|
||||||
@ -17,11 +30,10 @@ if [ "$1" = 'zammad' ]; then
|
|||||||
else
|
else
|
||||||
echo "installing zammad..."
|
echo "installing zammad..."
|
||||||
cd /tmp
|
cd /tmp
|
||||||
git clone https://github.com/zammad/zammad.git
|
git clone ${GIT_URL}
|
||||||
shopt -s dotglob
|
|
||||||
mv -f /tmp/zammad/* ${ZAMMAD_DIR}/
|
mv -f /tmp/zammad/* ${ZAMMAD_DIR}/
|
||||||
shopt -u dotglob
|
|
||||||
cd ${ZAMMAD_DIR}
|
cd ${ZAMMAD_DIR}
|
||||||
|
git checkout ${GIT_BRANCH}
|
||||||
bundle install --without test development
|
bundle install --without test development
|
||||||
sed -e 's#.*username:.*# username: postgres#g' -e 's#.*password:.*# password: \n host: postgresql\n#g' < config/database.yml.pkgr > config/database.yml
|
sed -e 's#.*username:.*# username: postgres#g' -e 's#.*password:.*# password: \n host: postgresql\n#g' < config/database.yml.pkgr > config/database.yml
|
||||||
rake db:drop
|
rake db:drop
|
||||||
@ -39,9 +51,14 @@ if [ "$1" = 'zammad' ]; then
|
|||||||
# run zammad
|
# run zammad
|
||||||
echo "starting zammad..."
|
echo "starting zammad..."
|
||||||
echo "zammad will be accessable on http://localhost in some seconds"
|
echo "zammad will be accessable on http://localhost in some seconds"
|
||||||
script/websocket-server.rb -b 0.0.0.0 start &
|
bundle exec script/websocket-server.rb -b 0.0.0.0 start &
|
||||||
script/scheduler.rb start &
|
bundle exec script/scheduler.rb start &
|
||||||
rails s -p 3000 -b 0.0.0.0
|
if [ "${RAILS_SERVER}" == "puma" ]; then
|
||||||
|
#rails s -p 3000 -b 0.0.0.0
|
||||||
|
bundle exec puma -p 3000 -b 0.0.0.0
|
||||||
|
elif [ "${RAILS_SERVER}" == "unicorn" ]; then
|
||||||
|
bundle exec unicorn -p 3000 -c config/unicorn.rb
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "${DEBUG}" == "yes" ]; then
|
if [ "${DEBUG}" == "yes" ]; then
|
||||||
# keepalive if error
|
# keepalive if error
|
||||||
|
Loading…
Reference in New Issue
Block a user