SlideShare a Scribd company logo
How to work with versioning and CI/CD
Index

Intro

Tools

Project Organization

How to work on a new issue

Releases

Deployments

Running pipelines
Intro
This handbook focuses on how a developer should work with version control and CI/CD tools.
Tools
Let’s say we use Git as a version control system, GitLab as a repository manager and GitLab
CI/CD for the continuous operations and Archiva to store, manage and to browse build artifacts.
Documentation can be found at the following links:
●
Git
●
GitLab
●
GitLab CI/CD
Project organization: branches
Basically, when a new project is created from scratch it has 2 main branches: master and develop.
master is the branch containing a more stable code. We can think at master branch as the branch
containing the code that lives in production. It doesn’t contain features under development and
under testing. Here it is how a cloned project looks like during development:
Project organization: branches
When a developer starts working on a new task, he creates a new feature branch ad hoc for the
issue. Normally the new branch is named with the word feature followed by the name of the Jira
issue (or sometimes the name of the fix).
The right path is to merge the feature branch to develop (always to develop!) once the work is
done. Next, the code under develop branch can be built and deployed in test environment. Once all
tests are done, the develop branch can be merged into master.
Note: due CI/CD implementation, generally merging a branch into another could have some
consequences, in our environment merging feature branches into develop is totally safe. This
mechanism is explained in the Pipelines chapter.
How to work on a new issue: technically speaking

Clone the project from GitLab, or pull (if it has been cloned before on the workstation)
●
Use git pull or git clone

Create a new feature branch from develop.
●
Use git checkout develop, then git checkout -b feature-yourname

Solve the issue

Commit and push your work
●
git add . #adds all local edits to the commit
●
git commit -am “[name of the issue] - commit message”
●
git pull # get remote edits if there are any
●
git push #push your code to remote repository (set upstream and git push -u to push a new
branch to remote)
How to work on a new issue: a best practice

Squashing commits with rebase
It is a good practice combining commits into a larger one. Normally when a developer reaches a
stable situation he commits the local work. So when the issue is done the local work contains
multiple commits. It’s a good thing doing a git rebase -i to squash commits into a new base one
before pushing to a remote branch.
How to work on a new issue: a requirement

Pull before push, and solve conflicts
When all the work is done and committed, once the developer is ready to push, a pull has to be
done to let Git get to the local repository all the changes others have done. If others have
worked on the same code, Git marks those lines as conflicts, that need to be solved before
pushing.
Conflicts happen also during merge.
Releases
When we are ready to apply changes to a service or a service component and deploy it to an
environment as a result of one or more changes, we do a release.
Possible steps to release are:
●
Set a new Maven version
●
Use: mvn versions:set -DnewVersion=x.x.x
●
Create a tag
●
Use git tag -a "x.x.x" -m "last commit message" ; git push --tags
●
Or create tag directly on GitLab using version and last commit message
●
Merge feature branch to develop
●
Deploy to Archiva (if needed)
●
Use mvn deploy
●
Note: Just deploy only the changed module
Running Pipelines: actual configuration and monitoring
●
pipelines actually should consist of multiple stages
●
Standard stages are build, test, deploy
●
When there is a push on any branch a pipeline is ran. Go to the GitLab project page, CI/CD→
Pipelines to monitoring the status of the pipeline:
●
Check the status (should be green):
●
Click on the button to see the stages:
●
Click again on the stage button to see the logs
Note:
Official GitLab pipelines documentation .
Running Pipelines: goals
The ideal situation for a complete automation is to have a pipeline with 3 stages for all projects,
or at least build and test stage for a good CI/CD implementation. The build stage come for
free, the test stage needs unit tests to be implemented:
●
Build – it runs a mvn clean install
●
Test – it should run unit test normally with mvn verify
●
Deploy (normally only on branch master) – it can move Maven artifacts to some repository, or
jar files to a certain server.
This configuration explains why it is important to have a look at the pipeline configuration
when merging to another branch. As a matter of fact, a merge to master could trigger a
pipeline containing a deploy stage.
Running Pipelines: considerations
Pipelines are a good way to have a general projects overview.
As an example changes on a Kafka producer could break a consumer pipeline.

More Related Content

PDF
Lightweight continuous delivery for small schools
Charles Fulton
 
PDF
Jenkins : Pipeline As Code
Shreyas Chaudhari
 
PPTX
Simple ci cd with strider cd
Amandeep Singh
 
PDF
Git Series. Episode 3. Git Flow and Github-Flow
Mikhail Melnik
 
