User login

Helper script for deploying Drupal sites in Agaric's system

To get an agaric project repository, without the helper script, it's simply: git clone

And get the current version of the script at

This function ("agc" stands for "Agaric Git Clone") is in my ~.bashrc (actually, a ~.bashrc-agaric that is included in my .bashrc) and takes care of several steps I always have to look up anyway. I recently extended it to be able to start a new project as well as bringing down a local copy of an existing one. This relies on and provides the first steps for the Capistrano scripts for deploying Agaric sites primarily developed by Stefan (since superseded).

UPDATE: New approach, script file (attached) rather than the whole function in bashrc, but the philosophy is the same. With this approach just put in ~/code/scripts/ and add alias agc='. /home/ben/scripts/' in your .bashrc or custom include file.

Old way, still works, I moved to the script file to make sudo work but then used it on a couple lines instead of the whole script anyway.

agc() {
  if [ -n $2 ]
    git clone $1
    git clone -o agaric$1.git;
  cd $1;
  cp drupal/sites/default/default.settings.php drupal/sites/default/settings.php
  chown -R ben:www-data drupal/sites/default
  chmod -R g+w drupal/sites/default
  ln -s /home/ben/code/$1/drupal /var/www/$1

Usage examples:

agc newproject TRUE

(The second parameter can be anything; as long as it is there a new project will be created rather than an existing one copied.)


agc existingreponame