Specification and translation files for forgebuild
Go to file
southerntofu c8f5471ccd Add translation string for info log 2020-11-29 15:57:04 +01:00
i18n Add translation string for info log 2020-11-29 15:57:04 +01:00
tests Change setting 2020-11-28 20:30:36 +01:00
.gitignore Initial commit 2020-07-11 11:46:10 -04:00
LICENSE Initial commit 2020-07-11 11:46:10 -04:00
README.md Update frontmatter 2020-09-30 10:14:25 -04:00
spec.md Draft specification 2020-09-23 15:30:51 +02:00
test.sh tests can now be run on any script (not just forgebuild in $PATH) 2020-09-15 22:47:03 +02:00

README.md

+++ extra.pipeline = "forgebuild" template = "project.html" +++

forgebuild

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 (Rust) or forge/build.sh (bash) instead.

Specification

forgebuild is based on a specification which can be found in the 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.

Tests

This project contains the tests for validating your forgebuild implementation. These tests are written with the bats testing framework, which runs anywhere bash does.

To run the tests, you can either use test.sh or run bats on the tests folder directly, like so:

$ # Requirements on Debian-based systems:
$ # sudo apt install bats git
$ 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

Note: git and hg need to be configured in order to commit (require authorship). TODO: automate this, maybe?

Tests TODO

  • basic function tests
  • configurable forgebuild path, so we can test different implementations
  • task settings (global/per-host settings)
  • multiple source backends (DVCS)
  • short/long flags for CLI
  • PGP signatures