Skip to content

Commit dd9cb01

Browse files
spike01despo
authored andcommitted
Modify Dockerfile & .travis.yml to run docker-compose in CI
1 parent ea4a306 commit dd9cb01

File tree

3 files changed

+22
-6
lines changed

3 files changed

+22
-6
lines changed

.dockerignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.git*
2+
log/*
3+
tmp/*
4+
Dockerfile

.travis.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
language: ruby
2-
bundler_args: --without development
1+
services:
2+
- docker
3+
install: true
34
script:
4-
- bundle exec rake db:create
5-
- bundle exec rake db:schema:load
6-
- bundle exec rspec
5+
- docker-compose build
6+
- docker-compose run web bundle exec rake db:create db:schema:load
7+
- docker-compose run web bundle exec rspec
78
addons:
89
code_climate:
910
repo_token: 9b6a47d42b4a745a38818eac18dba4ca94ea88f8c7751859ec49b8cedbf010fe

Dockerfile

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
FROM ruby:2.3.3
2-
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
2+
# Default node version on apt is old. This makes sure a recent version is installed
3+
# This step also runs apt-get update
4+
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
5+
RUN apt-get install -y build-essential libpq-dev nodejs
6+
# Install PhantomJS for tests - see https://blog.codeship.com/testing-rails-application-docker/
7+
ENV PHANTOMJS_VERSION=2.1.1
8+
RUN \
9+
cd /usr/local/share && \
10+
wget -nv https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-${PHANTOMJS_VERSION}-linux-x86_64.tar.bz2 && \
11+
tar xvf phantomjs-${PHANTOMJS_VERSION}-linux-x86_64.tar.bz2 && \
12+
rm phantomjs-${PHANTOMJS_VERSION}-linux-x86_64.tar.bz2 && \
13+
ln -s /usr/local/share/phantomjs-${PHANTOMJS_VERSION}-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs
314
RUN mkdir /planner
415
WORKDIR /planner
516
ADD Gemfile /planner/Gemfile

0 commit comments

Comments
 (0)