diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4ba5ee4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ + +#FROM ruby:2.5.1 +FROM ruby:2.3 +RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs + +# Install RMagick +# RUN apt-get install -y libmagickwand-dev imagemagick + +# Install Nokogiri +# RUN apt-get install -y zlib1g-dev + +RUN mkdir /myapp +WORKDIR /tmp +COPY Gemfile Gemfile +COPY Gemfile.lock Gemfile.lock +RUN bundle install -j 4 + +ADD . /myapp +WORKDIR /myapp diff --git a/Gemfile b/Gemfile index 12f2e88..4be1468 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,8 @@ gem 'rspec_junit_formatter', :require => false, :group => :test gem 'simplecov', :require => false, :group => :test git_source(:github) { |repo| "https://github.com/#{repo}.git" } -ruby '2.5.1' +#ruby '2.5.1' +ruby '2.3.8' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.2.0' @@ -36,6 +37,9 @@ gem 'jbuilder', '~> 2.5' # Use Capistrano for deployment # gem 'capistrano-rails', group: :development +# Use rubocop lint for code coverage report +gem 'rubocop', '~> 0.43.0' + # Reduces boot times through caching; required in config/boot.rb gem 'bootsnap', '>= 1.1.0', require: false diff --git a/README.md b/README.md index 7db80e4..e2a2573 100644 --- a/README.md +++ b/README.md @@ -22,3 +22,5 @@ Things you may want to cover: * Deployment instructions * ... + +GPullBuilder Test feature/branch3 diff --git a/database.yml b/database.yml new file mode 100644 index 0000000..9b71007 --- /dev/null +++ b/database.yml @@ -0,0 +1,13 @@ +development: &default + adapter: postgresql + encoding: unicode + database: your-project_development + pool: 5 + username: <%= ENV.fetch('DB_USERNAME', 'your-project') %> + password: <%= ENV.fetch('DB_PASSWORD', 'your-project') %> + host: <%= ENV.fetch('DB_1_PORT_5432_TCP_ADDR', 'localhost') %> + port: <%= ENV.fetch('DB_1_PORT_5432_TCP_PORT', '5432') %> + +test: &test + <<: *default + database: your-project_test diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..fa1a540 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,32 @@ +db: + image: postgres + ports: + - "5432" + +redis: + image: redis + ports: + - "6379" + +web: + build: . + command: bundle exec rails s -p 3000 -b '0.0.0.0' + volumes: + - .:/myapp + ports: + - "3000:3000" + environment: + - DB_USERNAME=postgres + - DB_PASSWORD= + links: + - db + # - redis + +# sidekiq: +# build: . +# command: bundle exec sidekiq +# links: +# - db +# - redis +# volumes: +# - .:/usr/src/service diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c641a55..68a7c00 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,3 @@ require 'simplecov' SimpleCov.start -require_relative '/var/lib/jenkins/workspace/CI_RubyOnRails/app/controllers/string_ops' +require_relative '../app/controllers/string_ops'