-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compability, Versioning and Upgrading Penthouse and Using Docker & Ci…
…rcleCI for Developer Experience (#16) This change adds the standard linter, it adds support for testing multiple ruby versions in CI
- Loading branch information
Simon
authored
Jul 21, 2020
1 parent
8b81c90
commit 721f390
Showing
42 changed files
with
405 additions
and
199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
version: 2 | ||
jobs: | ||
build: | ||
docker: | ||
- image: circleci/ruby:2.4.1 | ||
|
||
- image: circleci/postgres:9.6.2-alpine | ||
name: postgres | ||
|
||
steps: | ||
- checkout | ||
|
||
- run: bundle install | ||
- run: bundle exec standardrb | ||
- run: rm Gemfile.lock | ||
|
||
- run: RUBY_VERSION=2.4.1 RAILS_VERSION=4.2.11.1 PG_VERSION=0.21.0 bundle install | ||
- run: RUBY_VERSION=2.4.1 RAILS_VERSION=4.2.11.1 PG_VERSION=0.21.0 bundle exec rspec | ||
- run: rm Gemfile.lock | ||
|
||
- run: RUBY_VERSION=2.4.1 RAILS_VERSION=5.1.6.2 PG_VERSION=0.21.0 bundle install | ||
- run: RUBY_VERSION=2.4.1 RAILS_VERSION=5.1.6.2 PG_VERSION=0.21.0 bundle exec rspec | ||
- run: rm Gemfile.lock | ||
|
||
- run: RUBY_VERSION=2.4.1 RAILS_VERSION=5.1.7 PG_VERSION=0.21.0 bundle install | ||
- run: RUBY_VERSION=2.4.1 RAILS_VERSION=5.1.7 PG_VERSION=0.21.0 bundle exec rspec | ||
- run: rm Gemfile.lock | ||
# | ||
# | ||
# - run: RUBY_VERSION=2.4.1 RAILS_VERSION=5.2.3 PG_VERSION=1.1.4 bundle install | ||
# - run: RUBY_VERSION=2.4.1 RAILS_VERSION=5.2.3 PG_VERSION=1.1.4 bundle exec rspec | ||
# - run: rm Gemfile.lock | ||
# | ||
# Fails with `NameError: undefined method `migrate' for class `#<Class:ActiveRecord::Migrator>'` | ||
# | ||
# Uncomment when adding support for greater rails versions | ||
# | ||
# - run: RUBY_VERSION=2.4.1 RAILS_VERSION=6.0.0 PG_VERSION=0.21.0 bundle install | ||
# - run: RUBY_VERSION=2.4.1 RAILS_VERSION=6.0.0 PG_VERSION=0.21.0 bundle exec rspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Gemfile.lock |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
ARG RUBY_VERSION="2.5" | ||
|
||
FROM ruby:$RUBY_VERSION-alpine | ||
|
||
ARG RUBY_VERSION="2.5" | ||
ARG RAILS_VERSION="5.1.4" | ||
ARG PG_VERSION="1.1.4" | ||
|
||
RUN apk add --update build-base postgresql-dev tzdata git | ||
|
||
WORKDIR /app | ||
ADD ./ /app/ | ||
|
||
RUN gem install bundler -v '1.17' | ||
|
||
ENV RUBY_VERSION=$RUBY_VERSION | ||
ENV RAILS_VERSION=$RAILS_VERSION | ||
ENV PG_VERSION=$PG_VERSION | ||
|
||
RUN RUBY_VERSION=$RUBY_VERSION RAILS_VERSION=$RAILS_VERSION PG_VERSION=$PG_VERSION bundle install --jobs=4 --no-cache | ||
|
||
ENTRYPOINT ["bundle", "exec", "rspec"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
source 'https://rubygems.org' | ||
ruby '2.5.7' | ||
source "https://rubygems.org" | ||
ruby ENV.fetch("RUBY_VERSION", "2.3.0") | ||
|
||
group :test do | ||
gem "activesupport", ENV.fetch("RAILS_VERSION", "4.2.2").to_s | ||
gem "activerecord", ENV.fetch("RAILS_VERSION", "4.2.2").to_s | ||
gem "pg", ENV.fetch("PG_VERSION", "0.19.0").to_s | ||
end | ||
|
||
gemspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
test-4.2.11.1: # Test rails 4 LTS | ||
RUBY_VERSION=2.3.0 RAILS_VERSION=4.2.11.1 PG_VERSION=0.21.0 docker-compose build | ||
RUBY_VERSION=2.3.0 RAILS_VERSION=4.2.11.1 PG_VERSION=0.21.0 docker-compose run penthouse | ||
|
||
test-5.1.7: # Test rails 5 before migration context | ||
RUBY_VERSION=2.4.0 RAILS_VERSION=5.1.7 PG_VERSION=0.21.0 docker-compose build | ||
RUBY_VERSION=2.4.0 RAILS_VERSION=5.1.7 PG_VERSION=0.21.0 docker-compose run penthouse | ||
|
||
test-5.2.3: # Test rails 5 with migration context | ||
RUBY_VERSION=2.5.0 RAILS_VERSION=5.2.3 PG_VERSION=1.1.4 docker-compose build | ||
RUBY_VERSION=2.5.0 RAILS_VERSION=5.2.3 PG_VERSION=1.1.4 docker-compose run penthouse | ||
|
||
test-6.0.0: # Test rails 6 | ||
RUBY_VERSION=2.6.0 RAILS_VERSION=6.0.0 PG_VERSION=1.1.4 docker-compose build | ||
RUBY_VERSION=2.6.0 RAILS_VERSION=6.0.0 PG_VERSION=1.1.4 docker-compose run penthouse | ||
|
||
test: | ||
make test-4.2.11.1 | ||
make test-5.1.7 | ||
make test-5.2.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
version: '3.5' | ||
|
||
services: | ||
postgres: | ||
image: postgres:10.5-alpine | ||
ports: | ||
- 5432 | ||
networks: | ||
penthouse: | ||
default: | ||
|
||
penthouse: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.test | ||
args: | ||
RUBY_VERSION: ${RUBY_VERSION:-2.5.0} | ||
RAILS_VERSION: ${RAILS_VERSION:-5.1.7} | ||
PG_VERSION: ${PG_VERSION:-1.1.4} | ||
RAILS_ENV: test | ||
networks: | ||
penthouse: | ||
default: | ||
depends_on: | ||
- postgres | ||
|
||
networks: | ||
penthouse: | ||
driver: bridge | ||
name: penthouse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.