dot

command module
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2024 License: MIT Imports: 1 Imported by: 0

README

Dot

Go Reference Dot Go Report Card Codacy Badge

A minimal CI. Designed to be local first.

All the jobs run inside docker containers. Dot communicates with the Docker daemon using the Docker client API.

Refer the project wiki to learn more about dot.

Features

  • Single binary, can run anywhere, on your machine or CI/CD systems
  • Multi stage builds with support for build artifacts
  • Simple yaml job definition
  • Bring your own Docker images. Supports private registries
  • Uses plain Docker

Installation

Get the latest version from the releases section.

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

Example

This example uses GoReleaser to build this project.

stages:
  - test
  - security
  - build

jobs:
  - name: Run tests
    stage: test
    image: "docker.io/golang:1.21.3"
    variables:
      - TEST: true
    script:
      - go test ./...
    condition: TEST

  - name: Run checks
    stage: security
    image: "docker.io/golangci/golangci-lint:latest"
    script:
      - golangci-lint run ./...

  - name: Build using Goreleaser
    stage: build
    image: "docker.io/golang:1.21.3-bookworm"
    script:
      - git config --global safe.directory '*'
      - curl -sfL https://goreleaser.com/static/run | bash -s -- build --snapshot
    artifacts:
      - dist

Extract the binary once the build is complete.

tar xvf .artifacts/artifacts-*.tar
dist/dot_linux_amd64_v1/dot version
Build Dot with Dot

This project can be built with Dot. The dot.yml file describes all the jobs necessary to build a linux binary. Clone the repo and run

go run main.go -m

This should create an artifact tar file in the .artifacts directory with the linux binary dot. The -m flag gives dot access to the host's docker socket. This is required only if containers are created within dot.

Documentation

Overview

Dot is a local first CI system.

Dot uses Docker to run jobs concurrently in stages. More info can be found at https://github.com/opnlabs/dot/wiki

Directories

Path Synopsis
cmd
dot
pkg
runner
Package runner implements the backend that executes the jobs.
Package runner implements the backend that executes the jobs.
store
Package store implements a simple key-value store.
Package store implements a simple key-value store.
utils
Package utils provides some utility functions to compress and decompress tar and tar.gz.
Package utils provides some utility functions to compress and decompress tar and tar.gz.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL