baur

module
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: GPL-2.0

README

baur CircleCI Go Report Card

About

baur is an incremental task runner for monolithic repositories.
It can be used in CI environments to build, check and test only applications that changed in a commit.

Practical usage examples of baur can be found in the example repository.

How it works

Per application tasks are defined in a TOML configuration file. Each task specifies:

  • a command to run,
  • which inputs (files) affect the result of the task run,
  • and optionally artifacts that are created by the task and their upload destinations.

When baur runs a task, it calculates a digest for the task inputs and stores it in a PostgreSQL database.
On following runs, baur only runs tasks for which the inputs changed.

Key Features
  • Running Tasks only for Changed Applications
    Tasks define which inputs affect the result of the task execution.
    baur can only runs tasks that have not been run before for the current set of inputs.
    Inputs can be defined as glob file patterns, as strings on the commandline, or as Go package queries.

  • Artifact Upload
    Artifacts can be uploaded to S3 buckets, to Docker registries or simply copied to another directory in the filesystem.

  • Application Management
    baur can be used as management tool in monorepositories to query basic information about applications and upload destinations for specific builds.

  • CI Optimized
    baur is made to be run in CI environments and supports to output information in the easily-parseable CSV format.

  • Configuration File Includes
    Tasks, Inputs and Output definitions that are shared between tasks can be defined in include configuration files.

  • Templating
    Templating can be used in configuration files.

Quickstart

Installation
From a Release

The recommended way is to download the latest released version from the release page.
Official releases are provided for Linux, macOS and Windows.

After downloading the release archive, extract the baur binary (tar xJf baur-OS_ARCH-VERSION.tar.xz) and move it to your preferred location.

From Source

With Go >= 1.16.0 installed you can build and install the latest version from the master branch by running:

go install github.com/simplesurance/baur/v2/...@master
Setup

baur uses a PostgreSQL database to record information about past task runs. The quickest way to setup a PostgreSQL for local testing is with docker:

docker run -p 127.0.0.1:5432:5432 -e POSTGRES_DB=baur -e POSTGRES_HOST_AUTH_METHOD=trust postgres:latest

Afterwards you create your baur repository configuration file. In the root directory of your Git repository run:

baur init repo

The command will print instructions how to initialize your database and create your first application configuration file.

First Steps

To show information about the available commands run:

baur --help

Some commands to start with are:

command action
baur status List task in the repository with their build status
baur run Run all tasks of all applications with pending builds, upload their artifacts and records the result
baur ls runs all List recorded tasks
baur show currency-service Show information about an application called currency-service
baur ls inputs --digests shop.build List inputs with their digests of the build task of an application called shop
baur run --help Show the usage information for the run command.

Upgrading from baur 0.20 to 2.0

See Upgrade Instructions in the wiki

Documentation

Documentation is available in the wiki.

Contributing

We are happy to receive Pull Requests for baur.
If you like to contribute a non-trivial change, it is recommended to outline the idea before in the Ideas forum.

Contact

Directories

Path Synopsis
cmd
internal
exec
Package exec runs external commands
Package exec runs external commands
format
Package format outputs data in formatted table structures
Package format outputs data in formatted table structures
fs
log
testutils/fstest
Package fstest provides test utilties to operate with files and directories
Package fstest provides test utilties to operate with files and directories
testutils/strtest
Package strtest provides test utilties to operate with strings
Package strtest provides test utilties to operate with strings
vcs
pkg
baur
Package baur implements an incremental task runner.
Package baur implements an incremental task runner.
cfg
Package cfg implements the baur configuration file parser.
Package cfg implements the baur configuration file parser.
cfg/resolver
Package resolver provides templating for baur configuration files.
Package resolver provides templating for baur configuration files.
cfg/upgrade/v4
Package v4 provides helpers to convert baur configs in v4 format (baur 0.20) to v5 (baur 2.0)
Package v4 provides helpers to convert baur configs in v4 format (baur 0.20) to v5 (baur 2.0)
storage
Package storage provides an interface for baur data storage implementations.
Package storage provides an interface for baur data storage implementations.
storage/postgres
Package postgres is a baur-storage implementation storing data in postgresql.
Package postgres is a baur-storage implementation storing data in postgresql.

Jump to

Keyboard shortcuts

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