[Rails5] Add support of Rails5
We are migrating to Rails 5.
Until we're done, we have to support both versions of rails for GitLab.
To run GitLab on rails5, we should set environment variables:
BUNDLE_GEMFILE
for actions outside of rails application, e.g. bundle install
.
RAILS5
is used inside of the application.
This MR does two things:
- Adds the
Gemfile.rails5
file which just evals the originalGemfile
.
Unfortunately,bundler
does not support a setting to explicitly set what Gemfile to use. So this is a hack while migrating to new rails. - Adds the
Gemfile.rails5.lock
file to keep rails5-specific dependencies.
These both files are used in the GitLab repositories (both in CE and EE).
The current behavior:
[ blackst0ne at redhash: /projects/gitlab/gdk-ce ]% BUNDLE_GEMFILE=Gemfile.rails5 gitaly/bin/gitaly gitaly/config.toml
INFO[0000] Starting Gitaly version="Gitaly, version 0.108.0-6-g6dd7454, built 20180624.225504"
WARN[0000] git path not configured. Using default path resolution resolvedPath=/usr/bin/git
WARN[0000] git path not configured. Using default path resolution resolvedPath=/usr/bin/git
FATA[0000] load config config_path=gitaly/config.toml error="load linguist colors: exit status 1; stderr: \"\""
The new behavior:
[ blackst0ne at redhash: /projects/gitlab/gdk-ce ]% BUNDLE_GEMFILE=Gemfile.rails5 gitaly/bin/gitaly gitaly/config.toml
INFO[0000] Starting Gitaly version="Gitaly, version 0.108.0-6-g6dd7454, built 20180624.225504"
WARN[0000] git path not configured. Using default path resolution resolvedPath=/usr/bin/git
WARN[0000] git path not configured. Using default path resolution resolvedPath=/usr/bin/git
WARN[0000] spawned supervisor.args="[bundle exec bin/ruby-cd /projects/gitlab/gdk-ce /projects/gitlab/gdk-ce/gitaly/ruby/bin/gitaly-ruby 18359 /tmp/gitaly-ruby603873734/socket.0]" supervisor.name=gitaly-ruby.0 supervisor.pid=18390
WARN[0000] spawned supervisor.args="[bundle exec bin/ruby-cd /projects/gitlab/gdk-ce /projects/gitlab/gdk-ce/gitaly/ruby/bin/gitaly-ruby 18359 /tmp/gitaly-ruby603873734/socket.1]" supervisor.name=gitaly-ruby.1 supervisor.pid=18394
^CWARN[0002] exited error="signal: killed" supervisor.args="[bundle exec bin/ruby-cd /projects/gitlab/gdk-ce /projects/gitlab/gdk-ce/gitaly/ruby/bin/gitaly-ruby 18359 /tmp/gitaly-ruby603873734/socket.0]" supervisor.name=gitaly-ruby.0
WARN[0002] exited error="signal: killed" supervisor.args="[bundle exec bin/ruby-cd /projects/gitlab/gdk-ce /projects/gitlab/gdk-ce/gitaly/ruby/bin/gitaly-ruby 18359 /tmp/gitaly-ruby603873734/socket.1]" supervisor.name=gitaly-ruby.1
FATA[0002] shutting down error="received signal \"interrupt\""