DEV Community

coktopus
coktopus

Posted on • Updated on

How circleCI fits into the setup | step 3

CircleCI is a tool to handle the continuous integration and continuous development.

Basically, Continuous Integration means multiple developers pushing small, frequent changes to a shared repository or ‘master’. They are integrating changes continuously, rather than periodically.

Because the CD is a periodic process and CI is not the CD is getting handled separately.

How does CircleCI helps?

CIrcleCI provides simple integration to code repositories like github and bitbucket

It automatically run the circleCI pipeline when triggered by merges.

Notification of everything happening on the attached circleCI's

Build all jobs within one circle.yml file.

No need to manage server as every job will be started on new environment.

Web UI is truly interactive and improving frequently

To attach repositories

Alt Text

Thanks to role set access control based on SSH key, because It is important when working as an organization.

Alt Text

circle.yml explained

Alt Text

Add a folder '.cirlceci', create 'config.yml', and push it to the repository to active the triggers of repository attached to circleCI

Points to understand

  • workflow (lines 30-37) - runs the jobs in a sequence
  • jobs (lines 5-28) - The jobs level contains a collection of arbitrarily named children. build is the first named child in the jobs
  • filter (lines 35-37) - pipeline only triggers when a request is merged in the listed branch
  • build (lines 6-16) - Boilerplate kind of jobs
  • steps (lines 20-28) - actual commands run in a sequence as it is declared
  • orbs - explained below

Importance of orbs

Orbs is reusable package of YAML configuration that contains repeated pieces of config into a single line of code. CircleCI orbs are open-source, shareable packages of reusable configuration elements, including jobs, commands, and executors.

orbs save a lot of extra efforts and time. The Orb Registry is an open repository of all published orbs

In config.yml from line 12-21 all the steps are the command of the orbs.

node, gcp-gcr, gcp-gke, helm are the orbs which are getting used in the setup.

gcp-gcr . An orb for working with Google Container Registry . gcr/gcr-auth is authentication to google container registry and it fetch the credentials from circleCI environment variable. Environment variable will not get exposed throughout, the execution of pipeline which indicate that sensitive data can be store inside.

Environment Variables

Alt Text

The target of this part of setup is to store all the unique tags of images in google container registry with the help of CIRCLE_SHA1 which is unique commit id and those tags were further use to update the deployment.

video link is there for the whole implementation

Top comments (0)