diff --git a/taskcluster/mach_commands.py b/taskcluster/mach_commands.py index fa481abc9a5a..98b60a4bfde4 100644 --- a/taskcluster/mach_commands.py +++ b/taskcluster/mach_commands.py @@ -152,6 +152,8 @@ class MachCommands(MachCommandBase): help='SCM level of this repository') @CommandArgument('--target-tasks-method', help='method for selecting the target tasks to generate') + @CommandArgument('--try-task-config-file', + help='path to try task configuration file') def taskgraph_decision(self, **options): """Run the decision task: generate a task graph and submit to TaskCluster. This is only meant to be called within decision tasks, diff --git a/taskcluster/taskgraph/decision.py b/taskcluster/taskgraph/decision.py index b5428c9849f9..eaf4d4139b25 100644 --- a/taskcluster/taskgraph/decision.py +++ b/taskcluster/taskgraph/decision.py @@ -203,13 +203,17 @@ def get_decision_parameters(options): if 'nightly' in parameters.get('target_tasks_method', ''): parameters['release_history'] = populate_release_history('Firefox', project) - # if try_task_config.json is present, load it - task_config_file = os.path.join(os.getcwd(), 'try_task_config.json') + if options.get('try_task_config_file'): + task_config_file = os.path.abspath(options.get('try_task_config_file')) + else: + # if try_task_config.json is present, load it + task_config_file = os.path.join(os.getcwd(), 'try_task_config.json') # load try settings if 'try' in project: parameters['try_mode'] = None if os.path.isfile(task_config_file): + logger.info("using try tasks from {}".format(task_config_file)) parameters['try_mode'] = 'try_task_config' with open(task_config_file, 'r') as fh: parameters['try_task_config'] = json.load(fh)