Check RUBY_VERSION file for ruby changes, restart unicorn when bundled ruby is updated.

This commit is contained in:
Marin Jankovski 2016-03-08 17:14:48 +01:00
parent 5ee66d608f
commit aca3cb2a6a
3 changed files with 11 additions and 4 deletions

View File

@ -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

View File

@ -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',

View File

@ -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