-
Notifications
You must be signed in to change notification settings - Fork 0
/
.taskcluster.yml
94 lines (94 loc) · 3.14 KB
/
.taskcluster.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
version: 1
reporting: checks-v1
policy:
pullRequests: public
tasks:
$let:
head_rev:
$if: tasks_for == "github-pull-request"
then: ${event.pull_request.head.sha}
else: ${event.after}
repository:
$if: tasks_for == "github-pull-request"
then: ${event.pull_request.head.repo.html_url}
else: ${event.repository.html_url}
repo_name:
$if: tasks_for == "github-pull-request"
then: ${event.pull_request.head.repo.name}
else: ${event.repository.name}
repo_full_name:
$if: tasks_for == "github-pull-request"
then: ${event.pull_request.head.repo.full_name}
else: ${event.repository.full_name}
branch:
$if: tasks_for == "github-pull-request"
then: "pull-request"
else:
$if: "event.ref[:11] == 'refs/heads/'"
then: "branch:${event.ref[11:]}"
else:
$if: "event.ref[:10] == 'refs/tags/'"
then: "tag:${event.ref[10:]}"
else: "unknown"
git_ref:
$if: tasks_for == "github-pull-request"
then: "refs/pull/${event.pull_request.number}"
else: ${event.ref}
should_run:
$match:
(tasks_for == "github-push") || (tasks_for == "github-pull-request" && event["action"] in ["opened","reopened","synchronize"]):
in:
$if: should_run
then:
- metadata:
name: Decision task
description: ''
owner: ${event.sender.login}@users.noreply.github.com
source:
$if: tasks_for == "github-pull-request"
then: ${event.pull_request.html_url}
else: ${event.compare}
tags:
git_ref: ${git_ref}
projectId: "divvun"
taskQueueId: divvun/linux
deadline:
$fromNow: 1 day
scopes:
- "assume:repo:github.com/${repo_full_name}:${branch}"
- "object:upload:divvun:*"
payload:
maxRunTime: 3600
image: "ghcr.io/divvun/taskcluster-decision-task-image:main"
features:
# Needed for the decision task to create other tasks
taskclusterProxy: true
command:
- /bin/bash
- '--login'
- '-e'
- '-c'
- >-
git init ci &&
cd ci &&
git fetch --depth 1 "$CI_REPO_URL" "$CI_REPO_REF" &&
git reset --hard FETCH_HEAD &&
python3 decision_task.py
env:
GIT_URL: ${event.repository.clone_url}
TASK_FOR: ${tasks_for}
GIT_REF: ${git_ref}
GITHUB_REF: ${git_ref}
GIT_SHA:
$if: tasks_for == "github-pull-request"
then: ${event.pull_request.head.sha}
else: ${event.after}
TASK_OWNER: ${event.sender.login}@users.noreply.github.com
TASK_SOURCE:
$if: tasks_for == "github-pull-request"
then: ${event.pull_request.html_url}
else: ${event.compare}
REPO_NAME: ${repo_name}
REPO_FULL_NAME: ${repo_full_name}
CI_REPO_URL: https://github.com/divvun/taskcluster-scripts.git
CI_REPO_REF: main