yocto-autobuilder-helper/scripts/target-present
Richard Purdie d9c77dd000 scripts: Add target present check script
Add a script which from the exit code determines if a build target is present
in the configuration. The autobuilder can use this to determine whether to
execute the target at all or whether to skip it.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-11-20 17:28:51 +00:00

564 B
Executable File

#!/usr/bin/env python3

Check whether a target exists in config.json

import json import os import sys

import utils

parser = utils.ArgParser(description='Runs configurations in json.conf.')

parser.add_argument('target', help="The 'nightly' target the autobuilder is running")

args = parser.parse_args()

scriptsdir = os.path.dirname(os.path.realpath(file)) os.environ["SCRIPTSDIR"] = scriptsdir ourconfig = utils.loadconfig()

Find out if this target exists

if args.target in ourconfig['overrides']: sys.exit(0) sys.exit(1)