CircleCI

tl;dr

Use a machine executor with an image that has a recent version of Docker.

CircleCI's recent machine executor images include everything batect requires, so all that needs to be done to use batect with CircleCI is to configure it to use one of those images.

A list of available images is published in the CircleCI documentation here. batect requires an image with a compatible version of Docker - currently version 18.03.1 or newer.

Adding the following to your .circleci/config.yml file instructs CircleCI to use a machine executor with the 201808-01 image, which contains Docker 18.06:

version: 2

jobs:
  build:
    machine:
      enabled: true
      image: circleci/classic:201808-01
    steps:
      - checkout
      - run: ./batect ...

You can see a full example of using batect with CircleCI in the Golang sample project.

Simplifying configuration with CircleCI

CircleCI supports defining reusable commands within your configuration file. This can be useful if you find yourself running the same series of commands over and over again. For example, if you have a series of jobs, each of which checks out your code, restores the cache, runs a batect task and then saves the cache, you can define a command that contains all of these steps:

commands:
  batect:
    description: "Run a task in batect"
    parameters:
      task:
        type: string
    steps:
      - checkout
      - restore_cache:
          key: myproject-{{ checksum "yarn.lock" }}
      - run:
          command: ./batect << parameters.task >>
      - save_cache:
          key: myproject-{{ checksum "yarn.lock" }}
          paths:
            - node_modules/

...and then reuse it in each job:

  build:
    machine: true
    image: circleci/classic:201808-01
    steps:
      - batect:
          task: build

  test:
    machine: true
    image: circleci/classic:201808-01
    steps:
      - batect:
          task: test