Update Continuous Integration and Delivery authored by Jens Henrik Goebbert's avatar Jens Henrik Goebbert
# GitLab Continuous Integration and Delivery (GitLab CI/CD)
# GitLab Continuous Integration, -Delivery and -Deloyment (GitLab CI/CDs)
### Table of Content:
[[_TOC_]]
## Introduction
The benefits of Continuous Integration (CI) and Continuous Delivery (CD) are huge when automation plays an integral part of your workflow.
Each Git commit or push can trigger a CI/CD pipeline, if you add a [.gitlab-ci.yml](https://docs.gitlab.com/ee/ci/yaml/README.html) file to the root directory of your repository and configure your GitLab project to use a [GitLab Runner](https://docs.gitlab.com/runner/).
The benefits of Continuous Integration (CI), Continuous Delivery and -Deployment (CDs) are huge when automation plays an integral part of your workflow.
Each Git commit or push can trigger a CI/CDs pipeline, if you add a [.gitlab-ci.yml](https://docs.gitlab.com/ee/ci/yaml/README.html) file to the root directory of your repository and configure your GitLab project to use a [GitLab Runner](https://docs.gitlab.com/runner/).
This wiki page is about GitLab CI/CD on the concrete example of this project showing all scripts and details you need, but requires a reasonable understanding of version control with [Git](https://git-scm.com/doc).
This wiki page is about GitLab CI/CDs on the concrete example of this project showing all scripts and details you need, but requires a reasonable understanding of version control with [Git](https://git-scm.com/doc).
|**Note:** This wiki is **not** intended to be a general discussion on GitLab CI/CD, **but** explains the use of GitLLab CI/CD on a concrete example, which is this project.|
|**Note:** This wiki is **not** intended to be a general discussion on GitLab CI/CDs, **but** explains the use of GitLab CI/CDs on a concrete example, which is this toy project.|
|:---------------------------------------------------------------------------:|
If you are looking for general documentation on GitLab CI/CD it is recommended to start with the following:
* [GitLab Continuous Integration (GitLab CI/CD)](https://docs.gitlab.com/ee/ci/)
* [GitLab Continuous Integration (GitLab CI/CD) > Getting started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/README.html)
* [Demo: CI/CD with GitLab in action](https://about.gitlab.com/2017/03/13/ci-cd-demo/)
If you are looking for general documentation on GitLab CI/CDs it is recommended to start with the following:
* [GitLab Continuous Integration (GitLab CI/CDs)](https://docs.gitlab.com/ee/ci/)
* [GitLab Continuous Integration (GitLab CI/CDs) > Getting started with GitLab CI/CDs](https://docs.gitlab.com/ee/ci/quick_start/README.html)
* [Demo: CI/CDs with GitLab in action](https://about.gitlab.com/2017/03/13/ci-cd-demo/)
* ....
Anyway, we will introduce a few keywords and concepts in the beginning, which are required to understand the intention of the scripts and settings of our example.
......@@ -29,7 +29,7 @@ That way you can prevent bugs not only in your software, but in the deployment p
The process from code development to shipping the software can be defined in a workflow with the major parts of
* **Continuous Integration (CI) pipeline**
* **Continuous Delivery (CD) pipeline**.
* **Continuous Delivery and -Deloyment (CDs) pipeline**.
How to use Git to accomplish this work in a consistent and productive manner can be described by a [Git Workflow](https://www.atlassian.com/git/tutorials/comparing-workflows). It encourage users to leverage Git effectively and consistently.
......@@ -76,10 +76,10 @@ Actually, you do not want to think about it at all and get these checks done ful
## GitLab Runner
[GitLab Runners](https://docs.gitlab.com/runner/) are used to run all your checks and even more. It will do what you tell it to do in the [projects .gitlab-ci.yml](https://gitlab.version.fz-juelich.de/vis/jusense-cicd/blob/master/.gitlab-ci.yml) file.
A GitLab runner is a program, which runs on a certain machine waiting for a CI/CD Pipeline to execute. A project can connect to multiple GitLab Runners on different machines to run the CI/CD Pipeline. It only has to know the runner´s URL and its token to connect and authorize.
A GitLab runner is a program, which runs on a certain machine waiting for a CI/CDs Pipeline to execute. A project can connect to multiple GitLab Runners on different machines to run the CI/CDs Pipeline. It only has to know the runner´s URL and its token to connect and authorize.
You can also setup a Docker image, which is started by your GitLab Runner for each run of your CI/CD Pipeline.
In this project we make use of this Docker support inside the GitLab Runner. This way we ensure to have an always working environment to run the CI/CD Pipeline of the project with all the needed tools installed.
You can also setup a Docker image, which is started by your GitLab Runner for each run of your CI/CDs Pipeline.
In this project we make use of this Docker support inside the GitLab Runner. This way we ensure to have an always working environment to run the CI/CDs Pipeline of the project with all the needed tools installed.
| **Note:** Check the Dockerfile of this project [HERE](https://gitlab.version.fz-juelich.de/vis/jusense-cicd/blob/master/ci/env-testing/ci_docker_centos7/Dockerfile).
|:---------------------------------------------------------------------------:|
......@@ -249,9 +249,9 @@ In this project the [CI Job "deploy-doc"](https://gitlab.version.fz-juelich.de/v
![GitLab_PagesDoxygen](/uploads/822eb75094d06d7fbb5797b1e53352d9/GitLab_PagesDoxygen.png)
# Continuous Delivery (CD) Pipeline
# Continuous Delivery and -Deloyment (CDs) Pipeline
| **Note:** GitLab's Continuous Delivery (CD) Pipeline can do any automatic deployment for you defined in [.gitlab-ci.yml.](https://docs.gitlab.com/ee/ci/yaml/README.html).
| **Note:** GitLab's Continuous Delivery and -Deloyment (CDs) Pipeline can do any automatic delivery and deployment for you defined in [.gitlab-ci.yml.](https://docs.gitlab.com/ee/ci/yaml/README.html).
|:---------------------------------------------------------------------------:|
During the development of software, there can be many stages until it's ready for public consumption. You sure want to first test your code and then deploy it in a testing or staging environment before you release it to the public. That way you can prevent bugs not only in your software, but in the deployment process as well.
......@@ -262,7 +262,7 @@ currently being deployed or has been deployed on your servers.
## GitLab Environments
With [GitLab Environments](https://gitlab.version.fz-juelich.de/help/ci/environments), you can control the Continuous Deployment of your software all within GitLab. All you need to do is define them in your project's
[`.gitlab-ci.yml`](yaml/README.md) as we will explore below. GitLab provides a full history of your deployments per every environment.
[.gitlab-ci.yml](https://docs.gitlab.com/ee/ci/yaml/README.html) as we will explore below. GitLab provides a full history of your deployments per every environment.
[GitLab Environments](https://gitlab.version.fz-juelich.de/help/ci/environments) are like tags for your CI jobs, describing where code gets deployed. Deployments are created when [jobs](yaml/README.md#jobs) deploy versions of code to environments, so every environment can have one or more deployments. GitLab keeps track of your deployments, so you always know what is currently being deployed on your servers. If you have a deployment service such as [Kubernetes](../user/project/clusters/index.md) enabled for your project, you can use it to assist with your deployments, and can even access a [web terminal](#web-terminals) for your environment from within GitLab!, you can control the Continuous Deployment of your software all within GitLab. All you need to do is define them in your project's [`.gitlab-ci.yml`](yaml/README.md) as we will explore below. GitLab provides a full history of your deployments per every environment.
......
......