praekelt.recipe.deploy

Buildout recipe making versioned remote deploys trivial
Download

praekelt.recipe.deploy Ranking & Summary

Advertisement

  • Rating:
  • License:
  • BSD License
  • Publisher Name:
  • Praekelt Foundation
  • Publisher web site:
  • http://praekelt.com

praekelt.recipe.deploy Tags


praekelt.recipe.deploy Description

Buildout recipe making versioned remote deploys trivial praekelt.recipe.deploy is a buildout recipe making versioned remote deploys trivial.Creates a bin/ script with which you can easily deploy buildouts to remote servers. Uses Fabric to communicate and run commands on remote servers.NOTE: This recipe is under active development and has not been fully tested in a production environment. Use at your own risk.The deploy process proceeds as follows: 1. The remote host as specified in host is accessed. 2. A new release path structure is created using this pattern: < root_path >/releases/< release_timestamp >. 3. The git repo as specified in git_url is cloned. 4. The newly cloned repo's branch is switched to the branch as specified in git_branch. If git_branch is not specified no switch occurs 5. Shared resources as specified in shared_resources are copied from the current release(if present) to the newly created release. 6. The Buildout's boostrap.py is run using the python executable as specified in python_exec and a Buildout configuration file as specified in conf_file. python is used by default if python_exec is not specified, buildout.cfg is used by default if conf_file is not specified. 7. The Buildout is run using a Buildout configuration file as specified in conf_file. buildout.cfg is used by default if conf_file is not specified. 8. The < root_path >/current symlink is updated to point to newly created release. 9. Supervisor is updated($ supervisorctl update) if update_supervisor is specified as True. 10. Each command specified in initd_commands is run in order.Usage:Add a part in buildout.cfg like so:parts = deployrecipe = praekelt.recipe.deploygit_url = git@github.com:me/projectx.githost = www.protectx.comroot_path = /var/www/projectxRunning the buildout will add a deploy script with the same name as your deploy part in the bin/ directory. In this case bin/deploy. The resulting script will deploy git@github.com:me/projectx.git to www.projectx.com's /var/www/projectx path.Optionsas_user User as which to perform the deploy. Used to setup permissions appropriately and to clone from github. Defaults to 'www-data'.conf_file Buildout cfg file with which to run boostrap and buildout. Defaults to 'buildout.cfg'.deploy_key_path Path on host to key to use when cloning the repo.git_branch Git repo branch with which to perform the deploy.git_url Git repo with which to perform the deploy. Required.host Hostname on which to perform deploy. Required.initd_commands init.d commands to run after a completed deploy. i.e. nginx restart.python_exec Python command with which to boostrap Buildout. Defaults to 'python'.root_path Root path in which to perform the deploy. current/release path structure will be created within this path. Required.shared_resources Resource paths to copy accross from the current release to the new release on each deploy.update_supervisor Whether or not to update supervisor. Defaults to 'False'.Full ExampleThe following example illustrates all available options:parts = deployrecipe = praekelt.recipe.deployas_user = www-dataconf_file = production.cfgdeploy_key_path = /var/www/.ssh/projectx_deploy_keygit_branch = productiongit_url = git@github.com:me/projectx.githost = www.protectx.cominitd_commands = nginx restartpython_exec = python2.5root_path = /var/www/projectxshared_resources = eggs downloads log mediaupdate_supervisor = TrueThe resulting script will deploy git@github.com:me/projectx.git's production branch to www.projectx.com's /var/www/projectx path as user www-data. The git repo will be cloned using /var/www/.ssh/projectx_deploy_key as ssh key. The eggs, downloads, log and media paths will be copied from the current release to this new release. The buildout environment will be created using python2.5 and run using production.cfg as configuration file. After the buildout completes supervisor will be updated and /etc/init.d/nginx restart will be run. Requirements: · Python What's New in This Release: · Added cron_commands parameter. ALlow for certain script argument overrides.


praekelt.recipe.deploy Related Software