summaryrefslogtreecommitdiffstats
path: root/src/config
AgeCommit message (Collapse)Author
2021-12-02Merge branch 'optimize-mass-download'HEADmasterMatthias Beyer
2021-12-02Allow spinner_format in config, to be backwards compatibleMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-11-19Update Copyright string to 2020-2022Matthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-06-24Fix package print format defaultMatthias Beyer
Maybe this is necessary because of the handlebars update, I am not entirely sure (because it is actually a not-so-much-used feature). This patch styles the default format string for the output to be more visually pleasing. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net> Tested-by: Matthias Beyer <matthias.beyer@atos.net>
2021-05-11Add doc on default value helper functionsMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-05-11Add doc on config membersMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-05-11Refactor: Database connection setup codeMatthias Beyer
This patch refactors the database connection setup code to involve less copying of data in memory. It also changes the configuration value type of the database port and the database connection timeout setting to be `u16` instead of `String`, which is another improvement. Because the `DbConnectionConfig` type no longer holds owned values, it must be annotated with a lifetime. Usages were adapted. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-04-26Add support for database connection timeoutMatthias Beyer
This patch adds support for a database connection timeout, giving the user the option to configure one, but hardcoding a default timeout to 30 seconds. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-04-13Add configurable timeoutChristoph Prokop
This patch adds a configurable timeout value (default 10 seconds) in the Endpoint struct. This way we get an error if the connection to the endpoint is stalled. Signed-off-by: Christoph Prokop <christoph.prokop@atos.net> Pair-programmed-with: Matthias Beyer <matthias.beyer@atos.net> Suggested-by: Matthias Beyer <matthias.beyer@atos.net> Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-03-11Endpoint configuration as MapMatthias Beyer
This patch rewrites the endpoint configuration format to be a map. The problem here is, that a list of endpoints cannot easily be used with layered configuration, where a part of the configuration lives in the XDG config home of the user and the rest lives in the repository. With this patch, the endpoints are configured with a map instead of an array, which makes it less complicated to overwrite. The name of an endpoint is now the key in the map. A type `EndpointName` was introduced to take advantage of strong typing. Thus, the patch touches a bit more code to adapt to the new type in use. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net> Tested-by: Matthias Beyer <matthias.beyer@atos.net>
2021-03-10Fix: Do not check lint script path in config validationMatthias Beyer
This fix is needed because the config validation does not know whether the config is loaded from ./ or from ../ (or way more up). The script linter path points to a file relative to the project root, which cannot be checked here, but only when constructing the linter command. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-03-04Remove relative speed setting, select endpoint by utilization insteadMatthias Beyer
This patch removes the "speed" setting from the configuration, which was introduced to set a relative speed for each endpoint, with the idea that the scheduler then would select a faster node preferably. Instead, the utilization of an endpoint is now calculated (number of running jobs vs allowed maximum jobs on the endpoint), and the endpoint with lower utilization is selected. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-03-01Add feature to pass git author and git commit information to containerMatthias Beyer
This patch implements the feature to be able to pass author and commit hash information from the repository to the container. This can be used to set packager or package description commit hash inside the build container, if desired. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-02-22Add required "release_stores" configurationMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-02-02Add network-mode setting for endpointsMatthias Beyer
This patch adds the ability to set network mode for an endpoint. This means that all containers on the endpoint are started with, for example, --net=host (if that is desired). Signed-off-by: Matthias Beyer <matthias.beyer@atos.net> Tested-by: Matthias Beyer <matthias.beyer@atos.net>
2021-01-18Run `cargo fmt`Matthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-01-18Add doc on configuration codeMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-01-15Add compatiblity setting in configuration fileMatthias Beyer
This patch adds a compatibility setting in the configuration file, so that butido does not fail late when parsing configuration parameters or package definition files, but early, when the configured compatilibty does not match the version of butido itself. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-01-13Add LICENSE file and license headersMatthias Beyer
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-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-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-09Make ProgressBars helper able to create spinnersMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-08Implement checking of allowed environment variablesMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-08Add helper flag in package_print_format to check whether any other flag was ↵Matthias Beyer
requested Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-08Enhance default package print formatMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-07Implement shebang overwritingMatthias Beyer
This patch implements the shebang overwriting functionality that was in a TODO note. It adds a `Shebang` type for it, which is a String wrapper. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-07Implement proper validationMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-07Fix: Source cache root can be a PathBuf in the configurationMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-07Remove unused importsMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-04Add strict script interpolationMatthias Beyer
This patch adds strict script interpolation, which means that the script interpolation will result in an error if a variable is referenced that does not exist. Before this patch, referencing an absent variable did result in an empty string, possibly resulting in an error at runtime. This feature is on by default. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-03Remove variable interpolation in config fileMatthias Beyer
This was unused anyways, and I am not even sure what we implemented it for. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-03Remove the idea of "system dependencies"Matthias Beyer
Because we want to be able to work on different distros, we cannot have a concept of "system dependencies", because each distro names their packages differently. The concept of installing stuff from a distro image can still be accomplished easily via environment variables. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-03Allow multiple sources per packageMatthias Beyer
This patch implements multiple (unnamed) sources per package. This means that a package can have an array of sources. What was adapted to allow multiple sources per package: * Downloads are made in parallel now * The cache structure was changed to /<package>-<version>/<hash>.source * The UI was changed to contain the full `Package` struct (as JSON object) in a UI format string Tests were adapted. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-03Fix warning: No need to call into_iter() here, iter() is okayMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-26Fix: Rename possible values to lowercaseMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-26Fix: Repo path should be cwd, not configurableMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-14Implement on-disk logsMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-13Make highlighting optionalMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-13Add flag to show script, highlighted automaticallyMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-11Add configuration setting for source cache rootMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-11Fix: Remove trailing quote characterMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-10Split configuration module in multiple filesMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-08Move package print format setting from CLI into config fileMatthias Beyer
We don't actually want to pass a print format as complex as the package list format on the CLI. Thus, move it to the configuration file. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-08Remove unused imports, sort importsMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-07Change progress bar format to be a configuration parameter.Matthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-06Add Clone derive for config::EndpointMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-03Add configuration entries for database configMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>