-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
48 lines (43 loc) · 1.61 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
language: ruby
sudo: required
services:
- docker
env:
global:
- DOCKER_VERSION=17.04.0~ce-0~ubuntu-trusty
- DOCKER_COMPOSE_VERSION=1.13.0
matrix:
- TAG=2.4 RAILS_VERSION=5.1
- TAG=2.4-slim RAILS_VERSION=5.1
- TAG=2.4-alpine RAILS_VERSION=5.1
- TAG=2.3 RAILS_VERSION=5.0
- TAG=2.3-slim RAILS_VERSION=5.0
- TAG=2.3-alpine RAILS_VERSION=5.0
- TAG=2.2 RAILS_VERSION=4.2
- TAG=2.2-slim RAILS_VERSION=4.2
- TAG=2.2-alpine RAILS_VERSION=4.2
# http://graysonkoonce.com/managing-docker-and-docker-compose-versions-on-travis-ci/
before_install:
# list docker-engine versions
- apt-cache madison docker-engine
# upgrade docker-engine to specific version
- sudo apt-get -o Dpkg::Options::="--force-confnew" install -y docker-engine=${DOCKER_VERSION}
# reinstall docker-compose at specific version
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
- docker version
- docker-compose version
script:
- docker build -f ${TAG}.dockerfile -t krismichalski/rails:${TAG} .
- cd test
- sed -i "s/latest/${TAG}/g" docker-compose.yml
- export TRAVIS_USER_ID=$(id -u)
- export TRAVIS_RAILS_VERSION=\~\>$RAILS_VERSION.0
- docker-compose -p example up
- docker logs example_app_1 | grep 'Bundle complete!'
- docker logs example_app_1 | grep "Using rails $RAILS_VERSION"
- ls db | grep '.sqlite3'
- docker-compose run app gem install pg
- docker-compose run app gem install mysql2