Revision control

Copy as Markdown

# 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: collaborators
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 detekt verifyWebViewCount assembleAmazonWebViewDebugAndroidTest 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 detekt verifyWebViewCount assembleAmazonWebViewDebugAndroidTest 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 }}'