Check RUBY_VERSION file for ruby changes, restart unicorn when bundled ruby is updated.
This commit is contained in:
parent
5ee66d608f
commit
aca3cb2a6a
|
@ -361,11 +361,11 @@ class RedhatHelper
|
|||
end
|
||||
end
|
||||
|
||||
class GGHSHelper
|
||||
class VersionHelper
|
||||
extend ShellOutHelper
|
||||
|
||||
def self.version
|
||||
result = do_shell_out("/opt/gitlab/embedded/bin/gitlab-workhorse --version")
|
||||
def self.version(cmd)
|
||||
result = do_shell_out(cmd)
|
||||
if result.exitstatus == 0
|
||||
result.stdout
|
||||
else
|
||||
|
|
|
@ -296,6 +296,13 @@ remote_file File.join(gitlab_rails_dir, 'VERSION') do
|
|||
end
|
||||
end
|
||||
|
||||
# If a version of ruby changes restart unicorn. If not, unicorn will fail to
|
||||
# reload until restarted
|
||||
file File.join(gitlab_rails_dir, "RUBY_VERSION") do
|
||||
content VersionHelper.version("/opt/gitlab/embedded/bin/ruby --version")
|
||||
notifies :restart, "service[unicorn]"
|
||||
end
|
||||
|
||||
# We shipped packages with 'chown -R git' below for quite some time. That chown
|
||||
# was an unnecessary leftover from the manual installation guide; it is better
|
||||
# to just leave these files owned by root. If we just remove the 'chown git',
|
||||
|
|
|
@ -53,6 +53,6 @@ runit_service 'gitlab-workhorse' do
|
|||
end
|
||||
|
||||
file File.join(working_dir, "VERSION") do
|
||||
content GGHSHelper.version
|
||||
content VersionHelper.version("/opt/gitlab/embedded/bin/gitlab-workhorse --version")
|
||||
notifies :restart, "service[gitlab-workhorse]"
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue