From 9bd4af2286e04b732880d7031d6afc3b0f1168e0 Mon Sep 17 00:00:00 2001 From: Davide Cavalca Date: Mon, 18 Dec 2023 16:05:35 -0800 Subject: [PATCH] tmt: copy the artifacts over --- builder.py | 28 ++++++++++++++++++++++++++++ tmt/plans/build-gnome.fmf | 1 + tmt/plans/build-kde.fmf | 1 + tmt/plans/build-minimal.fmf | 1 + tmt/plans/build-server.fmf | 1 + 5 files changed, 32 insertions(+) diff --git a/builder.py b/builder.py index dcf816c..196e042 100755 --- a/builder.py +++ b/builder.py @@ -188,6 +188,23 @@ def packageUpload(target): uploadToS3(manifest, f"os/{manifest}") +def tmtCopy(target): + base = f"fedora-{RELEASE}-{target['id']}-{BUILDVER}" + package = f"{base}.zip" + logs_package = f"{base}.logs.zip" + image = f"{base}.raw.zst" + manifest = f"{base}.json" + + artifacts = os.getenv("TMT_PLAN_DATA") + if not os.path.exists(artifacts): + os.mkdir(artifacts) + + shutil.copyfile(package, f"{artifacts}/{package}") + shutil.copyfile(logs_package, f"{artifacts}/{logs_package}") + shutil.copyfile(image, f"{artifacts}/{image}") + shutil.copyfile(manifest, f"{artifacts}/{manifest}") + + def getManifest(): if S3_BUCKET is None: fail("S3_BUCKET is not set") @@ -250,6 +267,17 @@ def upload(manifest, target): uploadToS3("merged_installer_data.json", MANIFEST) +@cli.command() +@click.argument("target") +def tmt(target): + if target not in TARGETS.keys(): + fail(f"Unknown target: {target}") + + target = TARGETS[target] + + tmtCopy(target) + + @cli.command() @click.option("--update/--no-update", default=False) @click.option("--upload/--no-upload", default=False) diff --git a/tmt/plans/build-gnome.fmf b/tmt/plans/build-gnome.fmf index 0f39b9c..b967251 100644 --- a/tmt/plans/build-gnome.fmf +++ b/tmt/plans/build-gnome.fmf @@ -8,6 +8,7 @@ discover: setenforce 0 $TMT_TREE/builder.py build gnome $TMT_TREE/builder.py package gnome + $TMT_TREE/builder.py tmt gnome setenforce 1 execute: diff --git a/tmt/plans/build-kde.fmf b/tmt/plans/build-kde.fmf index fe94aba..bc9c1e3 100644 --- a/tmt/plans/build-kde.fmf +++ b/tmt/plans/build-kde.fmf @@ -8,6 +8,7 @@ discover: setenforce 0 $TMT_TREE/builder.py build kde $TMT_TREE/builder.py package kde + $TMT_TREE/builder.py tmt kde setenforce 1 execute: diff --git a/tmt/plans/build-minimal.fmf b/tmt/plans/build-minimal.fmf index 7130e8b..021d9bd 100644 --- a/tmt/plans/build-minimal.fmf +++ b/tmt/plans/build-minimal.fmf @@ -8,6 +8,7 @@ discover: setenforce 0 $TMT_TREE/builder.py build minimal $TMT_TREE/builder.py package minimal + $TMT_TREE/builder.py tmt minimal setenforce 1 execute: diff --git a/tmt/plans/build-server.fmf b/tmt/plans/build-server.fmf index 77c777b..7e847ef 100644 --- a/tmt/plans/build-server.fmf +++ b/tmt/plans/build-server.fmf @@ -8,6 +8,7 @@ discover: setenforce 0 $TMT_TREE/builder.py build server $TMT_TREE/builder.py package server + $TMT_TREE/builder.py tmt server setenforce 1 execute: