Overhaul the environment system in bin/ to make the defaults easier to understand. Update the installation instructions.

Fixes #2170, #2372, #2329, #2368
This commit is contained in:
Jyri-Petteri Paloposki 2020-07-19 17:20:35 +03:00
parent 3f22c8a036
commit 4d65a8f761
7 changed files with 37 additions and 25 deletions

View file

@ -1,6 +1,6 @@
#!/usr/bin/env ruby
unless ENV["RAILS_ENV"] == "production" || File.exist?("#{__dir__}/../.skip-docker")
exec("#{__dir__}/../script/docker-environment", $PROGRAM_NAME, *ARGV) unless File.exist?("/etc/app-env")
if File.exist?("#{__dir__}/../.use-docker")
exec("#{__dir__}/../script/docker-environment", $PROGRAM_NAME, *ARGV)
end
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
load Gem.bin_path('bundler', 'bundle')

View file

@ -1,6 +1,6 @@
#!/usr/bin/env ruby
unless ENV["RAILS_ENV"] == "production" || File.exist?("#{__dir__}/../.skip-docker")
exec("#{__dir__}/../script/docker-environment", $PROGRAM_NAME, *ARGV) unless File.exist?("/etc/app-env")
if File.exist?("#{__dir__}/../.use-docker")
exec("#{__dir__}/../script/docker-environment", $PROGRAM_NAME, *ARGV)
end
APP_PATH = File.expand_path('../config/application', __dir__)

View file

@ -1,6 +1,6 @@
#!/usr/bin/env ruby
unless ENV["RAILS_ENV"] == "production" || File.exist?("#{__dir__}/../.skip-docker")
exec("#{__dir__}/../script/docker-environment", $PROGRAM_NAME, *ARGV) unless File.exist?("/etc/app-env")
if File.exist?("#{__dir__}/../.use-docker")
exec("#{__dir__}/../script/docker-environment", $PROGRAM_NAME, *ARGV)
end
require_relative '../config/boot'
require 'rake'

View file

@ -1,6 +1,6 @@
#!/usr/bin/env ruby
unless ENV["RAILS_ENV"] == "production" || File.exist?("#{__dir__}/../.skip-docker")
exec("#{__dir__}/../script/docker-environment", $PROGRAM_NAME, *ARGV) unless File.exist?("/etc/app-env")
if File.exist?("#{__dir__}/../.use-docker")
exec("#{__dir__}/../script/docker-environment", $PROGRAM_NAME, *ARGV)
end
# This file loads spring without using Bundler, in order to be fast