Skip to content

Commit

Permalink
Update docker-compose.yml for staging mail tests (WIP) (#2495)
Browse files Browse the repository at this point in the history
* Update docker-compose.yml

* Drop explicit link to db container for host networking to work

* Direct app to db in host mode

* Open port to database

* Switch db to use container based networking (not host)

* Add some logging

* Exec tests within running container
  • Loading branch information
jywarren authored Apr 6, 2018
1 parent 35aeac4 commit c9f91d3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ install:
- docker-compose build
- docker-compose up -d
- docker-compose exec web sleep 5
- docker-compose logs db
- netstat -ltpn
- docker-compose exec web bash -c "rake db:setup"
- docker-compose exec web bash -c "rake db:migrate"
- docker-compose exec web bower install --allow-root
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then gem install danger danger-junit; fi'

script:
- docker-compose run -e CI=TRUE web bash -c "GENERATE_REPORT=true rake test:all"
- docker-compose exec web bash -c "CI=TRUE GENERATE_REPORT=true rake test:all"
- echo -e '<?xml version="1.0" encoding="UTF-8"?>' > output.xml
- tail -n +2 -q ./test/reports/TEST*.xml >> output.xml
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then danger --verbose; fi'
2 changes: 1 addition & 1 deletion config/database.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ test:
username: plots
password: plots
database: plots
host: db
encoding: utf8
host: 127.0.0.1
pool: 5
timeout: 5000
strict: false
Expand Down
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ version: "2"
services:
db:
image: mariadb:10.2
network_mode: "service:web"
environment:
- MYSQL_DATABASE=plots
- MYSQL_USER=plots
Expand All @@ -25,6 +26,4 @@ services:
- .:/app
ports:
- "127.0.0.1:4000:4000"
links:
- db
restart: unless-stopped

0 comments on commit c9f91d3

Please sign in to comment.