Skip to content
Hariharan edited this page Dec 11, 2023 · 5 revisions

Introduction

Dot is a minimal CI system that is local first. It uses docker to run jobs defined in dot.yml file.

The dot.yml file mainly has 2 sections:

  1. stages
  2. jobs

Stages contain jobs. Each stage can have multiple jobs and each job must have one stage. Jobs defined in a stage run concurrently. Stages are executed in-order, as specified in the stages array.

stages:
  - test
  - security
  - build

Jobs define the actual process. A job is the basic unit of dot.

jobs:
  - name: Run checks
    stage: security
    image: "docker.io/golangci/golangci-lint:latest"
    variables:
      - TEST: true
    script:
      - golangci-lint run ./...
    condition: TEST

A job definition can contain:

  • stage: Stage that the job belongs to. This stage should be defined under stages.
  • script: An array of commands to execute. These are executed using sh in the docker container.
  • entrypoint: Optionally, an entrypoint can be specified to override the default entrypoint in a docker image.
  • image: Docker image that will be used to run the scripts.
  • variables: An array of key-value pairs. These variables are available inside script and condition.
  • condition: Dot uses expr to evaluate conditions. The job is executed only if the condition evaluates to true.

Quick Start

Dot can be installed by downloading the latest binary from the releases section and adding it to your $PATH.

export PATH=$PATH:/path/to/dot
dot version

Create a dot.yml file inside a folder.

stages:
  - hello

jobs:
  - name: Say Hello
    stage: hello
    image: "docker.io/debian:stable"
    variables:
      - WORLD: world!
    script:
      - echo Hello $WORLD

Run dot in the same folder. Dot will download the image if it doesn't exist locally and the Say Hello job will print Hello world!.

Say Hello | {"status":"Pulling from library/debian","id":"stable"}
Say Hello | {"status":"Digest: sha256:ed69ce2733ba8a846f87106c07faadfa0506ff5020cce9489f753ee2cddaa3f7"}
{"status":"Status: Image is up to date for debian:stable"}
Say Hello | Hello world!

Dot can also be run using docker. There is a docker image available.

docker run -it -v /var/run/docker.sock:/var/run/docker.sock -v /path/to/project:/app ghcr.io/opnlabs/dot:latest

Here it is important to mount the local docker socket so that dot has access to the host's docker daemon.

Clone this wiki locally