Only crate tasks for pushes to a given branch

This commit is contained in:
Simon Sapin 2018-09-13 17:29:55 +02:00
parent 538107928d
commit aa230e8ef1
2 changed files with 41 additions and 38 deletions

View file

@ -4,6 +4,8 @@ policy:
pullRequests: collaborators pullRequests: collaborators
tasks: tasks:
- $if: 'tasks_for == "github-push"' - $if: 'tasks_for == "github-push"'
then:
$if: 'event.ref == "refs/heads/master"'
then: then:
taskGroupId: {$eval: as_slugid("decision_task")} taskGroupId: {$eval: as_slugid("decision_task")}
taskId: {$eval: as_slugid("decision_task")} taskId: {$eval: as_slugid("decision_task")}

View file

@ -30,6 +30,7 @@ class DecisionTask:
# https://docs.taskcluster.net/docs/reference/workers/docker-worker/docs/features#feature-taskclusterproxy # https://docs.taskcluster.net/docs/reference/workers/docker-worker/docs/features#feature-taskclusterproxy
self.queue_service = taskcluster.Queue(options={"baseUrl": "http://taskcluster/queue/v1/"}) self.queue_service = taskcluster.Queue(options={"baseUrl": "http://taskcluster/queue/v1/"})
self.index_service = taskcluster.Index(options={"baseUrl": "http://taskcluster/index/v1/"}) self.index_service = taskcluster.Index(options={"baseUrl": "http://taskcluster/index/v1/"})
self.now = datetime.datetime.utcnow() self.now = datetime.datetime.utcnow()
def from_now_json(self, offset): def from_now_json(self, offset):