Skip to content
Snippets Groups Projects
Commit ebdf0f17 authored by Balasankar C's avatar Balasankar C
Browse files

Merge branch 'sh-restart-gitaly-on-ruby-version-change' into 'master'

Restart Gitaly when Ruby version changes

See merge request gitlab-org/omnibus-gitlab!4696
parents 6f031635 9cbce97f
No related branches found
No related tags found
No related merge requests found
---
title: Restart Gitaly when Ruby version changes
merge_request: 4696
author:
type: fixed
Loading
Loading
@@ -116,6 +116,13 @@ version_file 'Create version file for Gitaly' do
notifies :hup, "runit_service[gitaly]"
end
 
# If a version of ruby changes restart gitaly-ruby
version_file 'Create Ruby version file for Gitaly' do
version_file_path File.join(working_dir, 'RUBY_VERSION')
version_check_cmd '/opt/gitlab/embedded/bin/ruby --version'
notifies :hup, "runit_service[gitaly]"
end
consul_service 'gitaly' do
action Prometheus.service_discovery_action
socket_address node['gitaly']['prometheus_listen_addr']
Loading
Loading
Loading
Loading
@@ -77,6 +77,15 @@ RSpec.describe 'gitaly' do
expect(chef_run.version_file('Create version file for Gitaly')).to notify('runit_service[gitaly]').to(:hup)
end
 
it 'creates a default RUBY_VERSION file and restarts service' do
expect(chef_run).to create_version_file('Create Ruby version file for Gitaly').with(
version_file_path: '/var/opt/gitlab/gitaly/RUBY_VERSION',
version_check_cmd: '/opt/gitlab/embedded/bin/ruby --version'
)
expect(chef_run.version_file('Create Ruby version file for Gitaly')).to notify('runit_service[gitaly]').to(:hup)
end
it 'populates gitaly config.toml with defaults' do
expect(chef_run).to render_file(config_path).with_content { |content|
expect(content).to include("socket_path = '/var/opt/gitlab/gitaly/gitaly.socket'")
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment