forked from mozilla-mobile/android-components
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.taskcluster.yml
190 lines (189 loc) · 7.97 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
version: 1
policy:
pullRequests: public
tasks:
####################################################################################################
# Task: Pull requests
####################################################################################################
- $if: 'tasks_for == "github-pull-request" && event["action"] in ["opened", "reopened", "edited", "synchronize"]'
then:
$let:
decision_task_id: {$eval: as_slugid("decision_task")}
expires_in: {$fromNow: '1 year'}
scheduler_id: taskcluster-github
user: ${event.sender.login}
head_branch: ${event.pull_request.head.ref}
head_rev: ${event.pull_request.head.sha}
repository: ${event.pull_request.head.repo.clone_url}
pull_request_title: ${event.pull_request.title}
pull_request_number: ${event.pull_request.number}
pull_request_url: ${event.pull_request.html_url}
in:
taskId: ${decision_task_id}
taskGroupId: ${decision_task_id}
created: {$fromNow: ''}
deadline: {$fromNow: '2 hours'}
expires: ${expires_in}
provisionerId: aws-provisioner-v1
workerType: github-worker
scopes:
- queue:create-task:aws-provisioner-v1/github-worker
- queue:scheduler-id:${scheduler_id}
- secrets:get:project/mobile/android-components/public-tokens
payload:
maxRunTime: 3600
image: mozillamobile/android-components:1.10
env:
TASK_ID: ${decision_task_id}
SCHEDULER_ID: ${scheduler_id}
MOBILE_HEAD_REPOSITORY: ${repository}
MOBILE_HEAD_BRANCH: ${head_branch}
MOBILE_HEAD_REV: ${head_rev}
GITHUB_PULL_TITLE: ${pull_request_title}
command:
- /bin/bash
- --login
- -cx
- >-
git fetch ${repository} ${head_branch}
&& git config advice.detachedHead false
&& git checkout ${head_rev}
&& ./gradlew --no-daemon --version
&& python automation/taskcluster/decision_task.py
features:
taskclusterProxy: true
metadata:
name: 'Android Components - Decision task (Pull Request #${pull_request_number})'
description: 'Building and testing Android components - triggered by [#${pull_request_number}](${pull_request_url})'
owner: ${user}@users.noreply.github.com
source: ${repository}/raw/${head_rev}/.taskcluster.yml
####################################################################################################
# Task: Pushes
####################################################################################################
- $if: 'tasks_for == "github-push"'
then:
$if: 'event.ref[:10] != "refs/tags/"'
then:
$let:
decision_task_id: {$eval: as_slugid("decision_task")}
expires_in: {$fromNow: '1 year'}
scheduler_id: taskcluster-github
user: ${event.sender.login}
head_branch: ${event.ref}
head_rev: ${event.after}
repository: ${event.repository.clone_url}
in:
taskId: ${decision_task_id}
taskGroupId: ${decision_task_id}
created: {$fromNow: ''}
deadline: {$fromNow: '2 hours'}
expires: ${expires_in}
provisionerId: aws-provisioner-v1
workerType: github-worker
scopes:
- queue:create-task:aws-provisioner-v1/github-worker
- queue:scheduler-id:${scheduler_id}
- secrets:get:project/mobile/android-components/public-tokens
payload:
maxRunTime: 3600
image: mozillamobile/android-components:1.10
env:
TASK_ID: ${decision_task_id}
SCHEDULER_ID: ${scheduler_id}
MOBILE_HEAD_REPOSITORY: ${repository}
MOBILE_HEAD_BRANCH: ${head_branch}
MOBILE_HEAD_REV: ${head_rev}
command:
- /bin/bash
- --login
- -cx
- >-
git fetch ${repository} ${head_branch}
&& git config advice.detachedHead false
&& git checkout ${head_rev}
&& ./gradlew --no-daemon --version
&& python automation/taskcluster/decision_task.py
features:
taskclusterProxy: true
metadata:
name: Android Components - Decision task
description: Schedules the build and test tasks for Android components.
owner: ${user}@users.noreply.github.com
source: ${repository}/raw/${head_rev}/.taskcluster.yml
####################################################################################################
# Task: Release
####################################################################################################
- $if: 'tasks_for == "github-release"'
then:
$let:
decision_task_id: {$eval: as_slugid("decision_task")}
expires_in: {$fromNow: '1 year'}
repository: https://github.com/mozilla-mobile/android-components
scheduler_id: taskcluster-github
tag: ${event.release.tag_name}
user: ${event.sender.login}
in:
taskId: ${decision_task_id}
taskGroupId: ${decision_task_id} # Must be explicit because of Chain of Trust
created: {$fromNow: ''}
deadline: {$fromNow: '2 hours'}
expires: ${expires_in}
schedulerId: ${scheduler_id} # Must be explicit because of Chain of Trust
provisionerId: aws-provisioner-v1
workerType: gecko-focus
requires: all-completed # Must be explicit because of Chain of Trust
priority: highest
retries: 5
scopes:
- project:mobile:android-components:releng:beetmover:action:push-to-maven
- project:mobile:android-components:releng:beetmover:bucket:maven-production
- queue:create-task:highest:aws-provisioner-v1/gecko-focus
- queue:create-task:highest:scriptworker-prov-v1/mobile-beetmover-v1
- queue:scheduler-id:${scheduler_id}
payload:
maxRunTime: 600 # Decision should remain fast enough to schedule a handful of tasks
image: 'mozillamobile/android-components:1.10'
env:
TASK_ID: ${decision_task_id}
SCHEDULER_ID: ${scheduler_id}
MOBILE_HEAD_REPOSITORY: ${repository}
MOBILE_HEAD_BRANCH: ${event.release.target_commitish}
MOBILE_HEAD_REV: ${tag}
MOBILE_TRIGGERED_BY: ${user}
command:
- /bin/bash
- --login
- -cx
- >-
git fetch origin --tags
&& git config advice.detachedHead false
&& git checkout ${tag}
&& pip install pyyaml
&& ./gradlew --no-daemon --version
&& python automation/taskcluster/decision_task_release.py --version "${tag}"
features:
taskclusterProxy: true
chainOfTrust: true
artifacts:
public/task-graph.json:
type: file
path: /build/android-components/task-graph.json
expires: ${expires_in}
public/actions.json:
type: file
path: /build/android-components/actions.json
expires: ${expires_in}
public/parameters.yml:
type: file
path: /build/android-components/parameters.yml
expires: ${expires_in}
extra:
tasks_for: ${tasks_for}
metadata:
name: Android Components - Decision task (${tag})
description: Build and publish release versions.
owner: ${user}@users.noreply.github.com
source: ${repository}/raw/${tag}/.taskcluster.yml