Commit 2a5b43c4 authored by Adrien Kohlbecker's avatar Adrien Kohlbecker Committed by Stan Hu

Fix relative path not found on production web server

parent 059e0397
---
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