SlideShare una empresa de Scribd logo
1 de 13
Descargar para leer sin conexión
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.

Más contenido relacionado

La actualidad más candente

[WroclawJUG] Continuous Delivery in OSS using Shipkit
[WroclawJUG] Continuous Delivery in OSS using Shipkit[WroclawJUG] Continuous Delivery in OSS using Shipkit
[WroclawJUG] Continuous Delivery in OSS using ShipkitMarcinStachniuk
 
Branching Strategies For Git and Subversion
Branching Strategies For Git and SubversionBranching Strategies For Git and Subversion
Branching Strategies For Git and SubversionElian, I.
 
Git and Gerrit Code Review - Tech Talk - 2010_09_23
Git and Gerrit Code Review - Tech Talk - 2010_09_23Git and Gerrit Code Review - Tech Talk - 2010_09_23
Git and Gerrit Code Review - Tech Talk - 2010_09_23msohn
 
CI/CD Pipeline as a Code using Jenkins 2
CI/CD Pipeline as a Code using Jenkins 2CI/CD Pipeline as a Code using Jenkins 2
CI/CD Pipeline as a Code using Jenkins 2Mayank Patel
 
Git for work groups ironhack talk
Git for work groups ironhack talkGit for work groups ironhack talk
Git for work groups ironhack talkTiago Ameller
 
Continuous Delivery: 5 years later (Incontro DevOps 2018)
Continuous Delivery: 5 years later (Incontro DevOps 2018)Continuous Delivery: 5 years later (Incontro DevOps 2018)
Continuous Delivery: 5 years later (Incontro DevOps 2018)Giovanni Toraldo
 
Test-Driven-Development for Networking: Making CI Work for You by Colin McNam...
Test-Driven-Development for Networking: Making CI Work for You by Colin McNam...Test-Driven-Development for Networking: Making CI Work for You by Colin McNam...
Test-Driven-Development for Networking: Making CI Work for You by Colin McNam...DevOps4Networks
 
Continuously Break The Android
Continuously Break The AndroidContinuously Break The Android
Continuously Break The AndroidHasan Hosgel
 
Cloud Native CI/CD with Spring Cloud Pipelines
Cloud Native CI/CD with Spring Cloud PipelinesCloud Native CI/CD with Spring Cloud Pipelines
Cloud Native CI/CD with Spring Cloud PipelinesLars Rosenquist
 
Large Scale Development with Git and Gerrit - EclipseCon Europe 2012
Large Scale Development with Git and Gerrit - EclipseCon Europe 2012Large Scale Development with Git and Gerrit - EclipseCon Europe 2012
Large Scale Development with Git and Gerrit - EclipseCon Europe 2012msohn
 
Git flow for daily use
Git flow for daily useGit flow for daily use
Git flow for daily useMediacurrent
 
Continuous Delivery in OSS using Shipkit.org
Continuous Delivery in OSS using Shipkit.orgContinuous Delivery in OSS using Shipkit.org
Continuous Delivery in OSS using Shipkit.orgMarcinStachniuk
 
Refine your ci:cd pipeline with automated test
Refine your ci:cd pipeline with automated testRefine your ci:cd pipeline with automated test
Refine your ci:cd pipeline with automated testMalang QA Community
 
Releaseflow: a healthy build and deploy process
Releaseflow: a healthy build and deploy processReleaseflow: a healthy build and deploy process
Releaseflow: a healthy build and deploy processChristopher Cundill
 

La actualidad más candente (20)

[WroclawJUG] Continuous Delivery in OSS using Shipkit
[WroclawJUG] Continuous Delivery in OSS using Shipkit[WroclawJUG] Continuous Delivery in OSS using Shipkit
[WroclawJUG] Continuous Delivery in OSS using Shipkit
 
Branching Strategies For Git and Subversion
Branching Strategies For Git and SubversionBranching Strategies For Git and Subversion
Branching Strategies For Git and Subversion
 
Platform SDK Update
Platform SDK UpdatePlatform SDK Update
Platform SDK Update
 
Git and Gerrit Code Review - Tech Talk - 2010_09_23
Git and Gerrit Code Review - Tech Talk - 2010_09_23Git and Gerrit Code Review - Tech Talk - 2010_09_23
Git and Gerrit Code Review - Tech Talk - 2010_09_23
 
Git essentials
Git essentialsGit essentials
Git essentials
 
CI/CD Pipeline as a Code using Jenkins 2
CI/CD Pipeline as a Code using Jenkins 2CI/CD Pipeline as a Code using Jenkins 2
CI/CD Pipeline as a Code using Jenkins 2
 
Git for work groups ironhack talk
Git for work groups ironhack talkGit for work groups ironhack talk
Git for work groups ironhack talk
 
Continuous Delivery: 5 years later (Incontro DevOps 2018)
Continuous Delivery: 5 years later (Incontro DevOps 2018)Continuous Delivery: 5 years later (Incontro DevOps 2018)
Continuous Delivery: 5 years later (Incontro DevOps 2018)
 
Test-Driven-Development for Networking: Making CI Work for You by Colin McNam...
Test-Driven-Development for Networking: Making CI Work for You by Colin McNam...Test-Driven-Development for Networking: Making CI Work for You by Colin McNam...
Test-Driven-Development for Networking: Making CI Work for You by Colin McNam...
 
