255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
Using Git Hooks to Help Your Engineering Teams Work Autonomously
Europython 2015 João Santos Software Engineer joao.santos@zalando.de @joaomcsantos
Using Git Hooks to Help Your 40 40 40 Joo Santos Engineering - - PowerPoint PPT Presentation
255 105 0 149 149 149 225 225 225 68 84 106 84 28 0 0 0 153 65 0 102 Using Git Hooks to Help Your 40 40 40 Joo Santos Engineering Teams Work Software Engineer joao.santos@zalando.de Autonomously @joaomcsantos Europython 2015
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
Using Git Hooks to Help Your Engineering Teams Work Autonomously
Europython 2015 João Santos Software Engineer joao.santos@zalando.de @joaomcsantos
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
Quick Facts About Zalando Tech
Mönchengladbach, Erfurt
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
Why do we need hooks and rules?
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
How should the rules be enforced?
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
The Age of the Git Hook - First Plan
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
The Age of the Git Hook - First Plan
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
The Age of the Git Hook - First Feedback
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
The Age of the Git Hook - First Feedback
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
The Age of the Git Hook - Plan B
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
The Age of the Git Hook - Plan B
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
The Age of the Git Hook - Customization
"*playground-*": check_from: 9999-01-01T00:00 TEAM1/*: check_from: 2014-01-08T00:00 allowed_projects: [PROJECT1] extra_on_push: [jira.fix_version] merge_to_feature: [live, master] TEAM1/repository42: allowed_projects: [PROJECT1, PROJECT2] TEAM2/*: allowed_projects: [PROJECT3] check_from: 2014-03-31T12:30 disable_on_push: [git.is_feature_or_bugfix_branch]
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
The Age of the Git Hook - Problems
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
The Age of the Git Hook - Problems
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
The Age of the Git Hook - Problems
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
The Age of the Git Hook - Problems
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
The Age of the Git Hook - Problems
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
The Age of the Git Hook - Problems
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
The Age of the Git Hook - Problems
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
The Age of the Autonomy
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
The Age of the Autonomy
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
The Age of the Autonomy
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
The Age of the Autonomy
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
The Age of the Autonomy - Turnstile https://github.com/zalando/turnstile https://pypi.python.org/pypi/turnstile-core
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
$ pip install turnstile-core Turnstile - How to install it
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
Turnstile - How to use it
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
Turnstile - How to use it
checks:
specification: allowed_schemes: ['https'] branch-release: pattern: '^v(?:\d|\_|\.)+$'
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
Turnstile - How to use it
$ turnstile install
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
Turnstile - More than a hook
○ config ○ install ○ remove ○ specification ○ upgrade ○ version
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
Turnstile - Extending Turnstile
setup( name='turnstile-codevalidator', ... entry_points={ 'turnstile.commands': ['codevalidator = turnstile_cv.command'], 'turnstile.pre_commit': ['codevalidator = turnstile_cv.check']})
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
Turnstile - Extending Turnstile
○ turnstile.commands ○ turnstile.commit_msg ○ turnstile.pre_commit
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
What we learned
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
What we learned
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
What we learned
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
https://pypi.python.org/pypi/turnstile-core https://github.com/zalando/turnstile https://turnstile.readthedocs.org @joaomcsantos
255 105 0 225 225 225 149 149 149 68 84 106 0 0 153 65 0 102 84 28 0 40 40 40
Where to Find Us:
Tech Blog: tech.zalando.com GitHub: github.com/zalando Twitter: @ZalandoTech Instagram: zalandotech Jobs: http://tech.zalando.com/jobs