Bug 1111980 - Part 7 Add mach command for building decision tasks r=garndt

--HG--
extra : rebase_source : d45fbfbbcaf6afa3b987df7df74e64067adaff89
extra : source : f32829f565b047a5bcbacea5d297f5897f250d81
This commit is contained in:
jlal@mozilla.com 2014-12-11 14:28:32 -08:00
Родитель 7cb9e2d0f9
Коммит 605a6e560a
2 изменённых файлов: 41 добавлений и 6 удалений

Просмотреть файл

@ -21,6 +21,7 @@ from mach.decorators import (
from taskcluster_graph.commit_parser import parse_commit
from taskcluster_graph.slugid import slugid
from taskcluster_graph.slugidjar import SlugidJar
from taskcluster_graph.from_now import json_time_from_now, current_json_time
from taskcluster_graph.templates import Templates
@ -83,6 +84,39 @@ def docker_image(name):
def get_task(task_id):
return json.load(urllib2.urlopen("https://queue.taskcluster.net/v1/task/" + task_id))
@CommandProvider
class DecisionTask(object):
@Command('taskcluster-decision', category="ci",
description="Build a decision task")
@CommandArgument('--project',
required=True,
help='Treeherder project name')
@CommandArgument('--revision',
required=True,
help='Revision for this project')
@CommandArgument('--comment',
required=True,
help='Commit message for this revision')
@CommandArgument('--owner',
required=True,
help='email address of who owns this graph')
@CommandArgument('task', help="Path to decision task to run.")
def run_task(self, **params):
templates = Templates(ROOT)
# Template parameters used when expanding the graph
parameters = {
'source': 'http://todo.com/soon',
'project': params['project'],
'comment': params['comment'],
'revision': params['revision'],
'owner': params['owner'],
'as_slugid': SlugidJar(),
'from_now': json_time_from_now,
'now': datetime.datetime.now().isoformat()
}
task = templates.load(params['task'], parameters)
print(json.dumps(task, indent=4))
@CommandProvider
class TryGraph(object):
@Command('taskcluster-trygraph', category="ci",

Просмотреть файл

@ -1,3 +1,4 @@
---
metadata:
name: 'Task graph used to build try jobs'
description: |
@ -26,20 +27,20 @@ scopes:
- "docker-worker:cache:sources-gaia"
- "docker-worker:cache:build-emulator-ics-debug"
tasks:
- taskId: '{{#as_slugid }}decision task{{/as_slugid}}'
- taskId: '{{#as_slugid}}decision task{{/as_slugid}}'
task:
created: '{{now}}'
deadline: '{{#from_now }}1 day{{#/from_now}}'
deadline: '{{#from_now}}1 day{{/from_now}}'
metadata:
source: '{{source}}'
owner: '{{owner}}'
source: {{source}}
owner: {{owner}}
name: Initial decision task for try
description: |
This is the single most important task as it decides how all other tasks
get built.
workerType: gecko-decision
provisionerId: aws-provisioner
workerType: "gecko-decision"
provisionerId: "aws-provisioner"
scopes:
- "docker-worker:cache:tc-vcs-public-sources"