forked from alphagov/govuk-design-system
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
72 lines (65 loc) · 3.19 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
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="design-system"
- CF_USERNAME="[email protected]"
# CF_PASSWORD
- secure: "N1ybDZ35FJ63/oGDfO8pofzTdFicyRHqx/H6Y6vsm+0WedU9bc4mTQ2qBQydYIsjQH+V17EIW+BjomL2ozivtcrf5ZBMvVdXJFk/7U2ii2LifimAXa1j2cQNZnOoviAjJIUPn90QkkjCyZlEe8vp97RYHHhDc17NGacttAvZmzVlPJB9KlwM6PGf7L9HfID2B2vEx5q/DXZcpl6uNJUPXI0/Clnjxl5K0RdvGbyNHvN7N3/cFg97NFe0wbBT64kcxo8HeWLsWeYjMEx3TlwhOJ0z5zisjoCFTI34aUxnV8HRt1BHwU8kghistaLKXc5hpQFnCD6ZVIK23Vmzgg4WheWUvkG14D8E6RggHaKizFgNemz7N0wE9ZwUSrT6lRMUfINUQfDPhFXUPKMTTttyNTRCXmFy7gklu6wh/kG/kFNJhFEZ7SIK0+g33RMV95taolNwsZp4UuKqJwo6TageMeFcpTG0yJ3CgJI6AVxMHNvgunAT7rNdCoc7h8+gBMBMShOw9vTkcPTpdu8Z78b4LMn7GmKaW/PFDfU3EcOsQ6kdmXoayDErXePwLXr/ZYaC9vG+1cPqaTcQ7s5lFismkfwK8XPJfZBCWNamXwLftEuDqTegZz84YwJnbK26JRSjWo50SlEHmbKnM+CWGnreV2YBQGdhupJvtoHFOlYrGqg="
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:
# This is the default behaviour for email notifications, this just makes
# it explicit
on_success: change # 1
on_failure: always # 2