The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

asp4-deploy - Deploy your prepared ASP4 application.

USAGE

  asp4-deploy --src=/path/to/MyWeb_2011-11-15_23.59.39.tar.gz [--target=/var/www/myweb.com]

ARGUMENTS

--src=/path/to/MyWeb_2011-11-15_23.59.39.tar.gz

Required.

--target=/var/www/myweb.com

Optional. Defaults to the current directory.

DESCRIPTION

asp4-deploy behaves differently the first time you deploy an app than it does the second, third or tenth times.

The First Deployment

Step 1

Unzips the tar.gz archive into the target folder.

Step 2

Copies all the conf/*.template files to be non-template files.

eg:

  cp conf/asp4-config.json.template conf/asp4-config.json
  cp conf/httpd.conf.template conf/httpd.conf
Step 3

Makes a symbolic link from /the/target/path/latest/ to /the/target/path/MyWeb_2011-11-15_23.59.39.

Step 4

You update your conf/asp4-config.json and conf/httpd.conf to work for the new environment.

You run your tests:

  prove -r t/

If everything checks out, then you update your server's other configuration (eg: /etc/apache2/sites-enabled/*) to include:

  /the/target/path/latest/www/conf/httpd.conf

Restart apache and you're done.

Subsequent Deployments

Subsequent deployments are easier for us humans, but more work for the computers.

Step 1

Unzips the tar.gz into the target folder.

Step 2

Creates a symbolic link 'deploying' in your project folder.

eg:

  /var/www/myweb/deploying  ->  /var/www/myweb/MyWeb_2011-11-15_23.59.39
Step 3

Copies all your configuration files from 'latest/*/conf/*' into 'deploying/*/conf/*'

Step 4

Runs unit tests on all folders under deploying except for 'common'.

If all tests pass, we continue. Otherwise, we bail out with errors.

Step 5

Unlink the deploying symbolic link and change latest to point to the new directory.

Step 6

After a successful deployment, you should restart apache.

DEPLOYMENT DIRECTORY FOLDER STRUCTURE

Initially you will have a folder structure like this:

  .
  |-- MyWeb_2011-10-28_15.37.55
  `-- latest -> MyWeb_2011-10-28_15.37.55

After several deployments, it will look like this:

  .
  |-- MyWeb_2011-10-28_15.37.55
  |-- MyWeb_2011-10-28_16.04.35
  |-- MyWeb_2011-10-29_23.55.55
  |-- MyWeb_2011-10-29_23.59.39
  |-- MyWeb_2011-10-30_00.00.13
  `-- latest -> MyWeb_2011-10-30_00.00.13

If you need to rollback to a previous release, simply update the symbolic link so that it points to a previous version.

  rm latest
  ln -s MyWeb_2011-10-29_23.59.39 latest

GNU/LINUX, POSIX OS ONLY

This tool makes use of symbolic links and the GNU tools to Get The Job Done.

If your operating system doesn't provide them, consider upgrading to one that does.

BUGS

It's possible that some bugs have found their way into this release.

Use RT http://rt.cpan.org/NoAuth/Bugs.html?Dist=ASP4 to submit bug reports.

HOMEPAGE

Please visit the ASP4 homepage at http://0x31337.org/code/ to see examples of ASP4 in action.