ci: simplify local usage of generate_build_jobs

There's no need why we can't have a default value

Signed-off-by: Pablo Correa Gómez <pabloyoyoista@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7725>
This commit is contained in:
Pablo Correa Gómez 2026-01-09 21:39:49 +01:00 committed by The Friendly Merge Bot
parent 6a1fe61bf7
commit af81f21fba
No known key found for this signature in database
2 changed files with 11 additions and 11 deletions

View file

@ -2,6 +2,7 @@
# Copyright 2025 Pablo Correa Gomez
# SPDX-License-Identifier: GPL-3.0-or-later
import argparse
from functools import cached_property
from pathlib import Path
from typing import Self
@ -148,13 +149,12 @@ class ArchTagSet(set):
if __name__ == "__main__":
# Needs input to output if we should create the jobs
if len(sys.argv) != 3:
print("usage: generate_build_jobs.py TEMPLATE CHILD_PIPELINE")
print(sys.argv)
sys.exit(1)
template = sys.argv[1]
child_pipeline = sys.argv[2]
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)
parser.add_argument("--template", default=".ci/build-jobs.yaml.j2", help="Jinja2 input template")
parser.add_argument("--output", default=".ci/build-jobs.yaml", help="output pipeline")
args = parser.parse_args()
# pmb logging has to be initialized for later pmb commands to work, setting
# to /dev/null since we don't care about the output. Later this could
@ -164,7 +164,7 @@ if __name__ == "__main__":
# Load context
sys.argv = ["pmbootstrap.py", "chroot"]
args = pmb.parse.arguments()
_ = pmb.parse.arguments()
# Get the list of supported devices
supported_devices = Device.supported_devices()
@ -208,7 +208,7 @@ if __name__ == "__main__":
print(f"Architectures to build: {archs}")
print(f"Devices under test: {devices_under_test}")
with open(template) as f:
with open(args.template) as f:
rendered = Template(f.read()).render(
archs=archs,
devices_under_test=devices_under_test,
@ -224,5 +224,5 @@ if __name__ == "__main__":
Arch.loongarch64: "loongarch64",
},
)
with open(child_pipeline, "w") as fw:
with open(args.output, "w") as fw:
fw.write(rendered)

View file

@ -178,7 +178,7 @@ generate-build-jobs:
# HACK: Make the pmb library happy to use the currently-cloned pmaports repo
- mkdir -p /root/.local/var/pmbootstrap/cache_git/ && ln -s $PWD /root/.local/var/pmbootstrap/cache_git/pmaports
- PYTHONPATH=/tmp/pmbootstrap/ .ci/lib/generate_build_jobs.py .ci/build-jobs.yaml.j2 .ci/build-jobs.yaml
- PYTHONPATH=/tmp/pmbootstrap/ .ci/lib/generate_build_jobs.py
artifacts:
paths: