diff options
author | Helmut Grohne <helmut@subdivi.de> | 2021-05-27 11:54:04 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2021-05-27 11:54:04 +0200 |
commit | 69fdfcdda423b55c7251e4d46e82563cda98a63d (patch) | |
tree | 4299a69f4ae7461065f3f1bb48ac9f2ba557f058 /mdbp/streamapi.py | |
parent | afff0dc73188ac323ec0265cc6b39c67f9fd7474 (diff) | |
download | mdbp-69fdfcdda423b55c7251e4d46e82563cda98a63d.tar.gz |
add new field .output.artifacts to schema
Using the field you can specify an ORed set of positive glob-style
patterns for artifacts to retain in the .output.directory. It defaults
to including all artifacts.
Diffstat (limited to 'mdbp/streamapi.py')
-rw-r--r-- | mdbp/streamapi.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mdbp/streamapi.py b/mdbp/streamapi.py index 8f67366..f36208a 100644 --- a/mdbp/streamapi.py +++ b/mdbp/streamapi.py @@ -12,6 +12,7 @@ Differences to the regular backend API: """ import argparse +import fnmatch import json import pathlib import subprocess @@ -67,7 +68,9 @@ def main() -> None: sys.exit(code) with tarfile.open(fileobj=sys.stdout.buffer, mode="w|") as outtar: for elem in outdir.iterdir(): - tar_add(outtar, elem) + if any(fnmatch.fnmatchcase(elem.name, pattern) + for pattern in build["output"].get("artifacts", ["*"])): + tar_add(outtar, elem) if __name__ == "__main__": main() |