build/README.md

65 lines
2.5 KiB
Markdown
Raw Normal View History

2020-09-23 16:07:38 +00:00
+++
2020-09-30 14:14:25 +00:00
extra.pipeline = "forgebuild"
template = "project.html"
2020-09-23 16:07:38 +00:00
+++
2020-09-15 20:07:49 +00:00
# forgebuild
2020-07-11 15:46:10 +00:00
2020-09-15 20:07:49 +00:00
This repository contains the specification, translation strings, and tests for forgebuild, a system to check for updates on remote repositories and trigger some tasks accordingly.
If you are looking for a program you may use as an end user, check out [forge/build.rs](https://tildegit.org/forge/build.rs) (Rust) or [forge/build.sh](https://tildegit.org/forge/build.sh) (bash) instead.
## Specification
forgebuild is based on a specification which can be found in the [spec.md](spec.md) document. This document is versioned, and all forgebuild implementations should use it as a reference.
## Translations
This repository also contains translation files for the various forgebuild implementations. The reference translations are located in the `i18n/` folder, stored as JSON files using 2-letter codes for the language name, such as `en.json`.
In the future, some scripts may be added to convert those JSON files to different formats such as [GNU gettext](https://www.gnu.org/software/gettext/).
## Tests
This project contains the tests for validating your forgebuild implementation. These tests are written with the [bats](https://github.com/bats-core/bats-core/) testing framework, which runs anywhere bash does.
2020-09-15 20:07:49 +00:00
To run the tests, you can either use `test.sh` or run bats on the tests folder directly, like so:
2020-09-15 20:07:49 +00:00
```
$ # Requirements on Debian-based systems:
$ # sudo apt install bats git
2020-09-15 20:07:49 +00:00
$ git clone https://tildegit.org/forge/build
$ bats build/tests
✓ repository is cloned
✓ first run triggers task
✓ no update does not trigger task
✓ forced run triggers task
✓ update triggers task
✓ host-based settings are loaded
✓ unknown host uses default settings
✓ submodule is cloned
✓ first submodule run triggers task
✓ submodule update does not trigger task by default
10 tests, 0 failures
```
If you want to test an implementation of forgebuild that is not `forgebuild` in the $PATH, you can either pass its path as first argument to test.sh, or feed bats with that path in the `FORGEBUILD` environment variable:
```
$ test.sh /tmp/forgebuild.rb
$ # Is the same as
$ FORGEBUILD=/tmp/forgebuild.rb bats tests
```
2020-09-23 13:30:51 +00:00
Note: git and hg need to be configured in order to commit (require authorship). TODO: automate this, maybe?
# Tests TODO
2020-09-15 20:07:49 +00:00
- [x] basic function tests
- [x] configurable forgebuild path, so we can test different implementations
2020-09-15 20:07:49 +00:00
- [x] task settings (global/per-host settings)
2020-09-23 13:30:51 +00:00
- [x] multiple source backends (DVCS)
- [x] short/long flags for CLI
2020-09-15 20:07:49 +00:00
- [ ] PGP signatures