Crates.io | thingy |
lib.rs | thingy |
version | 0.2.0 |
source | src |
created_at | 2020-12-21 14:27:53.634957 |
updated_at | 2021-02-25 17:05:34.172012 |
description | Lightweight build server and thing-doer |
homepage | https://github.com/n-k/thingy |
repository | https://github.com/n-k/thingy |
max_upload_size | |
id | 325273 |
size | 121,033 |
Lightweight build server and thing-doer
cargo install --force thingy
Run: thingy path/to/workspace/folder
, then go to http://localhost:8080/
Thingy has few configuration options, which are provided as optional environment variables:
Environment Variable | Default value | |
---|---|---|
LISTEN_ADDRESS |
127.0.0.1 |
Address to bind web server to |
LISTEN_PORT |
8080 |
Port web server listens on |
Thingy works inside a 'workspace' folder. A thingy workspace is a plain folder with a thingy.yaml
file in it. This file's structure is based on this struct. This file lists build jobs and configurations. If this file does not exist, an empty config with no jobs will be created. Jobs can then be added from web UI.
An example of a workspace file:
jobs:
- name: "test" # names must be unique within workspace
repo_url: "git@github.com:n-k/thingy.git"
build_script: "build.sh" # should be an executable file present in the repository, see build.sh in this repository for example
poll_interval_seconds: 300 # optional
auth: # optional
PrivateKey:
path: "/path/to/your/ssh/private/key"
passphrase: "optional - if key has passphrase"
- name: "test2"
repo_url: "../../some/path/to/repo.git"
build_script: "build.sh"
auth: # optional
UserPass:
username: "username"
password: "password"
In this example, it is assumed that the repository contains an executable file build.sh
. When a new commit is being built, thingy will pull the code, and run build.sh
in the checkout directory with a few special envronment variables. See next section for list of additional environment variables.
BRANCH
: name of branch being builtCOMMIT_HASH
: current commit hash being built
Any environment variables passed to the thingy executable are also passed to the buld processes.I only have Git repositories.
Thingy works on top of Actix actors, and a REST API made with Actix-web. Each component in thingy is an actor.
Actors in thingy form a tree, with one root. The organization looks like this:
workspace_directory/
thingy.yaml (job definitions)
job_1/ (directory name is same as job name)
branch_1/
data.json (saved state for this branch, contains past/ongoing builds, last seen commit hash)
build_num.txt (number of latest build to have been started, keeps increasing by 1)
1/
repo/ (directory where this build cloned the repository)
... files from repo ...
log.txt (build logs, both stdout and stderr are captured, and prefixed by [out] or [err])