Continuously Break The Android
Continuously Break The AndroidContinuously Break The Android
Continuously Break The Android
 
Cloud Native CI/CD with Spring Cloud Pipelines
Cloud Native CI/CD with Spring Cloud PipelinesCloud Native CI/CD with Spring Cloud Pipelines
Cloud Native CI/CD with Spring Cloud Pipelines
 
Large Scale Development with Git and Gerrit - EclipseCon Europe 2012
Large Scale Development with Git and Gerrit - EclipseCon Europe 2012Large Scale Development with Git and Gerrit - EclipseCon Europe 2012
Large Scale Development with Git and Gerrit - EclipseCon Europe 2012
 
Git flow for daily use
Git flow for daily useGit flow for daily use
Git flow for daily use
 
Continuous Delivery in OSS using Shipkit.org
Continuous Delivery in OSS using Shipkit.orgContinuous Delivery in OSS using Shipkit.org
Continuous Delivery in OSS using Shipkit.org
 
Git introduction
Git introductionGit introduction
Git introduction
 
Refine your ci:cd pipeline with automated test
Refine your ci:cd pipeline with automated testRefine your ci:cd pipeline with automated test
Refine your ci:cd pipeline with automated test
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous Integration
 
Git workflows
Git workflowsGit workflows
Git workflows
 
!!Readme
!!Readme!!Readme
!!Readme
 
Releaseflow: a healthy build and deploy process
Releaseflow: a healthy build and deploy processReleaseflow: a healthy build and deploy process
Releaseflow: a healthy build and deploy process
 

Similar a Developing with versioning and CI/CD

Introducing Git and git flow
Introducing Git and git flow Introducing Git and git flow
Introducing Git and git flow Sebin Benjamin
 
Git - Simplified For Testers
Git - Simplified For TestersGit - Simplified For Testers
Git - Simplified For Testersupadhyay_25
 
Checkitmobile - using Git for development
Checkitmobile - using Git for developmentCheckitmobile - using Git for development
Checkitmobile - using Git for developmentGerrit Wanderer
 
Git for developers
Git for developersGit for developers
Git for developersHacen Dadda
 
Brief tutorial on Git
Brief tutorial on GitBrief tutorial on Git
Brief tutorial on Git聖文 鄭
 
Mastering git - Workflow
Mastering git - WorkflowMastering git - Workflow
Mastering git - WorkflowTahsin Abrar
 
Git usage (Basics and workflow)
Git usage (Basics and workflow)Git usage (Basics and workflow)
Git usage (Basics and workflow)Yeasin Abedin
 
Using Git to Organize Your Project
Using Git to Organize Your ProjectUsing Git to Organize Your Project
Using Git to Organize Your ProjectManish Suwal 'Enwil'
 
Git and Github.pptx
Git and Github.pptxGit and Github.pptx
Git and Github.pptxHitesh670643
 
3DC Intro to Git Workshop
3DC Intro to Git Workshop3DC Intro to Git Workshop
3DC Intro to Git WorkshopBeckhamWee
 
Collaborative development with Git | Workshop
Collaborative development with Git | WorkshopCollaborative development with Git | Workshop
Collaborative development with Git | WorkshopAnuchit Chalothorn
 
Openstack contribution process
Openstack contribution processOpenstack contribution process
Openstack contribution processSyed Armani
 

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

Introducing Git and git flow
Introducing Git and git flow Introducing Git and git flow
Introducing Git and git flow
 
Git - Simplified For Testers
Git - Simplified For TestersGit - Simplified For Testers
Git - Simplified For Testers
 
git-flow R3Labs
git-flow R3Labsgit-flow R3Labs
git-flow R3Labs
 
Git & GitLab
Git & GitLabGit & GitLab
Git & GitLab
 
Checkitmobile - using Git for development
Checkitmobile - using Git for developmentCheckitmobile - using Git for development
Checkitmobile - using Git for development
 
Git for developers
Git for developersGit for developers
Git for developers
 
Brief tutorial on Git
Brief tutorial on GitBrief tutorial on Git
Brief tutorial on Git
 
git Technologies
git Technologiesgit Technologies
git Technologies
 
Mastering git - Workflow
Mastering git - WorkflowMastering git - Workflow
Mastering git - Workflow
 
Git usage (Basics and workflow)
Git usage (Basics and workflow)Git usage (Basics and workflow)
Git usage (Basics and workflow)
 
Git
GitGit
Git
 
Using Git to Organize Your Project
Using Git to Organize Your ProjectUsing Git to Organize Your Project
Using Git to Organize Your Project
 
Git and Github.pptx
Git and Github.pptxGit and Github.pptx
Git and Github.pptx
 
3DC Intro to Git Workshop
3DC Intro to Git Workshop3DC Intro to Git Workshop
3DC Intro to Git Workshop
 
Github
GithubGithub
Github
 
Git & Github
Git & GithubGit & Github
Git & Github
 
Formation git
Formation gitFormation git
Formation git
 
Git
GitGit
Git
 
Collaborative development with Git | Workshop
Collaborative development with Git | WorkshopCollaborative development with Git | Workshop
Collaborative development with Git | Workshop
 
Openstack contribution process
Openstack contribution processOpenstack contribution process
Openstack contribution process
 

Último

Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 

Último (20)

Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 

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.