By J. Gross - The Expert PHP DevOps Developer at SQUAD

What are the best practices for DevOps? Discover concrete examples of processes and tools in this paper!
Good communication for better cooperation
- Invite Ops from the start of projects, and regularly during sprint reviews (rather than only in the event of crises).
- Maintain a relationship between Devs, Ops, Metrology, and Security
- Kanbantool: for greater transparency and anticipation in everyone's tasks. Principle of not cluttering up the next stage in the production chain, thereby streamlining the stages up to production.
- Mattermosttool: to create rooms by theme (e.g., "deliveries," "featureX," "integration," "blah blah," etc.) and receive tool notifications (e.g., Jenkins to notify of build errors).
Implementation of continuous integration to increase confidence in deliverables
The goal is to get into production faster and more often, to respond quickly to customer needs and grow the business. This involves automating everything that does not add value to being done "manually" by a Dev/Ops engineer.
Putting into production faster and more often is possible if you have a high level of confidence in the deliverable: implementing Continuous Integration allows you to identify potential problems as quickly as possible, such as regressions, tested but unqualified development, performance issues, etc.
Next, a strategy of "feature branches" such asGitFlowwill allow flexibility in the list of items to be delivered.
Here is a possible continuous integration chain:
- Integration of a development branch (change to be integrated) into an integration branch (automated byJenkinsor merge request inGitLab)
- Deployment of the integration branch code to an integration environment (automated by Jenkins orGitLab CI)
- Launch of unit tests (PHPUnitfor PHP) and functional tests on the interface (Selenium) in this environment.
- static code analysis on the integration branch (Jenkins/Sonar tools)
- If machine resources allow, run tests and perform a code review before integrating the development branch. And yes, this will allow you to get feedback even earlier without potentially "polluting" the integration branch.
Automated deployment, to prepare for continuous deployment
Deployment in testing and pre-production should be automated as much as possible, since it doesn't require any thought or decision-making on the part of Devs/Ops, right?
- Deploy in acceptance testing via Jenkins, with a simple "press button"
- Automation of changelog creation, which will be published with each release.
- Notify Qualifiers/Analysts/Devs/Ops via email/Mattermost of this new delivery.
“You can only improve what you measure.”
A simple expression to remember that expresses a common-sense idea: tracking KPIs (Key Performance Indicators)on various topics helps to develop the product in the right direction.
In fact, similar to operational monitoring, setting up a web dashboard that displays the selected KPIs, ideally viewable on a TV in the office so that everyone can see it.
Some examples of KPIs:
- technical: technical debt, code coverage
- operational: uptime, number of production incidents, number of rollbacks
- business: daily revenue, page views, conversion rate
- customer: number of calls to telephone support, number of registrations/unsubscriptions, time spent on the site
- team: satisfaction, burndown chart
Share challenges and constraints to develop a dynamic of continuous improvement
- Conduct regular retrospectives of what is put into production (systematic in SCRUM methodology).
- Peer code review, in addition to detecting errors, helps spread knowledge of the code to everyone.
- Facilitate access to all types of metrics (business, technical, operational, etc.) using web tools. Ideally, this would involve a web dashboard that brings them all together.
- The ELK tool stack provides access to logs from all environments: developers will be able to debug more efficiently.
We hope this article has provided you with some ideas for implementing DevOps best practices!
