Our Team is implementing Continuous Integration in one of our major projects. Implementing Continuous Integration (CI) into a major and long running automotive project is a large improvement which dramatically raised our efficiency.
When we create CI not the brightest bulb in the box is to leave previous foundations in ruins. It is best to get to know the process in detail from the technical side, conduct substantive debates with an experienced person and, what is most necessary, use the latest technological solutions. Once we have the complete picture, we can break it down into smaller puzzles. Some fragments are better left unchanged and focus only on running them. Another good practice is to take advantage of a universal programming language like Python and an automation tool like Jenkins which has lots of plugins to simplify the whole process.
When we precisely collect all the aspects and combine them creatively, we can dramatically increase efficiency without turning the entire project upside down. This is not the fastest way, but the only one if we want to be sure that the solution will meet all functionality standards.
Depending on the needs of the project, we can customize Jenkins Pipeline in several ways. We analyzed three ways: Jenkins jobs cascades, Blue Ocean plugin and Declarative Pipeline. In our case, the Declarative Pipeline was the most suitable. The main advantage of which is the use of Jekinsfile, where we are dealing with Groovy syntax. Here we really have unlimited possibilities of adapting individual elements, which are additionally supported by a variety of plugins.
We have some tips and tricks to help you implement this solution as well:
- First read about common Jenkins pipeline mistakes and draw conclusions.
- Good representation of Jenkins file have Visual Studio Code.
- Create more stages. This will show you in which step your program break.
- Consider where you want to storage parameters:
- The best way is to keep the parameters in one place. Jenkins or Jenkinsfile.
- In Jenkinsfile, parameters will be see after next checking out revision.
- In Jenkins, more people have an easier way to access and modify parameters.
- If we have more nodes we could defined it in the parameters as well.
- If we want to call a function in Python with a specific parameter then we can use the following solution.
- To store additional properties returned out by our python code, we can use an additional file stored on the computer with the Jenkins configuration. In this case, the global variable props should be defined at the beginning of the file before pipeline and defined like in the previous screen.
- Post-stage email content should also be kept in Jenkinsfile. It offers HTML interpretation and it is easier to access parameters.
- We can repeat our build process by directly modifying the Jenkinsfile without modifying it on GIT.
Project Management part
To start such implementation, and for better understanding requirements, together with our Project Manager, we created Requirement Traceability Matrix. We did it at the beginning and we determined all functional, non-functional, business, stakeholder requirements. It allowed to determine the scope, needs and milestones which should be implemented.
Additionally we created Activity List, where we listed all activities, which should be performed to implement CI in our project. We used Gitlab as a tool, which supported us in planning, executing, monitoring and controlling process (boards).
Moreover we created Project Network Diagram, where we determined dependencies, did fast tracking, planned activities, and estimated durations of task and project.