zammad-docker-compose/install-zammad.sh

35 lines
1016 B
Bash

#!/bin/bash
set -e
echo "installing zammad..."
# crreate zammad user
useradd -M -d /home/zammad -s /bin/bash zammad
# # git clone zammad
cd /home
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}"