CircleCi

Orbs

Define the environment in which a job will run on, allowing you to reuse a single executor definition across multiple jobs.

An executor definition has the following keys available (some of which are also available when using the job declaration):

  • docker, machine, windows, or macos

  • environment

  • working_directory

  • shell

  • resource_class

Once you declare a definition of executor => you can use them in jobs in scope of declaration.

NOTE. Docker alpine tags: it’s a smaller version with the necessary minimum

version: 2.1
executors:
  my-executor:
    docker:
      - image: circleci/ruby:2.4.0

jobs:
  my-job:
    executor: my-executor
    steps:
      - run: echo outside the executor
  second-job:
    executor:
      name: my-executor
    steps:
      - run: echo outside the executor

It is possible to specify multiple images for your job. Specify multiple images if, for example, you need to use a database for your tests or for some other required service. In a multi-image configuration job, all steps are executed in the container created by the first image listed. All containers run in a common network and every exposed port will be available on localhost from a primary containerarrow-up-right.

Commands

A command defines a sequence of steps to be executed in a job, enabling you to reuse a single command definitionarrow-up-right across multiple jobs.

Jobs

With jobsarrow-up-right, we can automate common behaviour using our commands described previously and they will be used in the workflowsarrow-up-right section of the CircleCI configuration.

Last updated

Was this helpful?