Project

General

Profile

Fabfilepy default procedures » History » Revision 2

Revision 1 (Alex V Koval, 08/09/2012 03:24 PM) → Revision 2/4 (Alex V Koval, 08/09/2012 03:25 PM)

h1. fabfile.py automation for repeating maintenance tasks default procedures 

 In our company we have automated a lot of project life cycle repeating actions. Most of them are straightforward & easy to use. 

 h3. get_db, reinst_db 

 In most of projects we implement get_db and reinst_db scripts. First one downloads the most recent copy of the production database, 
 2nd command installs it. Typically the end user-developer needs to run this to get his project fully updated: 

 <pre> 
 hg pull -uv 
 fab get_db reinst_db depup patch 
 </pre> 

 And usually in most of projects all this gets combined in a single command: 
 <pre> 
 fab up 
 </pre> 

 which implements the following: 
  - *hgup* - (hg pull --update) - update to most recent source code 
  - *get_db* - download latest production database 
  - *reinst_db* - drop & reinstall current database from latest backup made 
  - *depup* -update external source dependencies 
  - *patch* - apply migration patches to the project 

 And so Fabric abstracts it on a higher level, and makes developer life easier. 

 h3. produp 

 Additionally on every production server the 'produp' procedure gets implemented. It is very similar to  
 'up' procedure explained above, but it also includes step to reload / restart production service software 
 and update required files (for example static files). 

 And so, <pre>fab produp</pre> consists from: 

   * hgup 
   * depup 
   * patch 
   * prod_reload 
   * ./manage.py collectstatic