Customer Need
Due to the rapid growth of the company, both the IT and business areas needed to expedite the deployment of new projects for production and integration with TOTVS systems.
Before the project, the code management process was not centralized, and deployment was done manually on servers. During the deployment window, analysts performed a backup of current files on the server and manually copied files to the destination folders.
Solution Architecture
As code management was distributed among partner software factories and the environment support team, the first step was to centralize all legacy codes into a new repository following the naming standard of other projects: "Camil.TOTVS.Specifics." Git flow was defined as the development standard, allowing different teams to work on the same code repositories. Camil already used CI/CD tools provided by Azure DevOps for other purposes, so this was the chosen tool for the project.
We established a build structure for applications with unit tests using SonarQube, ensuring code quality and mitigating errors in environments. Some rules were configured, such as interrupting the build if the branch attempting to merge is behind the version on the master, ensuring that no changes are accidentally overwritten, as was common in the old flow.
In the deployment process, a rollback stage was created, allowing us to restore the environment in seconds, whereas in the previous process, it took hours. This involved finding the old code version, recompiling the programs, and deploying these artifacts again.
Another proposed and implemented solution was the creation of ephemeral development environments for each project team, based on Golden Images AMIs and automation with Terraform. This approach enabled the delivery of a new, updated, and clean environment for the start of a project more quickly and automatically, relieving the infrastructure team of the burden through infrastructure as code and also restricting access in environments for greater security.
Results
With the centralization of codes, standardization, and automation of build and deploy pipelines, development teams gained more autonomy to deploy code to development and quality environments, ensuring faster delivery. What used to take days for code deployment now takes minutes.
This project process was aligned with agile methodologies already used in other areas by Camil, ensuring better change governance because all code is centralized, and all changes are recorded in Git, facilitating the rollback process in case of failures, reducing MTTR (Mean Time To Repair) from hours/days to minutes.
Another improvement achieved with the implementation of DevOps was the speed of environment delivery to various development teams. With Golden Images AMIs and the use of an IaC pipeline for deploying AWS EC2 and AWS Load Balancer-hosted application environments, providing new resources for each squad that used to take weeks is now done in a few hours, with manager approval and better cost and security control through controlled security groups and IAM accesses for each team.