summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorJasper Maes <jaspermaes.jm@gmail.com>2018-12-07 19:15:06 +0100
committerJasper Maes <jaspermaes.jm@gmail.com>2018-12-14 19:36:22 +0100
commit44fef4fe4cb9d4f30f129ff5a548395bc924c8fe (patch)
treeac5e97a16658edfb25b8407f1cf2d9a11c172667 /bin
parenteafc8e2f481751b973260287c844b70bd408dcb2 (diff)
downloadgitlab-ce-44fef4fe4cb9d4f30f129ff5a548395bc924c8fe.tar.gz
Remove rails 4 support in CI, Gemfiles, bin/ and config/
Diffstat (limited to 'bin')
-rwxr-xr-xbin/rails10
-rwxr-xr-xbin/rake10
-rwxr-xr-xbin/rspec5
-rwxr-xr-xbin/setup42
4 files changed, 7 insertions, 60 deletions
diff --git a/bin/rails b/bin/rails
index d21b64b3007..07396602377 100755
--- a/bin/rails
+++ b/bin/rails
@@ -1,14 +1,4 @@
#!/usr/bin/env ruby
-
-# Remove this block when upgraded to rails 5.0.
-if %w[0 false].include?(ENV["RAILS5"])
- begin
- load File.expand_path('../spring', __FILE__)
- rescue LoadError => e
- raise unless e.message.include?('spring')
- end
-end
-
APP_PATH = File.expand_path('../config/application', __dir__)
require_relative '../config/boot'
require 'rails/commands'
diff --git a/bin/rake b/bin/rake
index 1362d51e3d6..17240489f64 100755
--- a/bin/rake
+++ b/bin/rake
@@ -1,14 +1,4 @@
#!/usr/bin/env ruby
-
-# Remove this block when upgraded to rails 5.0.
-if %w[0 false].include?(ENV["RAILS5"])
- begin
- load File.expand_path('../spring', __FILE__)
- rescue LoadError => e
- raise unless e.message.include?('spring')
- end
-end
-
require_relative '../config/boot'
require 'rake'
Rake.application.run
diff --git a/bin/rspec b/bin/rspec
index b0770e30a70..4236753c9c1 100755
--- a/bin/rspec
+++ b/bin/rspec
@@ -1,10 +1,5 @@
#!/usr/bin/env ruby
-# Remove these two lines below when upgraded to rails 5.0.
-# Allow run `rspec` command as `RAILS5=1 rspec ...` instead of `BUNDLE_GEMFILE=Gemfile.rails5 rspec ...`
-gemfile = %w[0 false].include?(ENV["RAILS5"]) ? "Gemfile.rails4" : "Gemfile"
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../#{gemfile}", __dir__)
-
begin
load File.expand_path('../spring', __FILE__)
rescue LoadError => e
diff --git a/bin/setup b/bin/setup
index 34bb667087a..883825bc0a2 100755
--- a/bin/setup
+++ b/bin/setup
@@ -1,18 +1,12 @@
#!/usr/bin/env ruby
-def rails5?
- !%w[0 false].include?(ENV["RAILS5"])
-end
-
require "pathname"
# path to your application root.
APP_ROOT = Pathname.new File.expand_path("../../", __FILE__)
-if rails5?
- def system!(*args)
- system(*args) || abort("\n== Command #{args} failed ==")
- end
+def system!(*args)
+ system(*args) || abort("\n== Command #{args} failed ==")
end
Dir.chdir APP_ROOT do
@@ -20,14 +14,8 @@ Dir.chdir APP_ROOT do
# Add necessary setup steps to this file:
puts "== Installing dependencies =="
-
- if rails5?
- system! "gem install bundler --conservative"
- system("bundle check") || system!("bundle install")
- else
- system "gem install bundler --conservative"
- system "bundle check || bundle install"
- end
+ system! "gem install bundler --conservative"
+ system("bundle check") || system!("bundle install")
# puts "\n== Copying sample files =="
# unless File.exist?("config/database.yml")
@@ -35,27 +23,11 @@ Dir.chdir APP_ROOT do
# end
puts "\n== Preparing database =="
-
- if rails5?
- system! "bin/rails db:setup"
- else
- system "bin/rake db:reset"
- end
+ system! "bin/rails db:setup"
puts "\n== Removing old logs and tempfiles =="
-
- if rails5?
- system! "bin/rails log:clear tmp:clear"
- else
- system "rm -f log/*"
- system "rm -rf tmp/cache"
- end
+ system! "bin/rails log:clear tmp:clear"
puts "\n== Restarting application server =="
-
- if rails5?
- system! "bin/rails restart"
- else
- system "touch tmp/restart.txt"
- end
+ system! "bin/rails restart"
end