mirror of
https://github.com/servo/servo.git
synced 2025-07-05 14:33:38 +01:00
Only crate tasks for pushes to a given branch
This commit is contained in:
parent
538107928d
commit
aa230e8ef1
2 changed files with 41 additions and 38 deletions
|
@ -5,43 +5,45 @@ policy:
|
|||
tasks:
|
||||
- $if: 'tasks_for == "github-push"'
|
||||
then:
|
||||
taskGroupId: {$eval: as_slugid("decision_task")}
|
||||
taskId: {$eval: as_slugid("decision_task")}
|
||||
provisionerId: aws-provisioner-v1
|
||||
workerType: servo-docker-worker
|
||||
created: {$fromNow: ''}
|
||||
deadline: {$fromNow: '1 day'}
|
||||
metadata:
|
||||
name: "Taskcluster experiments for Servo: decision task"
|
||||
description: ""
|
||||
owner: ${event.pusher.name}@users.noreply.github.com
|
||||
source: ${event.compare}
|
||||
scopes:
|
||||
- "queue:scheduler-id:taskcluster-github"
|
||||
$if: 'event.ref == "refs/heads/master"'
|
||||
then:
|
||||
taskGroupId: {$eval: as_slugid("decision_task")}
|
||||
taskId: {$eval: as_slugid("decision_task")}
|
||||
provisionerId: aws-provisioner-v1
|
||||
workerType: servo-docker-worker
|
||||
created: {$fromNow: ''}
|
||||
deadline: {$fromNow: '1 day'}
|
||||
metadata:
|
||||
name: "Taskcluster experiments for Servo: decision task"
|
||||
description: ""
|
||||
owner: ${event.pusher.name}@users.noreply.github.com
|
||||
source: ${event.compare}
|
||||
scopes:
|
||||
- "queue:scheduler-id:taskcluster-github"
|
||||
|
||||
# Granted to role "repo:github.com/servo/servo-taskcluster-experiments:branch:master"
|
||||
- "queue:create-task:highest:aws-provisioner-v1/servo-*"
|
||||
- "docker-worker:cache:cargo-registry-cache"
|
||||
- "docker-worker:cache:cargo-git-cache"
|
||||
- "queue:route:index.project.servo.servo-taskcluster-experiments.*"
|
||||
# Granted to role "repo:github.com/servo/servo-taskcluster-experiments:branch:master"
|
||||
- "queue:create-task:highest:aws-provisioner-v1/servo-*"
|
||||
- "docker-worker:cache:cargo-registry-cache"
|
||||
- "docker-worker:cache:cargo-git-cache"
|
||||
- "queue:route:index.project.servo.servo-taskcluster-experiments.*"
|
||||
|
||||
payload:
|
||||
maxRunTime: {$eval: '20 * 60'}
|
||||
# https://github.com/servo/taskcluster-bootstrap-docker-images#decision-task
|
||||
image: "servobrowser/taskcluster-bootstrap:decision-task@sha256:28045b7ec0485ef363f8cb14f194008b47e9ede99f2ea40a1e945e921fce976e"
|
||||
features:
|
||||
taskclusterProxy: true
|
||||
env:
|
||||
GITHUB_EVENT_OWNER: ${event.pusher.name}@users.noreply.github.com
|
||||
GITHUB_EVENT_SOURCE: ${event.compare}
|
||||
GITHUB_EVENT_CLONE_URL: ${event.repository.clone_url}
|
||||
GITHUB_EVENT_COMMIT_SHA: ${event.after}
|
||||
command:
|
||||
- /bin/bash
|
||||
- '--login'
|
||||
- '-c'
|
||||
- >-
|
||||
git clone $GITHUB_EVENT_CLONE_URL repo &&
|
||||
cd repo &&
|
||||
git checkout $GITHUB_EVENT_COMMIT_SHA &&
|
||||
python3 decision-task.py
|
||||
payload:
|
||||
maxRunTime: {$eval: '20 * 60'}
|
||||
# https://github.com/servo/taskcluster-bootstrap-docker-images#decision-task
|
||||
image: "servobrowser/taskcluster-bootstrap:decision-task@sha256:28045b7ec0485ef363f8cb14f194008b47e9ede99f2ea40a1e945e921fce976e"
|
||||
features:
|
||||
taskclusterProxy: true
|
||||
env:
|
||||
GITHUB_EVENT_OWNER: ${event.pusher.name}@users.noreply.github.com
|
||||
GITHUB_EVENT_SOURCE: ${event.compare}
|
||||
GITHUB_EVENT_CLONE_URL: ${event.repository.clone_url}
|
||||
GITHUB_EVENT_COMMIT_SHA: ${event.after}
|
||||
command:
|
||||
- /bin/bash
|
||||
- '--login'
|
||||
- '-c'
|
||||
- >-
|
||||
git clone $GITHUB_EVENT_CLONE_URL repo &&
|
||||
cd repo &&
|
||||
git checkout $GITHUB_EVENT_COMMIT_SHA &&
|
||||
python3 decision-task.py
|
||||
|
|
|
@ -30,6 +30,7 @@ class DecisionTask:
|
|||
# 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.index_service = taskcluster.Index(options={"baseUrl": "http://taskcluster/index/v1/"})
|
||||
|
||||
self.now = datetime.datetime.utcnow()
|
||||
|
||||
def from_now_json(self, offset):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue