delete zammad ready file on init container start
This commit is contained in:
parent
c224217da4
commit
2fc5b8fe8b
@ -12,14 +12,17 @@ set -e
|
||||
: "${NGINX_SERVER_NAME:=_}"
|
||||
|
||||
function check_zammad_ready {
|
||||
sleep 10
|
||||
until [ -f "${ZAMMAD_READY_FILE}" ]; do
|
||||
echo "waiting for install or update to be ready..."
|
||||
sleep 5
|
||||
echo "waiting for init container to finish install or update..."
|
||||
sleep 10
|
||||
done
|
||||
}
|
||||
|
||||
# zammad init
|
||||
if [ "$1" = 'zammad-init' ]; then
|
||||
test -f ${ZAMMAD_READY_FILE} && rm ${ZAMMAD_READY_FILE}
|
||||
|
||||
until (echo > /dev/tcp/${POSTGRESQL_HOST}/5432) &> /dev/null; do
|
||||
echo "zammad railsserver waiting for postgresql server to be ready..."
|
||||
sleep 5
|
||||
@ -71,22 +74,17 @@ if [ "$1" = 'zammad-init' ]; then
|
||||
# create install ready file
|
||||
su -c "echo 'zammad-init' > ${ZAMMAD_READY_FILE}" ${ZAMMAD_USER}
|
||||
fi
|
||||
|
||||
echo "zammad-websocket" >> ${ZAMMAD_READY_FILE}
|
||||
|
||||
# zammad nginx
|
||||
if [ "$1" = 'zammad-nginx' ]; then
|
||||
check_zammad_ready
|
||||
|
||||
# configure nginx
|
||||
if [ -z "$(env|grep KUBERNETES)" ]; then
|
||||
sed -e "s#server .*:3000#server ${ZAMMAD_RAILSSERVER_HOST}:3000#g" -e "s#server .*:6042#server ${ZAMMAD_WEBSOCKET_HOST}:6042#g" -e "s#server_name .*#server_name ${NGINX_SERVER_NAME};#g" -e 's#/var/log/nginx/zammad.\(access\|error\).log#/dev/stdout#g' < contrib/nginx/zammad.conf > /etc/nginx/sites-enabled/default
|
||||
fi
|
||||
|
||||
until [ -f "${ZAMMAD_READY_FILE}" ] && [ -n "$(grep zammad-railsserver < ${ZAMMAD_READY_FILE})" ] && [ -n "$(grep zammad-scheduler < ${ZAMMAD_READY_FILE})" ] && [ -n "$(grep zammad-websocket < ${ZAMMAD_READY_FILE})" ] ; do
|
||||
echo "waiting for all zammad services to start..."
|
||||
sleep 5
|
||||
done
|
||||
|
||||
rm ${ZAMMAD_READY_FILE}
|
||||
|
||||
echo "starting nginx..."
|
||||
|
||||
exec /usr/sbin/nginx -g 'daemon off;'
|
||||
@ -101,8 +99,6 @@ if [ "$1" = 'zammad-railsserver' ]; then
|
||||
|
||||
echo "starting railsserver..."
|
||||
|
||||
echo "zammad-railsserver" >> ${ZAMMAD_READY_FILE}
|
||||
|
||||
exec gosu ${ZAMMAD_USER}:${ZAMMAD_USER} bundle exec rails server puma -b [::] -p 3000 -e ${RAILS_ENV}
|
||||
fi
|
||||
|
||||
@ -115,8 +111,6 @@ if [ "$1" = 'zammad-scheduler' ]; then
|
||||
|
||||
echo "starting scheduler..."
|
||||
|
||||
echo "zammad-scheduler" >> ${ZAMMAD_READY_FILE}
|
||||
|
||||
exec gosu ${ZAMMAD_USER}:${ZAMMAD_USER} bundle exec script/scheduler.rb run
|
||||
fi
|
||||
|
||||
@ -129,7 +123,5 @@ if [ "$1" = 'zammad-websocket' ]; then
|
||||
|
||||
echo "starting websocket server..."
|
||||
|
||||
echo "zammad-websocket" >> ${ZAMMAD_READY_FILE}
|
||||
|
||||
exec gosu ${ZAMMAD_USER}:${ZAMMAD_USER} bundle exec script/websocket-server.rb -b 0.0.0.0 -p 6042 start
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user