summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2020-12-14Add more trace logging for database objects createdMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-14Add debug output in release subcommandMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-14Add documentation about other handlebar helpersMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-14Disable logging in handlebarsMatthias Beyer
Because the scripts we run should not be able to access the logger during handlbars rendering. This is due to the fact that we need to have control over stdout/stderr because of the progress bar printing, but also because there's absolutely no need for the user to log during the handlebars rendering process. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-14Add script helpers: join, joinwithMatthias Beyer
This adds two script helpers to join lists of strings. They do not support arrays. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-14Refactor: Move phase module to packageMatthias Beyer
This is the right scope anyways. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-14Merge branch 'doc'Matthias Beyer
2020-12-14Add note about relevanceMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-14Add some more documentationMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-14Remove ContainerError type, thiserror dependencyMatthias Beyer
This removes the ContainerError type for simplicity. We can call anyhow!() and just work with that, no need to pull in thiserror just for one type. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-14Report phase in which a job errored, if it erroredMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-14Example: Add example linterMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-14Fix example: OK state does not have a message parameterMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-14Fix: Remove trailing ":", which is not needed in OK stateMatthias Beyer
I guess it only worked because pom uses some kind of prefix-matching algorithm. It shouldn't have worked this way, IMO. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-11CleanupMatthias Beyer
Sort and make indention nice. Also dev-dependencies where removed because indoc is a normal dependency anyways. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-11Remove unused dependency: tracingMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-11Update configuration exampleMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-11Add missing example valueMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-11Add "tree-of" subcommand to print dependency tree of a packageMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-11Fix: About message of "lint" subcommandMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-11Merge branch 'package-image-allowlist' into masterMatthias Beyer
2020-12-11Fix: Test must pass hashmap of sources to packageMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-11Rename for consistency: deny_images -> denied_imagesMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-11Add allowlist featureMatthias Beyer
This patch adds the "allowlist" feature for packages. A package can have a list of allowed images to be built on - butido will not execute the submit if one package is not allowed on the image passed to butido. This is the opposite of the denylist, of course. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-11Merge branch 'deny-images' into masterMatthias Beyer
2020-12-11Add checks whether any package is denied on the target imageMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-11Add Display impl for ImageNameMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-11Merge branch 'lint-script' into masterMatthias Beyer
2020-12-11Refactor linting implementation to utility functionMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-11Refactor "build" subcommand linting implementation to match "lint" subcommandMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-11Refactor to find linter from repository rootMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-11Add "lint" subcommandMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-11Add feature: script lintingMatthias Beyer
This patch adds script linting via a configurable script. With this patch, the configuration can point to a script or program that gets the packaging script on STDIN and might exit with a nonzero value on error. The simplest script I can think of that adds value is: #!/bin/bash shellcheck - to run the packaging script through shellcheck. stdout and stderr of the linting script are printed in case of non-zero return value. Linting can be disabled by not setting the script in the config or by passing a commandline flag to skip linting (a warning will be printed in this case). Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-10Add more verbose error reportingMatthias Beyer
This patch adds more verbose error reporting in case of build error. It alters the Orchestrator::run() interface to return the Job UUID alongside the error object. The UUID object can then be (and is) used in the "build" subcommand implementation to fetch information about the failed job from the database and print it to the user. The number of log lines is configurable. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-10Fix: Add missing trailing quoteMatthias Beyer
Fixes: 1d038bae2b ("Remove feature: State message in "OK" case.") Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-10Fix: Write job to database, even if it failedMatthias Beyer
This patch fixes an error where a failing (as in {{stage "ERR" "something"}}) job was not written to the database. The implementation and signatore of Endpoint::run_job() had to be altered for that, see code comment. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-10Print errors in build subcommand implementationMatthias Beyer
This changes the Orchestrator interface to return a Vec of errors which happened during the container run, rather than just reporting "something errored". This way, we can use the build subcommand implementation to do the reporting instead of the Orchestrator implementation, which is way cleaner (especially for future features). Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-10Merge branch 'errors' into masterMatthias Beyer
Some changes for better error reporting.
2020-12-10Format the container error message a bit nicer.Matthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-10Remove feature: State message in "OK" case.Matthias Beyer
The "OK" case had a state message parameter. This was removed because "OK" does mean that everything went well. No need to have a message here. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-10Add printing of script error messageMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-10Rewrite container error reportingMatthias Beyer
This patch rewrites the container error reporting to be more simple. The ContainerError type was rewritten to not wrap other errors anymore, but be the root error itself. It only has one variant now, because there's only one kind of error: "It didn't work". The reporting in the calling functions can now use anyhow::Result<_> instead of std::result::Result because of that. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-10Fix: Ignore non-package filesMatthias Beyer
This patch fixes a behaviour where non-package files were not ignored, which resulted in error messages where a directory was tried to parse (which of course is not valid). Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-10Move script formatting to Script type definitionMatthias Beyer
This patch moves the script formatting to the definition of the Script type, where it belongs to. This is not an optimal implementation code-cleanness wise, because we could always improve the interface to be even more typesafe and convenient to use, but I guess this is nice for now. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-09Add more error context in case of CLI parsing errorsMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-09Add some more information in the CLI help outputMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-09Merge branch 'big-example' into masterMatthias Beyer
2020-12-09Add some more trace outputMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-09Add example package repositoryMatthias Beyer
This patch adds an example package repository including a "source repository" where sources for packages are located. The Makefile can be used to setup an testing environment, controlled via environment settings (which are created via shell.nix for example) and spin up a webserver for the sources. Butido can then be used to download and build the sources into packages. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-09Add example environment in shell.nixMatthias Beyer
This environment is default selected. With nix-shell ./shell.nix --argstr example 1 it can be selected explicitely. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>