Slide 1

Slide 1 text

CI/CD for PHP Applications Bruno Ricardo Siqueira PHPDublin 16-10-2019 1

Slide 2

Slide 2 text

2 I am Bruno Ricardo Siqueira ● Brazilian ● ~12 years in Software Development ● Software Engineer, Tech Lead, Software Development Manager ● Working at Smartbox since 2016 ● PHPSanca, PHPCampinas, PHPSP, PHPDublin Hello!

Slide 3

Slide 3 text

3 1. CI/CD definition 2. Which problems to solve? 3. Implementation challenges 4. Mindset 5. OSS tools 6. How to sell it to business? Agenda

Slide 4

Slide 4 text

1. CI/CD definition Continuous integration and continuous delivery

Slide 5

Slide 5 text

Continuous Integration Developers practicing continuous integration merge their changes back to the main branch as often as possible. The developer's changes are validated by creating a build and running automated tests against the build. [...] Continuous Delivery It is an extension of continuous integration to make sure that you can release new changes to your customers quickly in a sustainable way. This means that on top of having automated your testing, you also have automated your release process and you can deploy your application at any point of time by clicking on a button. [...] 5 Source: https://www.atlassian.com/continuous-delivery/principles/continuous-integration-vs-delivery-vs-deployment

Slide 6

Slide 6 text

6 Source: https://edge.siriuscom.com/digital/continuous-integration-and-continuous-delivery-beyond-the-conveyor-belt-mentality

Slide 7

Slide 7 text

7 2. Which problems to solve?

Slide 8

Slide 8 text

CI ● Change conflicts when trying to merge ● Pushes to the integration branch are proportional to the number of the developers ● Long living branches are evil 8

Slide 9

Slide 9 text

CD ● Big releases are risky ● Delay to release features that are read lead to “money” loss ● Development teams get frustrated and less engaged if they don’t see their work in production [1] 9 1: https://continuousdelivery.com/evidence-case-studies/#research

Slide 10

Slide 10 text

10

Slide 11

Slide 11 text

11 3. Implementation Challenges

Slide 12

Slide 12 text

“Maintenance and integration costs, predominantly human resources costs. 12

Slide 13

Slide 13 text

“Development is slowed/blocked by the operations team 13

Slide 14

Slide 14 text

“It requires some trial and error to find a good approach for a given context 14

Slide 15

Slide 15 text

15 4. Mindset

Slide 16

Slide 16 text

16

Slide 17

Slide 17 text

Key enablers Team The team needs to be as auto sufficient and diverse as possible Iterative approach Work on a vision, iterate and improve towards the target Engage with business Make sure that product owners and stakeholders are aligned with the CI/CD trade-offs 17 Test automation The test suite needs to be fast, reliable and cover all the critical business logic. Avoid NIH, abuse PFE Be aware about the tradeoffs of Not Invented Here vs Proudly Found Elsewhere. There is no silver bullet Create an understanding about the problems you are proposing to solve

Slide 18

Slide 18 text

18 5. OSS tools Focused for PHP context

Slide 19

Slide 19 text

Main categories 19 1 Code quality & static analysis 2 Test autom ation 3 Pipeline technology

Slide 20

Slide 20 text

20 Code quality and static analysis ... and many more [2] 2: https://github.com/mre/awesome-static-analysis PHPStan

Slide 21

Slide 21 text

21 let’s take a look at it...

Slide 22

Slide 22 text

22 Test automation PHP infection ... and many more [3] 3: https://github.com/atinfo/awesome-test-automation/blob/master/php-test-automation.md

Slide 23

Slide 23 text

23 let’s take a look at it...

Slide 24

Slide 24 text

24 Pipeline technology

Slide 25

Slide 25 text

25 let’s take a look at it...

Slide 26

Slide 26 text

26 6. How to sell it to business? It’s actually quite “simple”...

Slide 27

Slide 27 text

It’s about money! 27

Slide 28

Slide 28 text

Quantify the benefits Time to market Project and raise a KPI about how long a feature will take to be in production Less risks Smaller releases are less risky and easy to A/B test or even rollback Application quality Finding issues in the code incrementaly is cheaper and less prone to errors 28 Automation ROI Automation is costly but in the mid/long term less time doing manual steps (testing, deploying, etc) means more time implementing features Team satisfaction CI/CD is about delivering fast and seeing your work in production matters! Happy developers: less attrition Prototyping A fast release proccess means more hability to change features and prototype quickier

Slide 29

Slide 29 text

Questions? You can find me at: ● @brunoric ● https://brunoric.info 29

Slide 30

Slide 30 text

Thank you - Danke - Gracias - Merci Grazie - Tak - Tack - Dank u - Obrigado