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: eljg7jaYmxeMOujtx1W3QgoMjXw6+qloTCCEYHMToq34npmAZ37AQ5SLuPJXogkPvpJ/8U/tjIV0rAEAgoIl72CPaK2K1+GokN9qrNh8A+UtfW3jfyt8CxeywA+Q/bKc0O2bC9a+Ni4hVK82Z5WAYAwiYbT8ZL4z4WC/TMNIhGMGGhCJRyDJwuIxY+OIjknacy8l574N1rOuqs0634us6yYsggOArVxJ0+N0sXKCx+VJhkQ9yTErnPjP5ACflWlCuuJyHggNtgql3lmKxtuO6QgnB+8LZjY8y6PaKgpqmPR9u/FHIdxYE4OfsGfvzIFOUJcr0w7V+fJA0FWj6MtmqFLXPqnAIX4I/zocTpVR4kFTqTSBX1Utz/BR5zVN5OnS4uMDwWLqVwnO7FYppmhENtOVjqqIQLTx7YZuPwlRjRy8l6Ugrrz/PFQJQ4vSVQJ7E8WbLbfapPC+cogHskDRDLks+87laDaEGGu48V5LsV9deWgfTIA9jSCK6W4yqO2UhruTbRkmuJjxaWrxjdycL1NXe2pG7vOVVVSnbXFrGcS5FZlMec7eVx/7YhQxG8DK2uw+SQQAVPaKZX5soBU48BWW6C4OaSlyXhv5F0ze5wkV7w+f6K6AzblIfK/ooQ0yN1EFtkRutHaNNmh7P+4p5q56MMtbTwfzm4WjkEkFYqc=
# 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