Basic Concepts of CircleCI: Part 2
In this post we shall cover the following CircleCI concepts.
- orbs,
- caches,
- context,
- workspaces,
- artifacts.
Orbs
An orb is a library containing jobs and commands that can be reused. There are different types of orbs - public and private. The public orbs can be open source. They can be checked out at https://circleci.com/developer/orbs. They can be referenced under the orbs section in the CircleCI config file.
Caches
Files that need to be reused in the following jobs could be cached. To save files, we could `save_cache`. We could restore the cache in future jobs.
Contexts
Contexts are the scope within which the jobs will be allowed to execute jobs. It is a way of sharing environment variables across different projects. Using contexts allows to provide permissions to workflows by defining credentials in the context with which the workflow jobs may be able to access resources. One can define key - value pairs in contexts. These key - value pairs get injected during runtime of the workflow. These variables can also be used in the CircleCI config file or in jobs.
To define which context will be used by a job, the context
keyword can be used. It is possible to make the context available to only certain teams. You can do this by adding or removing Security Groups. Security Groups are essentially Github teams.