Commit 2116bb0c authored by Stan Hu's avatar Stan Hu

Merge branch 'ak/fix-loading-file' into 'master'

Fix relative path not found on production web server

See merge request gitlab-org/gitlab!47090
parents 2b78fc45 2a5b43c4
---
title: Fix relative path not found on production web server
merge_request: 47090
author:
type: fixed
......@@ -106,7 +106,7 @@ module Gitlab
end
def get_file(path)
File.read(path)
File.read(Rails.root.join(path).to_s)
end
def registration_token
......
......@@ -75,6 +75,13 @@ RSpec.describe Gitlab::Ci::RunnerInstructions do
with_them do
let(:params) { { os: os, arch: arch } }
around do |example|
# puma in production does not run from Rails.root, ensure file loading does not assume this
Dir.chdir(Rails.root.join('tmp').to_s) do
example.run
end
end
it 'returns string containing correct params' do
result = subject.install_script
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment