CI CD PipeLine
CI CD PipeLine
Whenever we are working with any product or document we should have the
version and the date of issue of the document. By this we can identify which
version has got what changes and for which period of time.
To solve this problem we use GIT, Git uses distributed version control system.
But before Distributed version control we used to follow central version control
system.
Distributed version control system means, we can have a local repository for
each developer and they can work on it and make changes. Git will take care of
version control system, and finally we can push the code to the remote
repository.
Master branch:
A place where a final solution will be available.
DevOps:
Developer:
A developer is responsible for writing the code as per the client requirement
without any bugs.
Operations:
Operations are used to deploy the application in the production environment
also need to maintain the application and troubleshoot whenever it is needed.
DevOps Definition:
Dependency management
Infrastructure as code chef, puppet
Vigrant is also a devOps tool for creating virtual machine on top od OS
The underlying idea behind a nightly build is that developers do not work on the
source code at night, so the build process does not interfere with anybody’s
work and they have to wait for the current version to deploy. Thus, a nightly
build makes sense for organizations unless they are working on common
software in opposite time zones that are far apart.
Ideally, software development should only take place in one time zone or, at
best, in closely spaced time zones.
Note: But during the built process, if any developers make some changes in the
source code, then the built error will occur. Because of this all developers have
to wait until the issue gets fixed and they can’t make any changes in the source
code until the problem resolved.
CI (Continuous Integration):
In continuous integration (CI) after every commit done by a developer, it will go
for built process, and during the built process it will go through build, test and
finally it will give you a success/failure message based on the last commit.
Example: Hobbes for Assignment
CI (Continuous Integration):
1. Continuous integration is a development practice that requires developers
to integrate code into a shared repository several times a day
2. Each check-in is then verified by an automated build, allowing teams to
detect problems early
3. By integrating regularly, you can detect errors quickly, and locate them
more easily
4. Continuous integration is a way to increase code quality without putting
an extra burden on a developer.
5. Tests and checks of your code are handled on a server and automatically
reported back to you.
Why CI?
1. Run your tests in the real world
2. Increase your code coverage
3. Deploy your code to production
4. Built stuff now
5. Built stuff faster
6. Don’t break stuff
7. Decrease code review time
CI Process:
1. Developers check out code into their private workspaces
2. When done, commit the changes to the repository
3. The CI server monitors the repository and check out changes when they
occur
4. The CI server builds the system and runs unit and integration testing
5. The CI server releases deployable artefacts for testing
6. The CI server assigns a build label to the version of the code it just built
7. The CI server inform the team of the successful built
8. If the build or tests fails, the CI server alerts the team
9. The team fixes the issues at the earliest
10. Continue to integrate and test throughout the project
CI Tools:
Jenkins
Circle CI
Travis CI
Github CI
Gitlab CI
The common thing among all this tools are, they all are using yml for
configuration.
Every CI tool has its own configuration file name format, for Gitlab CI it is as
follows:
.gitlab-ci.yml
After creating an yml file we need to create a runner using a runner machine or
we can call it as Virtual Machine. This runner machine will be responsible to
execute the pipeline, where each pipeline is going to clean, compile, from
maven and run the test cases, and finally it will tell you that you are good go.