forked from mozilla-mobile/firefox-tv
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.taskcluster.yml
137 lines (135 loc) · 4.81 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
# 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 (findbugs, 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/firefox-tv'
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
&& ./gradlew clean assemble lint checkstyle ktlint pmd detektCheck test
artifacts:
'public':
type: 'directory'
path: '/opt/firefox-tv/app/build/reports'
expires: "{{ '1 week' | $fromNow }}"
metadata:
name: Firefox for Amazon's Fire TV - Build - Pull Request
description: Building Firefox for Amazon's Fire TV (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.
#
# - Build the app (all flavors)
# - Run unit tests
# - Run code quality tools (findbugs, lint, checkstyle etc.)
#
# - HACK: Used {{ event.head.repo.url }} instead of origin because origin routes to
# the Focus Android repo
###############################################################################
- provisionerId: '{{ taskcluster.docker.provisionerId }}'
workerType: '{{ taskcluster.docker.workerType }}'
extra:
github:
events:
- push
branches:
- master
payload:
maxRunTime: 3600
deadline: "{{ '2 hours' | $fromNow }}"
image: 'mozillamobile/firefox-tv'
command:
- /bin/bash
- '--login'
- '-cx'
- >-
git fetch {{ event.head.repo.url }}
&& git config advice.detachedHead false
&& git checkout {{event.head.sha}}
&& echo "--" > .adjust_token
&& ./gradlew clean assemble lint checkstyle ktlint pmd detektCheck test
artifacts:
'public':
type: 'directory'
path: '/opt/firefox-tv/app/build/reports'
expires: "{{ '1 week' | $fromNow }}"
metadata:
name: Firefox for Amazon's Fire TV - Build - Master
description: Building Firefox for Amazon's Fire TV (via Gradle) - Master
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)
#
# - Build (unsigned) release versions of the app with release translations and
# adjust token.
###############################################################################
- provisionerId: '{{ taskcluster.docker.provisionerId }}'
workerType: '{{ taskcluster.docker.workerType }}'
extra:
github:
events:
- release
scopes:
- "secrets:get:project/firefox-tv/tokens"
payload:
maxRunTime: 3600
deadline: "{{ '2 hours' | $fromNow }}"
image: 'mozillamobile/firefox-tv'
command:
- /bin/bash
- '--login'
- '-cx'
- >-
git fetch origin --tags
&& git config advice.detachedHead false
&& git checkout {{ event.version }}
&& python tools/taskcluster/get-sentry-token.py
&& python tools/taskcluster/get-pocket-token.py
&& ./gradlew --no-daemon clean test assembleRelease
artifacts:
'public':
type: 'directory'
path: '/opt/firefox-tv/app/build/outputs/apk'
expires: "{{ '1 week' | $fromNow }}"
features:
taskclusterProxy: true
metadata:
name: Firefox for Fire TV - Release build ({{ event.version }})
description: Building Firefox for Amazon's Fire TV (via Gradle) - Release
owner: '{{ event.head.user.email }}'
source: '{{ event.head.repo.url }}'