Generate the static files in the entrypoint.sh

This commit is contained in:
Alexander Trost
2015-11-06 13:14:20 +01:00
parent 64fe59ce9f
commit a7a7c99b77
2 changed files with 7 additions and 2 deletions

View File

@@ -29,8 +29,6 @@ RUN wget -q -O /root/zulip-ppa.asc https://zulip.com/dist/keys/zulip-ppa.asc &&
ln -nsf "$ZULIP_DEPLOY_PATH" "/home/zulip/deployments/next" && \
ln -nsf "$ZULIP_DEPLOY_PATH" "/home/zulip/deployments/current" && \
ln -nsf /etc/zulip/settings.py "$ZULIP_DEPLOY_PATH/zproject/local_settings.py" && \
/root/zulip/tools/update-prod-static && \
cp -rfT "$ZULIP_DEPLOY_PATH/prod-static/serve" "/home/zulip/prod-static" && \
chown -R zulip:zulip /home/zulip /var/log/zulip /etc/zulip/settings.py && \
apt-get -qq autoremove --purge -y && \
apt-get -qq clean && \

View File

@@ -406,6 +406,13 @@ zulipFirstStartInit() {
echo "First Start Init not needed."
return 0
fi
if [ ! -d "/home/zulip/prod-static" ] || [ "$(ls -A "/home/zulip/prod-static/")" ]; then
echo "Generating static files ..."
/root/zulip/tools/update-prod-static
mkdir -f "/home/zulip/prod-static"
cp -rfT "$ZULIP_DEPLOY_PATH/prod-static/serve" "/home/zulip/prod-static"
echo "Static files generated."
fi
set +e
if ! su zulip -c "/home/zulip/deployments/current/manage.py migrate --noinput"; then
local RETURN_CODE=$?