PPTX
Introduce to Git and Jenkins
An Nguyen
 
PPTX
Introduction to DevOps. Continuous Integration by Myroslav Dmytrus
Binary Studio
 
PDF
User story workflow (eng)
Anatoliy Okhotnikov
 
PDF
Git introduction for Beginners
MortezaTaghaddomi
 
Lightweight continuous delivery for small schools
Charles Fulton
 
Jenkins : Pipeline As Code
Shreyas Chaudhari
 
Simple ci cd with strider cd
Amandeep Singh
 
Git Series. Episode 3. Git Flow and Github-Flow
Mikhail Melnik
 
Introduce to Git and Jenkins
An Nguyen
 
Introduction to DevOps. Continuous Integration by Myroslav Dmytrus
Binary Studio
 
User story workflow (eng)
Anatoliy Okhotnikov
 
Git introduction for Beginners
MortezaTaghaddomi
 

What's hot (20)

PDF
[WroclawJUG] Continuous Delivery in OSS using Shipkit
MarcinStachniuk
 
PPTX
Branching Strategies For Git and Subversion
Elian, I.
 
PDF
Platform SDK Update
Adnan Begovic
 
PPTX
Git and Gerrit Code Review - Tech Talk - 2010_09_23
msohn
 
PDF
Git essentials
Otto Kekäläinen
 
PDF
CI/CD Pipeline as a Code using Jenkins 2
Mayank Patel
 
PPTX
Git for work groups ironhack talk
Tiago Ameller
 
PDF
Continuous Delivery: 5 years later (Incontro DevOps 2018)
Giovanni Toraldo
 
PPTX
Test-Driven-Development for Networking: Making CI Work for You by Colin McNam...
DevOps4Networks
 
PPTX
Continuously Break The Android
Hasan Hosgel
 
PPTX
Cloud Native CI/CD with Spring Cloud Pipelines
Lars Rosenquist
 
PDF
Large Scale Development with Git and Gerrit - EclipseCon Europe 2012
msohn
 
PDF
Git flow for daily use
Mediacurrent
 
PDF
Continuous Delivery in OSS using Shipkit.org
MarcinStachniuk
 
PPTX
Git introduction
Ivan Adhi Prasetya
 
PDF
Refine your ci:cd pipeline with automated test
Malang QA Community
 
PDF
Continuous Integration
Alea Soluciones, S.L.
 
PDF
Git workflows
Sergiu Savva
 
TXT
!!Readme
Hasim Ashari
 
PDF
Releaseflow: a healthy build and deploy process
Christopher Cundill
 
[WroclawJUG] Continuous Delivery in OSS using Shipkit
MarcinStachniuk
 
Branching Strategies For Git and Subversion
Elian, I.
 
Platform SDK Update
Adnan Begovic
 
Git and Gerrit Code Review - Tech Talk - 2010_09_23
msohn
 
Git essentials
Otto Kekäläinen
 
CI/CD Pipeline as a Code using Jenkins 2
Mayank Patel
 
Git for work groups ironhack talk
Tiago Ameller
 
Continuous Delivery: 5 years later (Incontro DevOps 2018)
Giovanni Toraldo
 
Test-Driven-Development for Networking: Making CI Work for You by Colin McNam...
DevOps4Networks
 
Continuously Break The Android
Hasan Hosgel
 
Cloud Native CI/CD with Spring Cloud Pipelines
Lars Rosenquist
 
Large Scale Development with Git and Gerrit - EclipseCon Europe 2012
msohn
 
Git flow for daily use
Mediacurrent
 
Continuous Delivery in OSS using Shipkit.org
MarcinStachniuk
 
Git introduction
Ivan Adhi Prasetya
 
Refine your ci:cd pipeline with automated test
Malang QA Community
 
Continuous Integration
Alea Soluciones, S.L.
 
Git workflows
Sergiu Savva
 
!!Readme
Hasim Ashari
 
Releaseflow: a healthy build and deploy process
Christopher Cundill
 
Ad

Similar to Developing with versioning and CI/CD (20)

PPTX
Git & GitLab
Gaurav Wable
 
PPTX
GIT In Detail
Haitham Raik
 
PPTX
An introduction to Git and GitFlow
Mark Everard
 
PPTX
Git in Continuous Deployment
Brett Child
 
PDF
Intro to Gitflow
Ben Speakmon
 
PDF
Be a Happier Developer with Git / Productive Team #gettinggitright
Shunsuke (Sean) Osawa
 
PPTX
Git more done
Kwen Peterson
 
