Me trying to understand Continuous Integration

I do not really know what pipeline is, so in this post I will journalize my trying to understand Continues Integration, pipelines, and GitLab runners.

March 3, 12:38 AM:

Pipeline: From what I have read in GitLab docs and about pages, pipeline is about something that runs every time you commit something. It is a group of jobs that get executed in stages. In GitLab-CI, we define the jobs in a file .gitlab-ci.yml. Currently, I still don’t really understand what they mean by stages. (I know that it is about development or deploying stages, e.g. develop, staging, production; but still, they are still too vague for me)

Pipeline status and coverage report (and badges) are available in the gitlab pipeline setting page. So it means that code coverage calculation is executed in the pipeline. Hmmmm...

JobExample of a job defined in .gitlab-ci.yml:

job_name:
  script:
    - rake spec
    - coverage
  stage: test
  only:
    - master
  except:
    - develop
  tags:
    - ruby
    - postgres
  allow_failure: true

script is the shell script that is executed (by Runner, don’t worry I’ll talk about this guy later). allow_failure is self-explanatory, if enabled and the job failed, the pipeline will still be successful/green, but “CI build passed with warnings” message will be displayed.

Runner

In GitLab CI, Runner is an isolated (virtual) machine that executes jobs. There are two types of Runners, Specific Runners which only runs for a specified project, and Shared Runners that runs for multiple projects.

For this project, it is an absolute fact that we will use Shared Runner because it is provided for free by GitLab in partnership with DigitalOcean. If you decided to use specific runner (for whatever purpose it is), you will need to install your own Runner in your own VPS (usually by using docker).

You can only register a shared Runner if you are an admin on the linked GitLab instance. — GitLab docs

Because all members in our team’s roles are only as developer (not admin), we are not able to register them. Oh Please…

What’s more? Because we decided to use codecov to enable easy analysis on code coverage reports, we need to set an environment variable to the Runner (Upload token). We need to access the runner setting page in gitlab.

References:

https://docs.gitlab.com/ee/ci/pipelines.html

https://docs.gitlab.com/ee/ci/yaml/README.html

https://docs.gitlab.com/ee/ci/runners/README.html

Advertisements

2 thoughts on “Me trying to understand Continuous Integration

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s