9. CI/CD pipelinesΒΆ
DevOpsΒΆ
DevOps is a technical project method to connect software development and customers but β¦ what is DevOps?
Research these questions about DevOps:
When was DevOps invented?
Why was DevOps developed?
What professions were brought closer by DevOps
CI/CDΒΆ
Please read and understand the following questions:
What does CI stand for?
What does CD stand for?
What is the difference between Continuous Delivery?
What is the difference between Continuous Deployment?
Important
Take 30 minutes to research and answer the questions, then discuss them with your coach.
CI/CD lifecycleΒΆ
Research the phases of a CI/CD and draw a CI/CD lifecycle.
Important
Make sure you understand every phases, then discuss them with your coach.
GitLab CIΒΆ
Our deployments are automated with the Gitlab CI. Have a look at our docs were we explain the usage and GitLab CI Guidelines. Make yourself familiar with the Guidelines.
Important
Read through the guidelines, then discuss them with your coach.
Concpet of CI/CDΒΆ
These are the most important components of Gitlab CI/CD.
Pipelines |
Structure of the CI/CD process through pipelines. |
CI/CD variables |
Reusable variable/key-value pairs. |
Environments |
Staging, Test, Prod used to deploy applications. |
Job Artifacts |
Output, reuse Artifacts in/outside of git. |
Gitlab Runners |
Runners that execute Scripts. |
Here are the CI/CD concepts explained in detail.
YAMLΒΆ
YAML is the markup language used by Gitlab to interpret the commands in you CI/CD configuration file.
Yaml focuses on Key-Value pairs. The most important aspect about Yaml is the distinction between keyword and value. Usualy formated via a colon:
Foo: bar
In this example Foo represents the Key and bar the value.
Your first pipelineΒΆ
Now that you have the knowledge about git and CI/CD weβll create our first pipeline:
Create a repository under the trainee group (Name doesnβt matter).
Pull that repo to your local machine.
Create a file called .gitlab-ci.yml.
Create a Key/Value list with the keyword Stages.
Create a simple job with an echo command.
As the Values for your Key-Value pair you can set any name. Use a name that includes the usage of the stage (i. e. Use test as a name for a stage, if you create multiple jobs that test your code.). Your current Stage block should be similar to this:
stages:
- test
- int
- prod