Your SlideShare is downloading. ×
Practical project automation (PyGrunn conference)
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Practical project automation (PyGrunn conference)

1,175

Published on

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,175
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Practical project automationdonderdag 19 mei 2011
  • 2. Practical project automation • Reinout van Rees • Nelen & Schuurmans • Utrecht • Water consultancy • Lots of python and djangodonderdag 19 mei 2011
  • 3. Project: more than code • Projects are important • Deployment • Colleagues • Rebuilding • Solution: automationdonderdag 19 mei 2011
  • 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. Build automation • ./configure;make • Ant, maven • Buildout (python) • Single command to get starteddonderdag 19 mei 2011
  • 6. Build tool: good spot for more automation • Most are extensible • Examples: • Apache config file generation • Setting up cronjobsdonderdag 19 mei 2011
  • 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. 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. 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. Test automation • Jenkins/buildbot • Deployment ok... • ... so tests possible • Prevent mistakesdonderdag 19 mei 2011
  • 11. donderdag 19 mei 2011
  • 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. donderdag 19 mei 2011
  • 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. donderdag 19 mei 2011
  • 16. Releasing python packages • zest.releaser (on pypi) • prerelease • release • postreleasedonderdag 19 mei 2011
  • 17. donderdag 19 mei 2011
  • 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. Questions? reinout.vanrees.org @reinoutvanrees reinout@vanrees.org www.nelen-schuurmans.nl photos.reinout.vanrees.orgdonderdag 19 mei 2011

×