PDF
Git and Git Workflow Models as Catalysts of Software Development
Lemi Orhan Ergin
 
PPTX
Ultimate Git Workflow - Seoul 2015
Atlassian 대한민국
 
PDF
Introducing Git and git flow
Sebin Benjamin
 
PPTX
Git.From thorns to the stars
Strannik_2013
 
PDF
Git basics
Amit Sawhney
 
PDF
Git Branching for Agile Teams
Atlassian
 
PPTX
Understanding GitFlow by Ian Vizarra
vzrx23
 
PDF
Git Tutorial
Ahmed Taha
 
PDF
Git workshop
Al Sayed Gamal
 
PPTX
Learn Git - For Beginners and Intermediate levels
Gorav Singal
 
PDF
The benefits of using Git
Yannick Warnier
 
PPTX
Git
Shinu Suresh
 
Git & GitLab
Gaurav Wable
 
GIT In Detail
Haitham Raik
 
An introduction to Git and GitFlow
Mark Everard
 
Git in Continuous Deployment
Brett Child
 
Intro to Gitflow
Ben Speakmon
 
Be a Happier Developer with Git / Productive Team #gettinggitright
Shunsuke (Sean) Osawa
 
Git more done
Kwen Peterson
 
Git and Git Workflow Models as Catalysts of Software Development
Lemi Orhan Ergin
 
Ultimate Git Workflow - Seoul 2015
Atlassian 대한민국
 
Introducing Git and git flow
Sebin Benjamin
 
Git.From thorns to the stars
Strannik_2013
 
Git basics
Amit Sawhney
 
Git Branching for Agile Teams
Atlassian
 
Understanding GitFlow by Ian Vizarra
vzrx23
 
Git Tutorial
Ahmed Taha
 
Git workshop
Al Sayed Gamal
 
Learn Git - For Beginners and Intermediate levels
Gorav Singal
 
The benefits of using Git
Yannick Warnier
 
Ad

Recently uploaded (20)

DOCX
Can You Build Dashboards Using Open Source Visualization Tool.docx
Varsha Nayak
 
PPTX
AI-Ready Handoff: Auto-Summaries & Draft Emails from MQL to Slack in One Flow
bbedford2
 
PPTX
Presentation about variables and constant.pptx
kr2589474
 
PDF
WatchTraderHub - Watch Dealer software with inventory management and multi-ch...
WatchDealer Pavel
 
PPTX
ConcordeApp: Engineering Global Impact & Unlocking Billions in Event ROI with AI
chastechaste14
 
PPTX
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
PPTX
Presentation about variables and constant.pptx
safalsingh810
 
PDF
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
ESUG
 
PPT
Activate_Methodology_Summary presentatio
annapureddyn
 
PPTX
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
PDF
An Experience-Based Look at AI Lead Generation Pricing, Features & B2B Results
Thomas albart
 
PDF
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
PPTX
Explanation about Structures in C language.pptx
Veeral Rathod
 
PDF
Appium Automation Testing Tutorial PDF: Learn Mobile Testing in 7 Days
jamescantor38
 
PPTX
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
PPTX
Presentation about Database and Database Administrator
abhishekchauhan86963
 
PDF
Jenkins: An open-source automation server powering CI/CD Automation
SaikatBasu37
 
PDF
Protecting the Digital World Cyber Securit
dnthakkar16
 
PPTX
oapresentation.pptx
mehatdhavalrajubhai
 
PPTX
Contractor Management Platform and Software Solution for Compliance
SHEQ Network Limited
 
Can You Build Dashboards Using Open Source Visualization Tool.docx
Varsha Nayak
 
AI-Ready Handoff: Auto-Summaries & Draft Emails from MQL to Slack in One Flow
bbedford2
 
Presentation about variables and constant.pptx
kr2589474
 
WatchTraderHub - Watch Dealer software with inventory management and multi-ch...
WatchDealer Pavel
 
ConcordeApp: Engineering Global Impact & Unlocking Billions in Event ROI with AI
chastechaste14
 
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
Presentation about variables and constant.pptx
safalsingh810
 
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
ESUG
 
Activate_Methodology_Summary presentatio
annapureddyn
 
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
An Experience-Based Look at AI Lead Generation Pricing, Features & B2B Results
Thomas albart
 
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
Explanation about Structures in C language.pptx
Veeral Rathod
 
Appium Automation Testing Tutorial PDF: Learn Mobile Testing in 7 Days
jamescantor38
 
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
Presentation about Database and Database Administrator
abhishekchauhan86963
 
