Transcript
Page 1: Smart development environments

Smart development

environmentS

Page 2: Smart development environments

Szczyrk 27.10.2013

Wojciech Sznapka

PHPCon Pl

Page 3: Smart development environments
Page 4: Smart development environments
Page 5: Smart development environments

Cześć!:)

Page 6: Smart development environments

Hanys ze Ślůnska wito Wos

pierońsko piyknie

Page 7: Smart development environments

Since 2006 regularly in a teams of developers

Page 8: Smart development environments

Loves software craftsmanship,

sophisticated architectures, Big Data and automation

Page 9: Smart development environments

Why a development environment needS care?

Page 10: Smart development environments

Because mess frustrates people

Page 11: Smart development environments

And repetitions leads to routine and are always

error prone

Page 12: Smart development environments

Automation is always better than written process

Page 13: Smart development environments

the verSion control

Page 14: Smart development environments

GitHub private repositories

Page 15: Smart development environments
Page 16: Smart development environments

Every team member has his own fork

Page 17: Smart development environments

He creates a feature branch related to the User Story from

Jira, he is working on

Page 18: Smart development environments

He works on his own machine

Page 19: Smart development environments
Page 20: Smart development environments

After a series of commits to his feature branch he opens

a pull request

Page 21: Smart development environments

Other devs review the code

and make comments

Page 22: Smart development environments

pro tip: smaller pull request are easier to review

and maintain

Page 23: Smart development environments

Developer fixes things and pushes again

Page 24: Smart development environments

The responsible person merges pull request into

develop branch

Page 25: Smart development environments

the code metricS

Page 26: Smart development environments

Most of new projects are started based on Symfony

XSolve Edition

Page 27: Smart development environments
Page 28: Smart development environments

It contains standard build.xml for Ant

Page 29: Smart development environments

There are around 28 targets

Page 30: Smart development environments

Most important are:

Page 31: Smart development environments

Most important are: » build - used to deploy

Page 32: Smart development environments

Most important are: » build - used to deploy

» ci - run on Jenkins

Page 33: Smart development environments

Most important are: » build — used to deploy

» ci — run on Jenkins

» cli — runs code sniffer, mess detector, copy paste detector on ClI to check curremt

status before committing

Page 34: Smart development environments

Most important are: » build — used to deploy

» ci — run on Jenkins

» cli — runs code sniffer, mess detector, copy paste detector on ClI to check curremt

status before committing

» thresholds-check — to build PRs

Page 35: Smart development environments

Code metrics are collected by Jenkins

and available there

Page 36: Smart development environments

BuildS

Page 37: Smart development environments

We build every change in develop branch

Page 38: Smart development environments

Also we build every project in the morning to see

if passing time hasn’t affected the code :-)

Page 39: Smart development environments

The third build goes for Pull Requests

Page 40: Smart development environments

We’ve integrated Jenkins GitHub PR Builder

Page 41: Smart development environments

It runs tests and checks if code metrics

warnings don’t exceed thresholds

Page 42: Smart development environments
Page 43: Smart development environments
Page 44: Smart development environments
Page 45: Smart development environments

This mechanisms helps us to not watch for code style

or obvious things during code reviews, but to focus on

what’s important

Page 46: Smart development environments

deploymentS

Page 47: Smart development environments

A standard servers structure:

Page 48: Smart development environments

A standard servers structure: » development

Page 49: Smart development environments

A standard servers structure: » development

» ci server

Page 50: Smart development environments

A standard servers structure: » development

» ci server

» test server

Page 51: Smart development environments

A standard servers structure: » development

» ci server

» test server

» stagagging (a.k.a. preview) server

Page 52: Smart development environments

A standard servers structure: » development

» ci server

» test server

» stagagging (a.k.a. preview) server

» production

Page 53: Smart development environments

We use launcher to update application on test

and stagging server

Page 54: Smart development environments

launcher is our Silex based application that

launches ant tasks, triggered by github hook

Page 55: Smart development environments

it updates test env for every change...

Page 56: Smart development environments

... and staging for every new tag

Page 57: Smart development environments

communication

Page 58: Smart development environments

We use hipchat

Page 59: Smart development environments
Page 60: Smart development environments

it has a great and simple api

Page 61: Smart development environments

and plenty of tools has built-in integration

Page 62: Smart development environments

and plenty of tools has built-in integration

» Github

Page 63: Smart development environments

and plenty of tools has built-in integration

» Github

» jira

Page 64: Smart development environments

and plenty of tools has built-in integration

» Github

» jira

» jenkins

Page 65: Smart development environments

and plenty of tools has built-in integration

» Github

» jira

» jenkins

» new relic

Page 66: Smart development environments

and plenty of tools has built-in integration

» Github

» jira

» jenkins

» new relic

» zabbix

Page 67: Smart development environments

also our internal tools uses hipchat api to notify

important facts

Page 68: Smart development environments

of course we have github, jira, jenkins emails

notifications

Page 69: Smart development environments

extraS

Page 70: Smart development environments

Github-metrics

Page 71: Smart development environments

it counts pull requests and commits per developer

across all repos and pushes it to hipchat every morning

at 10:00

Page 72: Smart development environments
Page 73: Smart development environments

xSolve developers metrics

Page 74: Smart development environments

harvesters jenkins api to get number of violations

(or fixes) for every developer

Page 75: Smart development environments
Page 76: Smart development environments

Summary

Page 77: Smart development environments

it requires a lot of effort to put all those tools

together

Page 78: Smart development environments

even more work is required to maintain and keeps it

running

Page 79: Smart development environments

But after some time it works gloriously

Page 80: Smart development environments

teams don’t waste time on non-programming

work

Page 81: Smart development environments

it’s way easier to introduce new team

members

Page 82: Smart development environments

and you have a lot more time to think about solving world’s problems

Page 83: Smart development environments

thank you

Page 84: Smart development environments

[email protected]

@tWitter tWitter.com/Sznapka

@GithuB GithuB.com/WoWo

Page 85: Smart development environments

Dołącz do nas!


Top Related