zulip/tools/update-prod-static
Keegan McAllister a8ade10fde Restore streams-example.png for /new-user
This was removed in 63788aa3.  It was the only non-symlink in
zephyr/static-access-control/.

(imported from commit c9ee043b07c5fd4050aeaafa40394a6b69915bfb)
2013-02-05 12:07:41 -05:00

29 lines
942 B
Bash
Executable File

#!/bin/bash -e
# Update static files in production.
cd "$(dirname "$0")"/..
# Redirect output to a log file (most recent run only)
exec >update-prod-static.log
# Collect both original and minified files
rm -rf prod-static/collected
./manage.py collectstatic --noinput
# Copy the files we want to expose
rm -rf prod-static/serve-new
mkdir -p prod-static/serve-new/{js,styles}
cp -r prod-static/collected/{favicon.ico,robots.txt,html,images,third,min} prod-static/serve-new/
cp prod-static/collected/js/{common,debug,signup}.js prod-static/serve-new/js/
cp prod-static/collected/styles/{activity,portico,pygments}.css prod-static/serve-new/styles/
# Sync the new directory to the one nginx actually serves.
# Hopefully this doesn't race too badly for clients loading
# right as a deploy happens.
mkdir -p prod-static/serve
rsync -ar --delete prod-static/serve-new/* prod-static/serve/
# Clean up
rm -rf prod-static/{collected,serve-new}