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 :ref:`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: .. code-block:: Foo: bar In this example **Foo** represents the `Key` and **bar** the `value`. - Take a look to this `site `_ where YAML is explained. - Do the first `exercises `_ about YAML. 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: .. code-block:: stages: - test - int - prod