2017-01-06 14:11:05 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-01-09 17:52:52 +00:00
|
|
|
set -e
|
|
|
|
|
2017-01-06 14:11:05 +00:00
|
|
|
echo "installing zammad..."
|
2017-01-10 10:46:26 +00:00
|
|
|
|
|
|
|
# crreate zammad user
|
2017-01-10 10:53:24 +00:00
|
|
|
useradd -M -d "${ZAMMAD_DIR}" -s /bin/bash zammad
|
2017-01-10 10:46:26 +00:00
|
|
|
|
2017-01-10 10:57:51 +00:00
|
|
|
# git clone zammad
|
2017-01-10 10:58:49 +00:00
|
|
|
cd $(dirname "${ZAMMAD_DIR}")
|
2017-01-09 16:39:11 +00:00
|
|
|
git clone --depth 1 -b "${GIT_BRANCH}" "${GIT_URL}"
|
2017-01-10 10:46:26 +00:00
|
|
|
|
|
|
|
# install zammad
|
2017-01-09 17:52:52 +00:00
|
|
|
cd "${ZAMMAD_DIR}"
|
2017-01-06 14:11:05 +00:00
|
|
|
bundle install --without test development mysql
|
2017-01-10 10:46:26 +00:00
|
|
|
|
|
|
|
# fetch locales
|
2017-01-09 17:28:32 +00:00
|
|
|
contrib/packager.io/fetch_locales.rb
|
2017-01-10 10:46:26 +00:00
|
|
|
|
|
|
|
# set nulldb database adapter for assets precompile
|
2017-01-07 12:52:50 +00:00
|
|
|
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
|
2017-01-10 10:46:26 +00:00
|
|
|
|
|
|
|
# assets precompile
|
2017-01-07 12:52:50 +00:00
|
|
|
bundle exec rake assets:precompile
|
2017-01-10 10:46:26 +00:00
|
|
|
|
|
|
|
# set postgresql database adapter
|
2017-01-07 12:52:50 +00:00
|
|
|
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
|
2017-01-10 10:46:26 +00:00
|
|
|
|
|
|
|
# delete assets precompile cache
|
2017-01-10 00:05:05 +00:00
|
|
|
rm -r tmp/cache
|
2017-01-10 10:46:26 +00:00
|
|
|
|
|
|
|
# set user & group to zammad
|
2017-01-09 16:39:11 +00:00
|
|
|
chown -R zammad:zammad "${ZAMMAD_DIR}"
|