Merge branch 'develop' of github.com:martini/zammad into develop
This commit is contained in:
commit
22e871a68f
4 changed files with 37 additions and 29 deletions
|
@ -18,11 +18,13 @@ targets:
|
||||||
ubuntu-16.04:
|
ubuntu-16.04:
|
||||||
dependencies:
|
dependencies:
|
||||||
- postgresql
|
- postgresql
|
||||||
|
sles-12:
|
||||||
|
dependencies:
|
||||||
|
- postgresql
|
||||||
before:
|
before:
|
||||||
- uname -a
|
- uname -a
|
||||||
- ruby -v
|
- ruby -v
|
||||||
- env
|
- env
|
||||||
- cp config/database.yml.pkgr config/database.yml
|
|
||||||
- echo "gem 'mysql2'" >> Gemfile.local
|
- echo "gem 'mysql2'" >> Gemfile.local
|
||||||
- "cat Gemfile.lock"
|
- "cat Gemfile.lock"
|
||||||
- contrib/cleanup.sh
|
- contrib/cleanup.sh
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
* exit
|
* exit
|
||||||
|
|
||||||
### Create Nginx Config
|
### Create Nginx Config
|
||||||
* cp /opt/zammad/contrib/nginx/sites-available/zammad.conf /etc/nginx/sites-available/zammad.conf
|
* cp /opt/zammad/contrib/nginx/zammad.conf /etc/nginx/sites-available/zammad.conf
|
||||||
* vi /etc/nginx/sites-available/zammad.conf
|
* vi /etc/nginx/sites-available/zammad.conf
|
||||||
* change servername "localhost" to your domain if your're not testing localy
|
* change servername "localhost" to your domain if your're not testing localy
|
||||||
* ln -s /etc/nginx/sites-available/zammad.conf /etc/nginx/sites-enabled/zammad.conf
|
* ln -s /etc/nginx/sites-available/zammad.conf /etc/nginx/sites-enabled/zammad.conf
|
||||||
|
|
|
@ -43,7 +43,7 @@ server {
|
||||||
proxy_pass http://zammad;
|
proxy_pass http://zammad;
|
||||||
|
|
||||||
gzip on;
|
gzip on;
|
||||||
gzip_types text/html text/plain text/xml text/css image/svg+xml application/javascript application/x-javascript application/json application/xml;
|
gzip_types text/plain text/xml text/css image/svg+xml application/javascript application/x-javascript application/json application/xml;
|
||||||
gzip_proxied any;
|
gzip_proxied any;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -9,19 +9,28 @@ ZAMMAD_DIR="/opt/zammad"
|
||||||
DB="zammad_production"
|
DB="zammad_production"
|
||||||
DB_USER="zammad"
|
DB_USER="zammad"
|
||||||
|
|
||||||
|
# check which init system is used
|
||||||
|
if [ -n $(which initctl) ]; then
|
||||||
|
INIT_CMD="initctl"
|
||||||
|
elif [ -n $(which systemctl) ]; then
|
||||||
|
INIT_CMD="systemctl"
|
||||||
|
else
|
||||||
|
function sysvinit () {
|
||||||
|
service $2 $1
|
||||||
|
}
|
||||||
|
INIT_CMD="sysvinit"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "# (Re)creating init scripts"
|
echo "# (Re)creating init scripts"
|
||||||
zammad scale web=1 websocket=1 worker=1
|
zammad scale web=1 websocket=1 worker=1
|
||||||
|
|
||||||
echo "# Stopping Zammad"
|
echo "# Stopping Zammad"
|
||||||
systemctl stop zammad
|
${INIT_CMD} stop zammad
|
||||||
|
|
||||||
# check if database.yml.bak exists
|
|
||||||
if [ -f ${ZAMMAD_DIR}/config/database.yml.bak ]; then
|
|
||||||
# copy database.yml.bak to database.yml
|
|
||||||
cp ${ZAMMAD_DIR}/config/database.yml.bak ${ZAMMAD_DIR}/config/database.yml
|
|
||||||
|
|
||||||
|
# check if database.yml exists
|
||||||
|
if [ -f ${ZAMMAD_DIR}/config/database.yml ]; then
|
||||||
# db migration
|
# db migration
|
||||||
echo "# database.yml.bak exists. Updating db..."
|
echo "# database.yml exists. Updating db..."
|
||||||
zammad run rake db:migrate
|
zammad run rake db:migrate
|
||||||
else
|
else
|
||||||
# create new password
|
# create new password
|
||||||
|
@ -40,36 +49,33 @@ else
|
||||||
# update configfile
|
# update configfile
|
||||||
sed "s/.*password:.*/ password: ${DB_PASS}/" < ${ZAMMAD_DIR}/config/database.yml.pkgr > ${ZAMMAD_DIR}/config/database.yml
|
sed "s/.*password:.*/ password: ${DB_PASS}/" < ${ZAMMAD_DIR}/config/database.yml.pkgr > ${ZAMMAD_DIR}/config/database.yml
|
||||||
|
|
||||||
# save database config for updates
|
|
||||||
cp ${ZAMMAD_DIR}/config/database.yml ${ZAMMAD_DIR}/config/database.yml.bak
|
|
||||||
|
|
||||||
# zammad config set
|
|
||||||
zammad config:set DATABASE_URL=postgres://${DB_USER}:${DB_PASS}@127.0.0.1/${DB}
|
|
||||||
|
|
||||||
# fill database
|
# fill database
|
||||||
zammad run rake db:migrate
|
zammad run rake db:migrate
|
||||||
zammad run rake db:seed
|
zammad run rake db:seed
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "# Starting Zammad"
|
echo "# Starting Zammad"
|
||||||
systemctl start zammad
|
${INIT_CMD} start zammad
|
||||||
|
|
||||||
# nginx config
|
# nginx config
|
||||||
if [ -d /etc/nginx/sites-enabled ]; then
|
if [ -n $(which nginx) ]; then
|
||||||
# copy nginx config
|
# copy nginx config
|
||||||
test -f /etc/nginx/sites-available/zammad.conf || cp ${ZAMMAD_DIR}/contrib/nginx/sites-available/zammad.conf /etc/nginx/sites-available/zammad.conf
|
# debian / ubuntu
|
||||||
|
if [ -d /etc/nginx/sites-enabled ]; then
|
||||||
if [ ! -f /etc/nginx/sites-available/zammad.conf ]; then
|
NGINX_CONF="/etc/nginx/sites-enabled/zammad.conf"
|
||||||
# creating symlink
|
test -f /etc/nginx/sites-available/zammad.conf || cp ${ZAMMAD_DIR}/contrib/nginx/zammad.conf /etc/nginx/sites-available/zammad.conf
|
||||||
ln -s /etc/nginx/sites-available/zammad.conf /etc/nginx/sites-enabled/zammad.conf
|
test -h ${NGINX_CONF} || ln -s /etc/nginx/sites-available/zammad.conf ${NGINX_CONF}
|
||||||
|
# centos / sles
|
||||||
echo -e "\nAdd your FQDN to servername directive in /etc/nginx/sites/enabled/zammad.conf anmd restart nginx if you're not testing localy!\n"
|
elif [ -d /etc/nginx/conf.d ]; then
|
||||||
|
NGINX_CONF="/etc/nginx/conf.d/zammad.conf"
|
||||||
|
test -f ${NGINX_CONF} || cp ${ZAMMAD_DIR}/contrib/nginx/zammad.conf ${NGINX_CONF}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "# Restarting Nginx"
|
echo "# Restarting Nginx"
|
||||||
systemctl restart nginx
|
${INIT_CMD} restart nginx
|
||||||
|
|
||||||
echo -e "\nOpen http://localhost in your browser to start using Zammad!\n"
|
echo -e "\nAdd your FQDN to servername directive in ${NGINX_CONF} and restart nginx if you're not testing localy"
|
||||||
|
echo -e "or open http://localhost in your browser to start using Zammad.\n"
|
||||||
else
|
else
|
||||||
echo -e "\nOpen http://localhost:3000 in your browser to start using Zammad!\n"
|
echo -e "\nOpen http://localhost:3000 in your browser to start using Zammad.\n"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue