forked from publiclab/plots2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
50 lines (43 loc) · 1.47 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
sudo: required
language: generic
services:
- docker
git:
depth: false
env:
global:
- COMPOSE_FILE=./containers/docker-compose-testing.yml
- CI=true
matrix:
- TASK="rake test:all"
- TASK="rails test test/unit"
- TASK="rails test test/functional"
- TASK="rails test test/integration"
- TASK="rails test:system"
branches:
only:
- master
- unstable
- codecov
install:
- rm -rf test/reports
- cp config/database.yml.example config/database.yml
- cp db/schema.rb.example db/schema.rb
- docker-compose build
- docker-compose up -d
- docker-compose exec web sleep 15 # wait until mysql is up
- netstat -ltpn
- docker-compose exec web bash -c "rake db:setup"
- docker-compose exec web bash -c "rake db:migrate"
- docker-compose exec web bash -c "rake assets:precompile"
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then bash -c "docker-compose exec web gem install danger danger-junit google-cloud-storage"; fi'
script:
- docker-compose exec web bash -c 'echo "$GOOGLE_APPLICATION_CREDENTIALS_JSON" > /tmp/credentials.json' # needs to be a path to a json file, so we shuffle...
- docker-compose exec web bash -c "GENERATE_REPORT=true $TASK"
- if [ $TASK != "rake test:all" ]; then
echo -e '<?xml version="1.0" encoding="UTF-8"?>' > output.xml;
tail -n +2 -q ./test/reports/TEST*.xml >> output.xml;
fi
- if [ $TRAVIS_PULL_REQUEST != "false" ]; then
docker-compose exec web danger --verbose;
fi