Explicitly remove relative_url.rb file

Since version 9.3.0, we are not using relative_url.rb file for
configuring relative URLs, but an env variable. However, this caused the
issue of stale relative_url.rb files in a specific scenario. When
someone used relative URLs before version 9.3.0, upgraded to 9.3.0 and
then removed the usage of relative url. In that case, the
relative_url.rb will present, causing this issue. This commit explicitly
removes those remnants from previous versions.
This commit is contained in:
Balasankar "Balu" C 2018-02-26 14:23:07 +05:30
parent ef70511f40
commit 88de20f187
1 changed files with 10 additions and 0 deletions

View File

@ -315,6 +315,16 @@ rails_env = {
'RAILS_ENV' => node['gitlab']['gitlab-rails']['environment'],
}
# Explicitly deleting relative_urls.rb file and link that was used prior to
# version 9.3.0
link File.join(gitlab_rails_source_dir, "config/initializers/relative_url.rb") do
action :delete
end
file File.join(gitlab_rails_etc_dir, "relative_url.rb") do
action :delete
end
gitlab_relative_url = node['gitlab']['gitlab-rails']['gitlab_relative_url']
rails_env['RAILS_RELATIVE_URL_ROOT'] = gitlab_relative_url if gitlab_relative_url