Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.
Practical project                          automationdonderdag 19 mei 2011
Practical project                            automation                   • Reinout van Rees                   • Nelen & S...
Project: more than code                   • Projects are important                   • Deployment                   • Coll...
Generic idea: automation                   • Cobbler’s children                   • Automate your                        p...
Build automation                   • ./configure;make                   • Ant, maven                   • Buildout (python) ...
Build tool: good spot for                       more automation                   • Most are extensible                   ...
Apache config file:  [apacheconf]  recipe = collective.recipe.template  input = ${buildout:directory}/etc/mysite.apache.conf...
Prevent missing apache                        log dir (automatically!)               [mkdir]               recipe = z3c.re...
Automatic crontab               [supervisor-cronjob]               recipe = z3c.recipe.usercrontab               times = @...
Test automation                   • Jenkins/buildbot                   • Deployment ok...                   • ... so tests...
donderdag 19 mei 2011
Extra jenkins automation:                      quality checks                   • Code coverage                        (‘c...
donderdag 19 mei 2011
Quality: make it easy to                      do the right thing                   • “I really should do x,               ...
donderdag 19 mei 2011
Releasing python                             packages                   • zest.releaser (on pypi)                   • prer...
donderdag 19 mei 2011
Practical project                               automation                   • Make it easier to do                       ...
Questions?            reinout.vanrees.org            @reinoutvanrees            reinout@vanrees.org            www.nelen-s...
Prochain SlideShare
Chargement dans…5
×

Practical project automation (PyGrunn conference)

1 557 vues

Publié le

Publié dans : Technologie, Business
  • Soyez le premier à commenter

  • Soyez le premier à aimer ceci

Practical project automation (PyGrunn conference)

  1. 1. Practical project automationdonderdag 19 mei 2011
  2. 2. Practical project automation • Reinout van Rees • Nelen & Schuurmans • Utrecht • Water consultancy • Lots of python and djangodonderdag 19 mei 2011
  3. 3. Project: more than code • Projects are important • Deployment • Colleagues • Rebuilding • Solution: automationdonderdag 19 mei 2011
  4. 4. Generic idea: automation • Cobbler’s children • Automate your projects • Less manual work • Less menial work • Fewer errors • More of the fun workdonderdag 19 mei 2011
  5. 5. Build automation • ./configure;make • Ant, maven • Buildout (python) • Single command to get starteddonderdag 19 mei 2011
  6. 6. Build tool: good spot for more automation • Most are extensible • Examples: • Apache config file generation • Setting up cronjobsdonderdag 19 mei 2011
  7. 7. Apache config file: [apacheconf] recipe = collective.recipe.template input = ${buildout:directory}/etc/mysite.apache.conf.in output = ${buildout:directory}/etc/mysite.apache.conf <VirtualHost *:80> ServerName mysite.example.org CustomLog ${buildout:directory}/var/log/access.log combined ErrorLog ${buildout:directory}/var/log/error.log DocumentRoot ${buildout:directory}/var/www ... RewriteRule ^(.*) http://localhost:${django:gunicorn_port}$1 [P]<VirtualHost *:80> ServerName mysite.example.org CustomLog /srv/mysite/var/log/access.log combined ErrorLog /srv/mysite/var/log/error.log DocumentRoot /srv/mysite/var/www ... RewriteRule ^(.*) http://localhost:10003$1 [P]donderdag 19 mei 2011
  8. 8. Prevent missing apache log dir (automatically!) [mkdir] recipe = z3c.recipe.mkdir paths = ${buildout:directory}/generated ${buildout:directory}/var/geotiffs ${buildout:directory}/var/log ${buildout:directory}/var/media ${buildout:directory}/var/sqlite ${buildout:directory}/var/staticdonderdag 19 mei 2011
  9. 9. Automatic crontab [supervisor-cronjob] recipe = z3c.recipe.usercrontab times = @reboot command = ${buildout:bin-directory}/supervisord [whoosh-cronjob] recipe = z3c.recipe.usercrontab times = 13 */8 * * * command = ${buildout:bin-directory}/django update_indexdonderdag 19 mei 2011
  10. 10. Test automation • Jenkins/buildbot • Deployment ok... • ... so tests possible • Prevent mistakesdonderdag 19 mei 2011
  11. 11. donderdag 19 mei 2011
  12. 12. Extra jenkins automation: quality checks • Code coverage (‘coverage’ on pypi) • Pyflakes and pep8 (also on pypi) • Jslint (or jshint)donderdag 19 mei 2011
  13. 13. donderdag 19 mei 2011
  14. 14. Quality: make it easy to do the right thing • “I really should do x, but it takes too much time so I’ll skip it” • Releasing packages • Skeletondonderdag 19 mei 2011
  15. 15. donderdag 19 mei 2011
  16. 16. Releasing python packages • zest.releaser (on pypi) • prerelease • release • postreleasedonderdag 19 mei 2011
  17. 17. donderdag 19 mei 2011
  18. 18. Practical project automation • Make it easier to do the right thing: let laziness work for you • Automate your builds • Automate tests • Extend where practicaldonderdag 19 mei 2011
  19. 19. Questions? reinout.vanrees.org @reinoutvanrees reinout@vanrees.org www.nelen-schuurmans.nl photos.reinout.vanrees.orgdonderdag 19 mei 2011

×