- Go 95.7%
- Dockerfile 4.3%
|
All checks were successful
Build and Push Image / build-and-push (push) Successful in 30s
|
||
|---|---|---|
| .forgejo/workflows | ||
| internal | ||
| license | ||
| resources | ||
| testdata | ||
| .gitignore | ||
| Dockerfile | ||
| go.mod | ||
| go.sum | ||
| imports.go | ||
| main.go | ||
| README.md | ||
Background Radiation
Background Radiation, or BakRad, or br is a bespoke build system for static sites. I use it to automate deployment of the various static sites I run with Caddy.
Given a git-compatible URL for a site repository, the tool will clone or pull the latest commit and process files. Processing files is simply a matter of copying desired files to a pre-defined production directory. By default only files matching the following patterns are processed:
static/**/*templates/**/**.html
A site may wish to deploy a number of different files to production, this is possible with the inclusion of a .bakrad_include file at the root of the repository. The handling of the file is naive, if a line starts with a # it is treated as a comment. Otherwise, a line is assumed to be a glob pattern & will be used to match files in the cloned repository directory.
Dependencies
bakrad has two major dependencies, sass and tsc. They need to be installed and in the tool's $PATH to work. This document does not go into detail on installing them, but it does provide a Docker image with each tool installed already. Please see the following:
$ # use the paths you define in your config file for host-side mounts
$ docker run \
--rm \
-v /etc/bakrad:/etc/bakrad \
-v /srv/www:/srv/www \
-v /var/lib/bakrad:/var/lib/bakrad \
bakrad
Config
bakrad uses TOML for its configuration. By default, it will attempt to load /etc/bakrad/config.toml. This behavior can be changed using a flag described below. The following is an example configuration file:
data_root = "/var/lib/bakrad" # path to where bakrad should store data
production_root = "/srv/www" # path to where production sites live
[[sites]] # an array of sites
name = "beer4kids.blog"
git_url = "https://slapshit.net/max/beer4kids.blog"
Docker
License
bakrad uses code sourced from the Go standard library. Please see the license.
Otherwise, code is licensed under the MIT license.