Creating a Gitlab Pipeline

Jorge Junior
Jorge Junior
Published in
2 min readAug 26, 2019

Hey folks, all right? Today I am going to write quickly about something really cool that I am currently studying, how we can improve and use tools to assist in our deployment process.

Gitlab has very nice and easy to configure CI / CD tools. The idea here is to share a little bit about the first step: automated testing. I created a simple environment with ruby, rspec and two files: one class and one file for testing this class.

Setting up our CI / CD in gitlab

Now let’s get down to business, create our first stage, testing. For this, we must first create our repository in gitlab, with the same standard procedures (create the repository, add our origin and etc).

With it created, we can then go to the directory page in the side menu:

By accessing this page, we will go to the gitlab CI / CD Welcome Page https://docs.gitlab.com/ee/ci/quick_start/

What we need to do is create a file called .gitlab-ci.yml, which is responsible for performing the actions during our deploy, which in our case will only be the execution of the tests:

This is enough. As soon as we make a modification and git push to the repository, we will have our pipeline up and running (Pipeline access is from the same side menu).

Well guys, that’s it for today! The repository can be found at:
https://gitlab.com/jorgedjr21/gitlab-pipeline

--

--