What can you accomplish GitLab CI/CD?
Continuous Integration is the practice of merging all the code that is being produced by developers. The merging usually takes place several times a day in a shared repository. From within the repository, or production environment, building and automated testing are carried out that ensure no integration issues and the early identification of any problems.
Continuous Delivery adds that the software can be released to production at any time, often by automatically pushing changes to a staging system.
Continuous Deployment goes further and pushes changes to production automatically.
Continuous Integration (CI) is a way code integrates with shared repositories owned and managed by software development teams. Developers share new code in a Merge Request (“pull request”), triggering a pipeline to build, test, and validate the new code, prior to merging the changes within your repository.
Continuous Delivery (CD) is a practice that ensures the delivery of CI validated code to an application through the orchestration of a structured deployment pipeline. CI and CD must work together seamlessly in order for teams to build fast and effectively, as well placing high priority on the reassurance development practices are optimized fully.
Together, CI and CD accelerate how software teams deliver results to customers and stakeholders. CI helps catch and reduce bugs early in the development cycle, and CD moves verified code to your applications faster.
Here are the features you can use in GitLab for CI/CD. They are shown according to the stage in the DevOps Lifecycle. Next we’ll look at a few of the key features and how to use them in the Verify, Package, and Release stages of the life cycle. We’ll cover the Secure stage later on today.
There are several different features within the GItLab CI/CD flow. Use the following website to complete the exercise below to indicate whether the feature is available with GitLab or not.
https://about.gitlab.com/stages-devops-lifecycle/continuous-integration/
To use GitLab CI/CD, all you need is an application codebase hosted in a Git repository, and for your build, test, and deployment scripts to be specified in a file called .gitlab-ci.yml, located in the root path of your repository.
To use GitLab CI/CD you or your GitLab administrator must first define a pipeline within a YAML file called .gitlab-ci.yml and then install and configure a Gitlab Runner.
.gitlab-ci.yml
Gitlab Runner
This is what a .gitlab-ci.yaml file looks like at a high-level. YAML is a human-readable data format and standard that can be used in conjunction with all programming languages and is often used to write configuration files. (configuration data)
The YAML syntax is stored in the root of a project and version controlled along with the rest of your code
This is an example of a pipeline graph that shows what the CI/CD build looks like. It lets you see how a set of one or more jobs are executed in the stages you define in the YAML file for the pipeline.
Auto DevOps gives you a pre-defined CI/CD configuration which lets you automatically detect, build, test, deploy, and monitor your applications. This makes it easier to set up every project more consistently.
It is enabled by default for all of your projects but can be disabled by your administrator at the instance level. It can be disabled and enabled by GitLab.com users at the project level, and self-managed users can also enable it at the group or instance level.
Now that you have reviewed the basic characteristics of a GitLab CI/CD Pipeline, let’s take a look at some live examples of pipelines using GitLab today.
Example Project 1:
Ruby Auto Deploy - https://gitlab.com/gitlab-examples/ruby-autodeploy
Example Project 2:
Simple Maven App - https://gitlab.com/gitlab-examples/multi-project-pipelines/simple-maven-app
Example Project 3:
AutoDevOps - https://www.youtube.com/watch?v=0Tc0YYBxqi4&ab_channel=GitLab
More Project Examples :
https://gitlab.com/gitlab-examples