forked from alphagov/govuk-design-system
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
75 lines (67 loc) · 3.28 KB
/
.travis.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
language: node_js
# Override the default Travis behaviour so that rather than trying to run tests
# we instead lint the codebase and try to build the design system
#
# The lint and build tasks are defined in package.json
script:
# TravisCI is slower than our local machines, so results in intermittent timeouts
# using the `--runInBand` flag we can force it to without requiring as much
# resources (https://facebook.github.io/jest/docs/en/troubleshooting.html#tests-are-extremely-slow-on-docker-and-or-continuous-integration-ci-server)
- npm run build
- npm test -- --runInBand
sudo: false
env:
global:
# CloudFoundry credentials for deployment
- CF_API="https://api.cloud.service.gov.uk"
- CF_ORG="govuk-design-system"
- CF_SPACE="production"
- CF_USERNAME="design-system-deploy-production@digital.cabinet-office.gov.uk"
# CF_PASSWORD
- secure: IfyAM/Wi9ABfpiSaVdjMaNY8RtAw+0EZrBllDDjOY6VqFAPcJApei+MqQWzLkCFc2MwXsZ0K7BA76eJpefIBbs/6wUpypqB47cAjd8nkZkiHeLhvKeCLadkWsE4LmrCGgpZLBMz/PbMpi4bBlqgzP/lEkfUAaTl/iLMVBjJPrTxB8Q2QPKUxkPvmGkM8eblKMrwWzP3zKlQduMaDYRDMv/36swjbfD3/S/TmZxdLYgXfZLr84S6f2A2iWs+jrcbMNZLKCWCpqdqVHKQbvhdwz2blZcFXbMDaaZXJLotJm+hS2MiLriWXDwVeI/SF/qc9GpF6y+ssWDuBtmpwIMDH26NuNpKJriflA9MidtYRNWeFR+hXrUIc3pcoDFii/m8FSiTJ5qCYyZ9STqZyYVKR3DAwAy1el7mq2XbrMEZX+I8OynRspTIYd+09oewMxjtaLeedZ2Kq3F8l+BY+rdFcvZlM4RooGrrtNrZfp3GnpUSke2VcAeVJaQEC3zD8/Se3bpUMVfvJkyEVolAYKvNb6/nlrJix9OJfWsExEUd6WDWnXDLg1Oe5WTa7DWVsVz6XQGAIDGwYBFT2WIkpv7bA5ngG4YN4UichkZCtzmdSyEqCEFlnBDwH/6KN4+7GVBNf4AlH5TgffFlBnImJr0wTT+PRtW7NAn54jq8knymJtyY=
# Google Tag Manager ID – different for production and preview builds
- GTM_TAG="GTM-53XG2JT"
install:
- npm install --no-optional
# Set up dependencies for deployment:
#
# - The CloudFoundry command line tools
# - The blue-green-deploy plugin for zero downtime push
before_deploy:
# Add the home directory (where we install CloudFoundry) to our $PATH
- export PATH=$HOME:$PATH
# Install CloudFoundry
- travis_retry curl -L -o $HOME/cf.tgz "https://cli.run.pivotal.io/stable?release=linux64-binary&source=github"
- tar xzvf $HOME/cf.tgz -C $HOME
# Install Blue/Green Deploy plugin for zero-downtime-push
- travis_retry cf install-plugin blue-green-deploy -f -r CF-Community
# Deploy the Design System to production when the master branch is changed (1)
#
# Travis is not involved in deploying PR or branch previews – these are handled
# by Netlify.
#
# We use a script rather than using Travis' built in CloudFoundry provider
# because it does not support zero downtime deploys
# (https://github.com/travis-ci/dpl/pull/610)
deploy:
provider: script
script: "./bin/deploy-travis"
# We build the site as part of the build, so we want to keep it so it can be
# deployed!
skip_cleanup: true
on:
branch: master # 1
# Notify the developers on the team when:
# - a build was just broken or still is broken (1)
# - a previously broken build is fixed (2)
#
# Unfortunately there is currently no way to filter branches, so we get these
# notifications for any branch (but not for the pull requests themselves)
notifications:
email:
recipients:
- design-system-developers@digital.cabinet-office.gov.uk
# This is the default behaviour for email notifications, this just makes
# it explicit
on_success: change # 1
on_failure: always # 2