Jenkins: An open-source automation server powering CI/CD Automation
SaikatBasu37
 
Protecting the Digital World Cyber Securit
dnthakkar16
 
oapresentation.pptx
mehatdhavalrajubhai
 
Contractor Management Platform and Software Solution for Compliance
SHEQ Network Limited
 

Developing with versioning and CI/CD

  • 1. How to work with versioning and CI/CD
  • 2. Index  Intro  Tools  Project Organization  How to work on a new issue  Releases  Deployments  Running pipelines
  • 3. Intro This handbook focuses on how a developer should work with version control and CI/CD tools.
  • 4. Tools Let’s say we use Git as a version control system, GitLab as a repository manager and GitLab CI/CD for the continuous operations and Archiva to store, manage and to browse build artifacts. Documentation can be found at the following links: ● Git ● GitLab ● GitLab CI/CD
  • 5. Project organization: branches Basically, when a new project is created from scratch it has 2 main branches: master and develop. master is the branch containing a more stable code. We can think at master branch as the branch containing the code that lives in production. It doesn’t contain features under development and under testing. Here it is how a cloned project looks like during development:
  • 6. Project organization: branches When a developer starts working on a new task, he creates a new feature branch ad hoc for the issue. Normally the new branch is named with the word feature followed by the name of the Jira issue (or sometimes the name of the fix). The right path is to merge the feature branch to develop (always to develop!) once the work is done. Next, the code under develop branch can be built and deployed in test environment. Once all tests are done, the develop branch can be merged into master. Note: due CI/CD implementation, generally merging a branch into another could have some consequences, in our environment merging feature branches into develop is totally safe. This mechanism is explained in the Pipelines chapter.
  • 7. How to work on a new issue: technically speaking  Clone the project from GitLab, or pull (if it has been cloned before on the workstation) ● Use git pull or git clone  Create a new feature branch from develop. ● Use git checkout develop, then git checkout -b feature-yourname  Solve the issue  Commit and push your work ● git add . #adds all local edits to the commit ● git commit -am “[name of the issue] - commit message” ● git pull # get remote edits if there are any ● git push #push your code to remote repository (set upstream and git push -u to push a new branch to remote)
  • 8. How to work on a new issue: a best practice  Squashing commits with rebase It is a good practice combining commits into a larger one. Normally when a developer reaches a stable situation he commits the local work. So when the issue is done the local work contains multiple commits. It’s a good thing doing a git rebase -i to squash commits into a new base one before pushing to a remote branch.
  • 9. How to work on a new issue: a requirement  Pull before push, and solve conflicts When all the work is done and committed, once the developer is ready to push, a pull has to be done to let Git get to the local repository all the changes others have done. If others have worked on the same code, Git marks those lines as conflicts, that need to be solved before pushing. Conflicts happen also during merge.
  • 10. Releases When we are ready to apply changes to a service or a service component and deploy it to an environment as a result of one or more changes, we do a release. Possible steps to release are: ● Set a new Maven version ● Use: mvn versions:set -DnewVersion=x.x.x ● Create a tag ● Use git tag -a "x.x.x" -m "last commit message" ; git push --tags ● Or create tag directly on GitLab using version and last commit message ● Merge feature branch to develop ● Deploy to Archiva (if needed) ● Use mvn deploy ● Note: Just deploy only the changed module
  • 11. Running Pipelines: actual configuration and monitoring ● pipelines actually should consist of multiple stages ● Standard stages are build, test, deploy ● When there is a push on any branch a pipeline is ran. Go to the GitLab project page, CI/CD→ Pipelines to monitoring the status of the pipeline: ● Check the status (should be green): ● Click on the button to see the stages: ● Click again on the stage button to see the logs Note: Official GitLab pipelines documentation .
  • 12. Running Pipelines: goals The ideal situation for a complete automation is to have a pipeline with 3 stages for all projects, or at least build and test stage for a good CI/CD implementation. The build stage come for free, the test stage needs unit tests to be implemented: ● Build – it runs a mvn clean install ● Test – it should run unit test normally with mvn verify ● Deploy (normally only on branch master) – it can move Maven artifacts to some repository, or jar files to a certain server. This configuration explains why it is important to have a look at the pipeline configuration when merging to another branch. As a matter of fact, a merge to master could trigger a pipeline containing a deploy stage.
  • 13. Running Pipelines: considerations Pipelines are a good way to have a general projects overview. As an example changes on a Kafka producer could break a consumer pipeline.