zammad-docker-compose/install-zammad.sh
2017-01-10 11:53:24 +01:00

35 lines
1.0 KiB
Bash

#!/bin/bash
set -e
echo "installing zammad..."
# crreate zammad user
useradd -M -d "${ZAMMAD_DIR}" -s /bin/bash zammad
# # git clone zammad
cd $(dirname ${ZAMMAD_DIR})
git clone --depth 1 -b "${GIT_BRANCH}" "${GIT_URL}"
# install zammad
cd "${ZAMMAD_DIR}"
bundle install --without test development mysql
# fetch locales
contrib/packager.io/fetch_locales.rb
# set nulldb database adapter for assets precompile
sed -e 's#.*adapter: postgresql# adapter: nulldb#g' -e 's#.*username:.*# username: postgres#g' -e 's#.*password:.*# password: \n host: postgresql\n#g' < config/database.yml.pkgr > config/database.yml
# assets precompile
bundle exec rake assets:precompile
# set postgresql database adapter
sed -e 's#.*adapter: postgresql# adapter: postgresql#g' -e 's#.*username:.*# username: postgres#g' -e 's#.*password:.*# password: \n host: postgresql\n#g' < config/database.yml.pkgr > config/database.yml
# delete assets precompile cache
rm -r tmp/cache
# set user & group to zammad
chown -R zammad:zammad "${ZAMMAD_DIR}"