v2 Configuration
- Format
- .baur.toml Repository Configuration File
- .app.toml Application Configuration File
- Include References
- Include Configuration File
- Templating in Configuration Files
baur configuration files are in TOML format. General information about the syntax can be found at: https://toml.io.
Include references are used in include
fields.
The format is: FILEPATH#INCLUDE_ID
.
FILEPATH
must be relative to the repository root.
INCLUDE_ID
is an identifier that is specified in the include section
A .baur.toml
file can be generated by running:
baur init repo
All values in the commented config are examples and not the default values.
-
config_version
An internal field, describes the format of the baur configuration files. It is increased on non-backwards compatible changes.
-
postgresql_url
URL to a PostgreSQL database in that information about past task runs are stored.
It is overwritten by the environment variableBAUR_POSTGRESQL_URL
.
-
application_dirs
Directories in which.app.toml
application configuration files are discovered. These must be sub-directories of the directory that contains the.baur.toml
file. -
search_depth
Descendsearch_depth
levels of directories below anapplication_dirs
path.
A .app.toml
file can be generated by running:
baur init app
All values in the commented config are examples and not the default values.
-
name
Name of the Application
Required -
includes
A list of task include references. The Task defined in the include are added added to the application definition. \
-
name
Name of the Task
Required -
command
The command that is executed when the task runs. The first element in the list is the binary to execute. The following ones are arguments. If the first element contains no path separators, it's path is looked up via the$PATH
environment variable.
The command is run in the application directory.
Required
Default:[]
-
includes
A list of include references for Input or Output include sections.
Default:[]
Defines the Inputs that are tracked for the task.
Tasks are run if no recorded run exist with the same Inputs.
A task must define at least 1 Input.
-
paths
List of glob file path patterns to match files that are tracked.
All paths are relative to the repository root.
Pattern are in Golang's Glob syntax https://golang.org/pkg/path/filepath/#Match. Additionally the pattern**
is supported. It matches files recursively.
Default:[]
-
optional
Don't fail if a pattern resolves to 0 files.
Default:false
-
git_tracked_only
Only match files that are part of the Git repository.
Default:false
Resolves Golang packages to source files. Imported packages are recursively
resolved to files.
Go source files from the standard library are ignored.
-
queries
List of queries. The pattern can be either repository relative file paths or query patterns that are forwarded to the go packages driver tool (go list
in most cases). The query syntax described at https://github.com/golang/tools/blob/bc8aaaa29e0665201b38fa5cb5d47826788fa249/go/packages/doc.go#L17 is supported.
Default:[]
-
environment
Environment variables that are set when running the go package driver tool.
The tool runs in a clean environment, only the following variables are inherited from the current environment: \PATH
GOCACHE
XDG_CACHE_HOME
HOME
home
LocalAppData
-
USERPROFILE
Default:[]
-
build_flags
List of command-line flags passed through to the go package driver tool.
Default:[]
-
tests
Include go test files in the results.
Default:false
Defines artifacts that are produced by the task and where they should be uploaded to. Output definitions are optional.
-
idfile
Path of a file, relative to the application directory, containing the docker image ID of the image that is created
(docker build --iidfile
).
Required
Defines where the image is uploaded to.
-
registry
Docker registry address. If it's empty the docker agent's default registry address is used. \ -
repository
Image Repository
Required -
tag
Tat that is applied to the image.
Required
-
path
Application directory relative path.
Required
-
bucket
S3 bucket name
Required -
key
Object key
Required
-
path
Absolute path the file is copied to.
Required
The fields in the include files have the same meaning then their equivalent in the application config file.
A .baur.toml
file can be generated by running:
baur init include
All values in the commented config are examples and not the default values.
Input section that can be included in a Task.
-
include_id
Identifier of the include
Output section that can be included in a Task.
-
include_id
Identifier of the include
Task section that can be included in an application config file.
-
include_id
Identifier of the include
baur configuration files have limited support for templating.
Templating syntax can be used only in the values of configuration fields.
The Templating engine is based on Go
Templates, everything that is supported
by it can be used.
Additionally the following is supported:
-
{{ .Root }}
Is replaced with path to the repository root directory. -
{{ .AppName }}
Is replaced with the name of the application.
-
{{ gitCommit }}
Arguments: none
Returns the Git commit ID of theHEAD
reference in the bau repository. -
{{ env }}
Arguments: string, environment variable name
Returns the value of an environment variable. If the variable is not defined baur will fail.
Example: Get the value of the environment variable$TERM
:{{ env "TERM" }}
-
{{ uuid }}
Arguments: none
Generates and returns a UUID.