platanus / potassium

A Rails application generator by Platanus, inspired by Suspenders
MIT License
232 stars 17 forks source link

Using bundler >=2 breaks CI #204

Closed llekn closed 5 years ago

llekn commented 5 years ago

Newly created projects use bundler 2.0.1 in their Gemfile which breaks the CI with the following error:

You must use Bundler 2 or greater with this lockfile
llekn commented 5 years ago

It can be fixed modifying the docker-ci files:

Dockerfile.ci:

FROM platanus/ruby:2.5

RUN gem install bundler --version 2.0.1

RUN mkdir /app
WORKDIR /app

ADD . /app

docker-compose.ci.yml:

---
version: '3.4'
services:
  test:
    build:
      context: "."
      dockerfile: Dockerfile.ci
    volumes:
    - "test_data:/usr/local/bundle"
    environment:
      RACK_ENV: test
      DB_USER: postgres
      DB_HOST: postgresql
      DB_PORT: '5432'
    links:
    - postgresql
  postgresql:
    image: postgres:11.3
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: ''
volumes:
  test_data:
difernandez commented 5 years ago

After applying those changes another error ocurred with webpacker

The git source git://github.com/rails/webpacker.git is not yet checked out. Please run 'bundle install' before trying to start your application

It was solved by removing the , github: 'rails/webpacker' from gem 'webpacker' in the Gemfile

difernandez commented 5 years ago

Another problem: webpacker wasn't installed from the beginning due to a package being incompatible with node version 9:

image

Maybe we should ad a .node-version file in the recipe

difernandez commented 5 years ago

The last two comments were extracted to a separate issue: #217

difernandez commented 5 years ago

@blackjid this should be solved with platanus/docker-ruby#2. I tested it in a project with bundler 2 (and removing the fix it had) and CI ran without any problems, I'm closing it.