Bug 1215157 - Add --dry-run to mach taskcluster-graph; r=garndt

This commit is contained in:
Mike Shal
2015-10-14 11:26:35 -04:00
parent 0def4012ac
commit 34da8d22c2
2 changed files with 38 additions and 0 deletions

View File

@@ -292,6 +292,9 @@ class Graph(object):
@CommandArgument('--print-names-only',
action='store_true', default=False,
help="Only print the names of each scheduled task, one per line.")
@CommandArgument('--dry-run',
action='store_true', default=False,
help="Stub out taskIds and date fields from the task definitions.")
def create_graph(self, **params):
from taskcluster_graph.commit_parser import parse_commit
from slugid import nice as slugid
@@ -302,6 +305,13 @@ class Graph(object):
from taskcluster_graph.templates import Templates
import taskcluster_graph.build_task
if params['dry_run']:
from taskcluster_graph.dry_run import (
json_time_from_now,
current_json_time,
slugid,
)
project = params['project']
message = params.get('message', '') if project == 'try' else DEFAULT_TRY