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 git.agariclabs.org:/srv/git/whoswho.git

And get the current version of the script at https://gitorious.org/agaric-scripts

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 agc.sh in ~/code/scripts/ and add alias agc='. /home/ben/scripts/agc.sh' 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 ]
  then
    git clone http://git.agariclabs.com/git/drupal-6-agaric-core.git $1
  else
    git clone -o agaric git.agariclabs.com:/srv/git/$1.git;
  fi
  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.)

or:

agc existingreponame

File: 
File: