Skip to content

Commit 654101f

Browse files
authored
Merge pull request #29 from jrjoacir/fix/build-containers
Correct build containers add 'bundle exec' ruby commands in docker-co…
2 parents ac9b1ff + c9cdd4b commit 654101f

File tree

7 files changed

+21
-13
lines changed

7 files changed

+21
-13
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ install:
66
- docker-compose up test
77

88
script:
9-
- docker-compose run --rm test rspec
10-
- docker-compose run --rm test rubocop
9+
- docker-compose run --rm test bundle exec rspec
10+
- docker-compose run --rm test bundle exec rubocop
1111
- docker-compose rm -f

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ Here you can know about project evolution.
33

44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
55

6+
## Unreleased
7+
### Changed
8+
- Added **bundle exec** ruby command in docker-compose.yml file in command keys
9+
- Corrected simplecov file configuration to execute require in simplecov gem
10+
- Corrected spec_helper file to execute require in simplecov configuration file
11+
- Updated README to add **bundle exec** in ruby commands
12+
613
## [2.0.0] - 2019-11-17
714
### Added
815
- Container migrate just to run migrations on test and development databases

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,13 @@ Execute all tests with following command:
127127

128128

129129
```bash
130-
docker-compose run --rm test rspec
130+
docker-compose run --rm test bundle exec rspec
131131
```
132132

133133
For execute just one file test, you can inform a file in end of command.
134134

135135
```bash
136-
docker-compose run --rm test rspec spec/services/healthcheck/get_service_spec.rb
136+
docker-compose run --rm test bundle exec rspec spec/services/healthcheck/get_service_spec.rb
137137
```
138138

139139
This project uses [Rspec](https://relishapp.com/rspec/) Ruby gem as a test tool.
@@ -149,13 +149,13 @@ docker-compose up test
149149
This project uses [Rubocop](https://www.rubocop.org) Ruby gem as a Code Analizer tool, so analize all code with following command.
150150

151151
```bash
152-
docker-compose run --rm test rubocop
152+
docker-compose run --rm test bundle exec rubocop
153153
```
154154

155155
For analize just one file, you can inform a file in end of command.
156156

157157
```bash
158-
docker-compose run --rm test rubocop app/services/healthcheck/get_service.rb
158+
docker-compose run --rm test bundle exec rubocop app/services/healthcheck/get_service.rb
159159
```
160160

161161
### Code coverage

config/simplecov.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# frozen_string_literal: true
22

3+
require 'simplecov'
4+
35
SimpleCov.start do
46
add_filter '/spec/'
57
add_filter '/config/'

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ services:
2323
- ./.env.development
2424
volumes:
2525
- .:/usr/src/app
26-
command: sh -c "rake db:migrate && puma -p 3000"
26+
command: sh -c "bundle exec rake db:migrate && bundle exec puma -p 3000"
2727

2828
test:
2929
build:
@@ -35,7 +35,7 @@ services:
3535
- ./.env.test
3636
volumes:
3737
- .:/usr/src/app
38-
command: sh -c "rake db:migrate"
38+
command: sh -c "bundle exec rake db:migrate"
3939

4040
apiblueprint:
4141
image: quay.io/bukalapak/snowboard

docker/app/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM ruby:2.6.4-alpine
22
WORKDIR /usr/src/app
33
RUN apk --no-cache add build-base postgresql-dev
44
COPY Gemfile Gemfile.lock ./
5-
RUN gem update --system
6-
RUN gem install bundler
7-
RUN bundle install
5+
RUN gem update --system \
6+
&& gem install bundler \
7+
&& bundle install
88
COPY . .

spec/spec_helper.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414
#
1515

1616
ENV['RACK_ENV'] ||= 'test'
17-
18-
require_relative "../application"
1917
require_relative '../config/simplecov'
18+
require_relative "../application"
2019
require_dir 'spec/factories'
2120

2221
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration

0 commit comments

Comments
 (0)