Skip to content

Commit

Permalink
Added a new script for running drush cache clears which could be easi…
Browse files Browse the repository at this point in the history
…ly repurposed as a stub for any drush command.
  • Loading branch information
benbunk committed Aug 1, 2012
1 parent 1deeb78 commit 9e46be6
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions samples/drush-cache-clear.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh
#
# A sample cloud hook to run a Drush Cache Clear.
#

# Map the script inputs to convient names.
site=$1 # The site name. This is the same as the Acquia Cloud username for the site.
targetenv=$2 # The environment to which code was just deployed.
sourcebranch=$3 # The code branch or tag being deployed.
deployedtag=$4 # The code branch or tag being deployed.
repourl=$5 # The URL of your code repository.
repotype=$6 # The version control system your site is using; "git" or "svn".
drushalias=$site'.'$targetenv # The drush alias for the site and environment. (This makes the assumption that the alias is always a combination of site name and environment.)

# Setup some environment variables that aren't available normally in CLI mode but could be used in settings files.
export AH_SITE_NAME=$drushalias
export AH_SITE_GROUP=$site
export AH_SITE_ENVIRONMENT=$targetenv

export AH_NON_PRODUCTION=1
if [ $targetenv = 'prod' ]
then
export AH_NON_PRODUCTION=0
fi

# Execute a standard drush command.
/usr/local/bin/drush @$drushalias cc all

0 comments on commit 9e46be6

Please sign in to comment.