diff --git a/.circleci/config.yml b/.circleci/config.yml index 026bb87..0105e27 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,18 +4,18 @@ version: 2.1 orbs: - ruby: circleci/ruby@2.2.1 + ruby: circleci/ruby@1.1.1 jobs: build: docker: - - image: cimg/ruby:3.3.5-browsers + - image: circleci/ruby:3.0.0-node-browsers environment: - RACK_ENV=test - RAILS_ENV=test - DATABASE_URL=postgres://testuser:testpass@127.0.0.1:5432/mahbucket_test - SKIP_AUTH=true - - image: cimg/postgres:10.20 + - image: circleci/postgres:10-alpine-ram environment: - POSTGRES_USER=testuser - POSTGRES_PASSWORD=testpass diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..92a3c7d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +# This Dockerfile uses a circleci image for convenience. + +FROM circleci/ruby:3.0.0-node-browsers + +USER root +RUN mkdir /app +WORKDIR /app + +# As this is a dev container we are keeping the installation of app +# dependencies (via bundle and yarn), and the mounting of the source +# code external to the container build +#ENV PATH="/usr/local/lib/ruby/gems/bin:${PATH}" +RUN mkdir /bundle +ENV BUNDLE_PATH=/bundle +ENV GEM_HOME=/bundle +RUN bundle config set path '/bundle' + +RUN mkdir -p /tmp/sockets + +CMD bundle check || bundle install && bundle exec puma -C ./config/puma.rb diff --git a/Gemfile b/Gemfile index 34be5c3..25714df 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,4 @@ -ruby "3.3.5" +ruby "3.0.0" source 'https://rubygems.org' do gem 'rails', '~> 6.1.7' @@ -80,5 +80,6 @@ source 'https://rubygems.org' do gem 'rspec' gem 'rspec_junit_formatter' gem 'selenium-webdriver' + gem 'webdrivers', '~> 4.4' end end diff --git a/Gemfile.lock b/Gemfile.lock index 41a8d0a..436f4c7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -72,8 +72,8 @@ GEM zeitwerk (~> 2.3) acts-as-taggable-on (9.0.1) activerecord (>= 6.0, < 7.1) - addressable (2.8.7) - public_suffix (>= 2.0.2, < 7.0) + addressable (2.8.1) + public_suffix (>= 2.0.2, < 6.0) ast (2.4.2) aws-eventstream (1.2.0) aws-partitions (1.720.0) @@ -91,17 +91,16 @@ GEM aws-sigv4 (~> 1.4) aws-sigv4 (1.5.2) aws-eventstream (~> 1, >= 1.0.2) - base64 (0.2.0) brakeman (5.4.1) builder (3.2.4) bundler-audit (0.9.1) bundler (>= 1.2.0, < 3) thor (~> 1.0) - capybara (3.40.0) + capybara (3.38.0) addressable matrix mini_mime (>= 0.1.3) - nokogiri (~> 1.11) + nokogiri (~> 1.8) rack (>= 1.6.0) rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) @@ -172,7 +171,6 @@ GEM listen (3.8.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - logger (1.6.1) loofah (2.21.3) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -187,8 +185,8 @@ GEM mime-types (3.4.1) mime-types-data (~> 3.2015) mime-types-data (3.2023.0218.1) - mini_mime (1.1.5) - mini_portile2 (2.8.8) + mini_mime (1.1.2) + mini_portile2 (2.8.5) minitest (5.18.1) multi_xml (0.6.0) net-imap (0.3.6) @@ -202,10 +200,10 @@ GEM net-protocol newrelic_rpm (9.0.0) nio4r (2.7.3) - nokogiri (1.16.7) + nokogiri (1.16.2) mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.16.7-x86_64-linux) + nokogiri (1.16.2-x86_64-linux) racc (~> 1.4) oauth2 (2.0.9) faraday (>= 0.17.3, < 3.0) @@ -238,11 +236,11 @@ GEM method_source (~> 1.0) pry-rails (0.3.9) pry (>= 0.10.4) - public_suffix (6.0.1) + public_suffix (5.0.1) puma (5.6.9) nio4r (~> 2.0) - racc (1.8.1) - rack (2.2.10) + racc (1.7.3) + rack (2.2.7) rack-protection (3.0.5) rack rack-test (2.1.0) @@ -285,9 +283,9 @@ GEM rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) - regexp_parser (2.9.3) + regexp_parser (2.7.0) repost (0.4.1) - rexml (3.3.9) + rexml (3.2.5) rspec (3.12.0) rspec-core (~> 3.12.0) rspec-expectations (~> 3.12.0) @@ -350,9 +348,7 @@ GEM sprockets (> 3.0) sprockets-rails tilt - selenium-webdriver (4.27.0) - base64 (~> 0.2) - logger (~> 1.4) + selenium-webdriver (4.8.1) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) @@ -391,7 +387,11 @@ GEM execjs (>= 0.3.0, < 3) unicode-display_width (2.4.2) version_gem (1.1.1) - websocket (1.2.11) + webdrivers (4.7.0) + nokogiri (~> 1.6) + rubyzip (>= 1.3.0) + selenium-webdriver (> 3.141, < 5.0) + websocket (1.2.9) websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) @@ -442,9 +442,10 @@ DEPENDENCIES sentry-ruby! turbolinks! uglifier! + webdrivers (~> 4.4)! RUBY VERSION - ruby 3.3.5p100 + ruby 3.0.0p0 BUNDLED WITH - 2.5.23 + 2.2.17 diff --git a/README.md b/README.md index 88be9c6..409601c 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ should hopefully be useful (or at least usable) for other file types too. ## Ruby and Rails versions Mah Bucket was initially developed using Ruby 2.3.1 and Rails 5.0.1, and is -currently using Ruby 3.3.5 and Rails ~>6.1.7 - so it should have a fairly wide +currently using Ruby 2.7.1 and Rails 6.0.3 - so it should have a fairly wide compatibility range. If you find a version of either that it won't run with, please let me know. diff --git a/docker-compose.yml b/docker-compose.yml index a71d3dc..87a5aac 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ version: '3' x-service-fragments: ##### Abstract services for common setup ##### app: &app - image: cimg/ruby:3.3.5-browsers + image: ruby networks: - default volumes: @@ -19,7 +19,7 @@ x-service-fragments: services: ##### Concrete services ##### postgres: - image: 'cimg/postgres:10.20' + image: 'postgres:9.6-alpine' environment: # The Postgres image uses these to create a db user - note the user/pass here should match that in your env file! - POSTGRES_USER=user @@ -30,9 +30,9 @@ services: web: <<: *app - volumes: - - '.:/usr/src/app:cached' - working_dir: /usr/src/app + build: + dockerfile: Dockerfile + context: . ports: # Use a default port of 3005, but allow it to be overriden by an env variable # E.g. `PORT=3001 docker-compose up` @@ -49,6 +49,7 @@ services: - SKIP_AUTH=true command: sh -c 'bundle check || bundle install && rm -f /tmp/.X99-lock && bundle exec rails db:create db:environment:set db:schema:load && bundle exec rubocop && bundle exec rspec && bundle exec puma -C ./config/puma.rb' + volumes: postgres: bundle_cache: