diff --git a/fabfile.py b/fabfile.py index 6ebd2549f4d58c669fa99ce497a8a7dc5d0e8bd7..27a241d6fe16a7f8c9927c0c1123db3d03b7ce70 100644 --- a/fabfile.py +++ b/fabfile.py @@ -140,12 +140,13 @@ def _run_migrate(): @runs_once def _post_deploy(): - # clear frontend cache - run( - 'for host in $(echo $CFG_HOSTNAMES | tr \',\' \' \'); do echo "Purge cache for $host";' - 'ats-cache-purge $host; ' - 'done' - ) + # clear frontend cache only on production + if 'production' in env.effective_roles: + run( + 'for host in $(echo $CFG_HOSTNAMES | tr \',\' \' \'); do echo "Purge cache for $host";' + 'ats-cache-purge $host; ' + 'done' + ) # update search index run('django-admin update_index')