forked from alphagov/datagovuk_publish
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
51 lines (51 loc) · 1.67 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
sudo: false
language: ruby
cache: bundler
branches:
only:
- master
- /^v\d+\.\d+\.\d+$/
services:
- postgresql
- elasticsearch
- redis-server
before_install:
- curl https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.9.1-amd64.deb -o elasticsearch.deb
- sudo dpkg -i --force-confnew elasticsearch.deb
- sudo chown -R elasticsearch:elasticsearch /etc/default/elasticsearch
- sudo service elasticsearch restart
- gem install bundler
before_script:
- sleep 10
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
script:
- bundle exec rails db:create
- bundle exec rails db:schema:load
- bundle exec rake
after_script:
- if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi
env:
global:
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
- RAILS_ENV=test
# FIXME: update on travis env
- CC_TEST_REPORTER_ID=$CODECLIMATE_REPO_TOKEN
after_success:
- wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add -
- echo "deb http://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list
- sudo apt-get update
- sudo apt-get install cf-cli
deploy:
# To Staging
- provider: script
script: scripts/deploy.sh publish-beta-staging-worker staging worker
on:
repo: alphagov/datagovuk_publish
# To Production
- provider: script
script: scripts/deploy.sh publish-beta-production-worker production worker
on:
repo: alphagov/datagovuk_publish
tags: true