diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2010-11-26 23:02:32 -0200 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2010-11-26 23:02:32 -0200 |
commit | 673d75a48442fac1806fe8064ac20ef4e35219a9 (patch) | |
tree | 100761e61dcf756d539df23641bac00246b85735 | |
parent | small template fix (diff) | |
download | checkbump-673d75a48442fac1806fe8064ac20ef4e35219a9.tar.gz checkbump-673d75a48442fac1806fe8064ac20ef4e35219a9.tar.bz2 checkbump-673d75a48442fac1806fe8064ac20ef4e35219a9.zip |
added fabfile.py
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | fabfile.py | 30 |
2 files changed, 32 insertions, 0 deletions
@@ -1,2 +1,4 @@ *.py[co] *.html + +_build diff --git a/fabfile.py b/fabfile.py new file mode 100644 index 0000000..03fac83 --- /dev/null +++ b/fabfile.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +""" + fabfile.py + ~~~~~~~~~~ + + fabfile to generate html and upload to a remote web server using ssh. + + :copyright: (c) 2010 by Rafael Goncalves Martins + :license: BSD (http://www.opensource.org/licenses/bsd-license.php) +""" + +from fabric.api import cd, env, local, put, run +from glob import glob + +env.user = 'rafaelmartins' +env.hosts = ['dev.gentoo.org'] + +def clean(): + local('rm -rf _build', capture=False) + +def build(): + clean() + local('mkdir -p _build', capture=False) + for f in [i[len('config/'):-len('.ini')] for i in glob('config/*.ini')]: + local('python checkbump.py config/%s.ini > _build/%s.html' % (f, f), capture=False) + +def upload(): + run('mkdir -p public_html/checkbump') + for html_file in glob('_build/*.html'): + put(html_file, 'public_html/checkbump') |