Skip to content

Commit

Permalink
Staging (#66)
Browse files Browse the repository at this point in the history
Implement staging version of the app (closes #65) ; 
Fix asset compiliation issue (closes #64);
Set website visit test with continuous integration (closes #34);
  • Loading branch information
Jetinho authored May 3, 2021
1 parent bde27d0 commit 0f0b5fd
Show file tree
Hide file tree
Showing 50 changed files with 716 additions and 197 deletions.
53 changes: 53 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Documentation here https://circleci.com/developer/orbs/orb/later/ruby-rails-setup
# Following tutorial https://thoughtbot.com/blog/circleci-2-rails

version: 2.1
orbs:
ruby: circleci/[email protected]
ruby-rails-setup: later/[email protected]

jobs:
build:
working_directory: ~/compost-lyon
docker:
- image: circleci/ruby:3.0.1-buster-node-browsers-legacy
environment:
PGHOST: localhost
PGUSER: CompostLyon
RAILS_ENV: test
RACK_ENV: test
NODE_ENV: test
- image: postgres:9.5
environment:
POSTGRES_USER: CompostLyon
POSTGRES_DB: CompostLyon_test
POSTGRES_PASSWORD: <%= ENV['COMPOSTLYON_DATABASE_PASSWORD'] %>
executor: ruby/default
steps:
- checkout
- run:
name: Configure Bundler
command: |
echo 'export BUNDLER_VERSION=$(cat Gemfile.lock | tail -1 | tr -d " ")' >> $BASH_ENV
source $BASH_ENV
gem install bundler
# Bundle install dependencies
- run: bundle install
- run: yarn install
- run: bin/rails webpacker:compile
- save_cache:
key: v1-bundle-{{ checksum "Gemfile.lock" }}-{{ checksum "yarn.lock" }}
paths:
- vendor/bundle
- public/packs-test
# Setup the database
- run: bundle exec rake db:drop RAILS_ENV=test
- run: bundle exec rake db:create RAILS_ENV=test
- run: bundle exec rake db:schema:load RAILS_ENV=test

# --- RSPEC

- run:
name: Running tests
command: bundle exec rspec
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--require spec_helper
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby-2.6.3
ruby-3.0.1
20 changes: 15 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.6.3'
ruby '3.0.1'

gem 'rexml', '~> 3.2', '>= 3.2.5'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.2', '>= 6.0.2.2'
gem 'rails', '~> 6.1', '>= 6.1.3.1'
# Use postgresql as the database for Active Record
gem 'pg', '>= 0.18', '< 2.0'
# Use Puma as the app server
Expand Down Expand Up @@ -52,13 +53,17 @@ group :development do
gem 'spring-watcher-listen', '~> 2.0.0'
end

group :development, :test do
gem 'rspec-rails', '~> 5.0.0'
gem "factory_bot_rails"
end

group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 2.15'
gem 'selenium-webdriver'
# Easy installation and use of web drivers to run system tests with browsers
gem 'webdrivers'
gem 'minitest-around'
gem 'database_cleaner-active_record'
end

Expand All @@ -69,6 +74,9 @@ gem "slim-rails"
gem 'geocoder'
gem 'rails-i18n'

# Fix issue in precompiling assets due to sassc-rails
gem 'sprockets', '3.7.2'

# Error management
gem "sentry-ruby"
gem "sentry-rails"
Expand All @@ -80,7 +88,9 @@ gem 'draper'
gem 'cancancan'

# Emailing
gem "letter_opener", :group => :development
group :development, :staging do
gem "letter_opener_web"
end

# SEO related
gem 'friendly_id'
Expand All @@ -89,4 +99,4 @@ gem "breadcrumbs_on_rails"

# Rails admin
gem 'rails_admin', '~> 2.0'
gem 'rails_admin-i18n'
gem 'rails_admin-i18n'
Loading

1 comment on commit 0f0b5fd

@Jetinho
Copy link
Owner Author

@Jetinho Jetinho commented on 0f0b5fd May 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMPORTANT : Update rails version to 6.1.3.1, and update ruby version to 3.0.1

Please sign in to comment.