Skip to content

Commit 215da92

Browse files
committed
Fixing travis and docker scripts to send automated coverage report
1 parent 675024f commit 215da92

File tree

4 files changed

+19
-22
lines changed

4 files changed

+19
-22
lines changed

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
.git
21
README.md
32

43
.dockerignore

.travis.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,15 @@ notifications:
3737
slack: gppmds8-github:sJE6QlBfPGMkfUf48wuTsKa7
3838

3939
script:
40-
- docker-compose -f docker-compose.test.yml -p travis up -d
41-
- docker logs -f falko-test
42-
- test `docker wait falko-test | wc -l` == "1"
43-
40+
- docker-compose -f docker-compose.test.yml up -d
41+
- docker-compose -f docker-compose.test.yml logs
42+
- docker exec falko-test bundle install
43+
- docker exec falko-test bundle exec rails db:create
44+
- docker exec falko-test bundle exec rails db:migrate
45+
- docker exec falko-test bundle exec rake db:test:prepare
46+
- docker exec falko-test bundle exec rails test
47+
- docker exec falko-test bash -c "CODECLIMATE_REPO_TOKEN=095bc7916972a84272890f2c79eaba7fd64124a4b5b4e826ba0a4d0599b6bfe3 bundle exec codeclimate-test-reporter"
48+
4449
after_script:
45-
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
46-
- docker exec falko-server /bin/bash -lc "CODECLIMATE_REPO_TOKEN=095bc7916972a84272890f2c79eaba7fd64124a4b5b4e826ba0a4d0599b6bfe3 bundle exec codeclimate-test-reporter"
50+
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT --debug
51+
- docker-compose down --remove-orphans

Dockerfile.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ RUN mkdir Falko-2017.2-BackEnd
1616
WORKDIR /Falko-2017.2-BackEnd
1717

1818
COPY . /Falko-2017.2-BackEnd
19+
COPY .git/ /Falko-2017.2-BackEnd/.git/
1920

2021
COPY Gemfile /Falko-2017.2-BackEnd/Gemfile
2122
COPY wait-4-postgres.sh /Falko-2017.2-BackEnd/wait-4-postgres.sh

docker-compose.test.yml

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,22 @@ services:
55
build:
66
context: .
77
dockerfile: Dockerfile.test
8-
command: /bin/bash -l -c "./wait-4-postgres.sh && bundle install && RAILS_ENV=test bundle exec rails db:create && RAILS_ENV=test bundle exec rails db:migrate && bundle exec rake db:test:prepare && bundle exec rails test"
9-
links:
10-
- falko-server
8+
command: bash -c "./wait-4-postgres.sh && sleep infinity"
9+
environment:
10+
- RAILS_ENV=test
11+
ports:
12+
- 3000
13+
depends_on:
14+
- falko-database
1115

1216
falko-database:
1317
container_name: falko-database
1418
image: postgres:9.6
1519
ports:
1620
- 5432
1721
environment:
18-
- PGDATA=/postgresql
1922
- PG_USER=postgres
2023
- PG_DATABASE=travis_ci_test
2124
volumes:
2225
- ./tmp/data/postgresql:/postgresql
2326
- .:/Falko-2017.2-BackEnd
24-
25-
falko-server:
26-
container_name: falko-server
27-
image: alaxalves/api:1.5
28-
command: /bin/bash -l -c "bundle install && bundle exec rails s -p 3000 -b '0.0.0.0'"
29-
environment:
30-
- RAILS_ENV=test
31-
volumes:
32-
- .:/Falko-2017.2-BackEnd
33-
depends_on:
34-
- falko-database

0 commit comments

Comments
 (0)