wiki:EzProduceScript

Version 7 (modified by token, 7 years ago) (diff)

--

Ez produce project Python script

Description

2007-09-12 I refreshed this script to python-script from unix-shell script.

What Ez produce project script ?

this script execute 'createdb, svnadmin, trac-admin' automaticaly.

 # python ./ezProduceTrac.py add
  1. create PostgreSQL DB
  2. create subversion repos to $REPOS_ROOT/PROJECTNAME
  3. create trac dir on $PROJECT_ROOT/PROJECTNAME
  4. init trac project
  5. chmod 777 projectdir, projectdir/log, projectdir/plugins

and , 'dropdb, remove repos dir, remove project dir automaticaly.

 # python ./ezProduceTrac.py del
  1. check project
  2. drop PostgreSQL DB
  3. remove subverion repos from $REPOS_ROOT
  4. remove trac dir from $PROJECT_ROOT

and , optional list

 # python ./ezProduceTrac.py [list]
  1. show projects
  2. show current settings
    bash@localhost# ./ezProduceTrac.py list
    
    Current Projects list: 
    合計 0
    
    Current settings: 
    A = auto detect,  o = valid path,  x = invalid path
    [SVN]  
           admin:   A       /usr/bin/svnadmin
           repos:   o       /srv/svn/repos
           
    [TRAC] 
           templ:   o       /usr/share/trac/templates
           admin:   A       /usr/bin/trac-admin
           project: o       /home/trac/public_html
           
    [PGSQL]
           create:  A       /usr/bin/createdb
           drop:    A       /usr/bin/dropdb
           
    bash@localhost# 
    
  • for postgresql *

Example

bash@localhost# python ./ezProduceTrac.py del

Current Projects list: 
total 4
drwxr-xr-x 7 root root 4096 2007-09-12 11:32 test

please input project name: test
[DEBUG] projectname = test
/home/trac/public_html/test/README
[INFO] removing trac project: test
[INFO] drop db test
[DEBUG] su - postgres -c "/usr/bin/dropdb test"
DROP DATABASE
[INFO] complete.

[INFO] delete svn repos test
[DEBUG] rm -rf /srv/svn/repos/test

[INFO] complete.

[INFO] delete project dir test
[DEBUG] rm -rf /home/trac/public_html/test

[INFO] complete.

bash@localhost# 

Setting yourself

edit ezProduceTrac.py

env = {
    'svn':
        {
        'admin':'do not touch',
        'repos':'/srv/svn/repos'
        },
    'trac':
        {
        'template':'/usr/share/trac/templates',
        'admin':'do not touch',
        'project':'/home/trac/public_html'
        },
    'pgsql':
        {
        'create':'do not touch',
        'drop':'do not touch'
        }
    }

Bugs/Feature Requests

Existing bugs and feature requests for EzProduceScript are here.

If you have any issues, create a new ticket.

Source

You can check out EzProduceScript from here using Subversion, or browse the source with Trac.

Recent Changes

[2632] by token on 2007-09-12 05:14:50
some fix
[2631] by token on 2007-09-12 04:45:51
python script version for trac-admin 0.10.4
[470] by token on 2006-03-10 08:42:15
EzProduceScript:

first commit maybe stable

Author/Contributors

Author: token
Contributors:

TagIt(script,token,0.9)?