Created
September 21, 2017 19:19
-
-
Save dpagini/58e2d283ec393809ced4b58c3f3b190a to your computer and use it in GitHub Desktop.
Acquia cloud hook function to clear varnish cache.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| varnish_purge() { | |
| echo "@INFO: Clear varnish cache starting" | |
| for domain in `$drush_cmd ac-domain-list --format=print_r`; do | |
| echo "@INFO: Clearing varnish cache for $domain" | |
| $drush_cmd ac-domain-purge $domain | |
| done | |
| if [ $? -ne 0 ]; then | |
| echo "@INFO: Clear varnish cache errored" | |
| status=1 | |
| else | |
| echo "@INFO: Clear varnish cache complete" | |
| fi | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment