forked from mozilla-mobile/focus-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.taskcluster.yml
165 lines (164 loc) · 6.12 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
# 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: 0
allowPullRequests: public
tasks:
###############################################################################
# Task: Pull requests
#
# Triggered whenever a pull request is opened or updated.
#
# - Build the app (all flavors)
# - Run unit tests
# - Run code quality tools (spotbugs, lint, checkstyle etc.)
###############################################################################
- provisionerId: '{{ taskcluster.docker.provisionerId }}'
workerType: '{{ taskcluster.docker.workerType }}'
extra:
github:
events:
- pull_request.opened
- pull_request.edited
- pull_request.synchronize
- pull_request.reopened
payload:
maxRunTime: 3600
deadline: "{{ '2 hours' | $fromNow }}"
image: 'mozillamobile/focus-android'
command:
- /bin/bash
- '--login'
- '-cx'
- >-
git fetch {{ event.head.repo.url }} {{ event.head.repo.branch }}
&& git config advice.detachedHead false
&& git checkout {{event.head.sha}}
&& echo "--" > .adjust_token
&& python tools/l10n/check_locales.py
&& ./gradlew --no-daemon clean assemble assembleFocusWebviewUniversalDebugAndroidTest detektCheck ktlint lint pmd checkstyle spotbugs test
artifacts:
'public':
type: 'directory'
path: '/opt/focus-android/app/build/reports'
expires: "{{ '1 week' | $fromNow }}"
metadata:
name: Focus for Android - Build - Pull Request
description: Building Focus for Android (via Gradle) - triggered by a pull request.
owner: '{{ event.head.user.email }}'
source: '{{ event.head.repo.url }}'
###############################################################################
# Task: Master builds
#
# Triggered whenever something is pushed/merged to the master branch.
#
# Creates the following task pipeline:
#
# Build -+--> Unit tests ----+- UI tests --> Preview release
# \-> Code quality -/
#
###############################################################################
- provisionerId: '{{ taskcluster.docker.provisionerId }}'
workerType: '{{ taskcluster.docker.workerType }}'
extra:
github:
env: true
events:
- push
branches:
- master
scopes:
- "queue:create-task:aws-provisioner-v1/github-worker"
- "queue:scheduler-id:taskcluster-github"
- "secrets:get:project/focus/preview-key-store"
- "queue:route:index.project.focus.android.preview-builds"
- "secrets:get:project/focus/firebase"
- "secrets:get:project/focus/nimbledroid"
payload:
maxRunTime: 3600
deadline: "{{ '2 hours' | $fromNow }}"
image: 'mozillamobile/focus-android'
command:
- /bin/bash
- '--login'
- '-cx'
- >-
git fetch origin
&& git config advice.detachedHead false
&& git checkout {{event.head.sha}}
&& python tools/taskcluster/schedule-master-build.py
features:
taskclusterProxy: true
metadata:
name: (Focus for Android) Schedule tasks
description: Scheduling tasks for master push
owner: '{{ event.head.user.email }}'
source: '{{ event.head.repo.url }}'
###############################################################################
# Task: Release builds
#
# Triggered when a new tag or release is published (in any branch)
#
# - Builds release versions of Focus and Klar
# - Signs the builds with the release key
# - Uploads the builds to the "alpha" track on Google Play
###############################################################################
- provisionerId: '{{ taskcluster.docker.provisionerId }}'
workerType: 'gecko-focus'
extra:
github:
env: true
events:
- release
scopes:
- "queue:create-task:aws-provisioner-v1/github-worker"
- "queue:create-task:highest:aws-provisioner-v1/gecko-focus"
- "queue:create-task:highest:scriptworker-prov-v1/mobile-signing-v1"
- "queue:create-task:highest:scriptworker-prov-v1/mobile-pushapk-v1"
- "queue:scheduler-id:taskcluster-github"
- "project:mobile:focus:releng:signing:cert:release-signing"
- "project:mobile:focus:releng:signing:format:focus-jar"
- "project:mobile:focus:releng:googleplay:product:focus"
- "secrets:get:project/focus/tokens"
- "queue:route:index.project.mobile.focus.release.latest"
payload:
maxRunTime: 3600
deadline: "{{ '2 hours' | $fromNow }}"
expires: "{{ '1 year' | $fromNow }}"
image: 'mozillamobile/focus-android'
command:
- /bin/bash
- '--login'
- '-cx'
- >-
git fetch origin --tags
&& git config advice.detachedHead false
&& git checkout {{ event.version }}
&& python tools/taskcluster/release.py \
--tag {{ event.version }} \
--track alpha \
--commit \
--output /opt/focus-android/app/build/outputs/apk \
--apk focusWebviewUniversal/release/app-focus-webview-universal-release-unsigned.apk \
--apk klarWebviewUniversal/release/app-klar-webview-universal-release-unsigned.apk
features:
taskclusterProxy: true
chainOfTrust: true
artifacts:
'public/task-graph.json':
type: 'file'
path: '/opt/focus-android/task-graph.json'
expires: "{{ '1 year' | $fromNow }}"
'public/actions.json':
type: 'file'
path: '/opt/focus-android/actions.json'
expires: "{{ '1 year' | $fromNow }}"
'public/parameters.yml':
type: 'file'
path: '/opt/focus-android/parameters.yml'
expires: "{{ '1 year' | $fromNow }}"
metadata:
name: (Focus for Android) Decision task ({{ event.version }})
description: Scheduling tasks for releasing Focus/Klar
owner: '{{ event.head.user.email }}'
source: '{{ event.head.repo.url }}'