Skip to content
Snippets Groups Projects
Unverified Commit 972241bf authored by Balasankar "Balu" C's avatar Balasankar "Balu" C
Browse files

Revert "Merge branch '4583-make-gitlab-shell-go-through-workhorse' into 'master'"

This reverts commit 21ce8bc4, reversing
changes made to 4c9562b6.
parent 7a20fabf
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -49,15 +49,10 @@ end
end
end
 
gitlab_url = node['gitlab']['gitlab-rails']['internal_api_url']
# If no internal_api_url is specified, default to workhorse settings
use_socket = node['gitlab']['gitlab-workhorse']['listen_network'] == "unix"
workhorse_url = node['gitlab']['gitlab-workhorse']['listen_addr']
relative_path = Gitlab['gitlab_workhorse']['relative_url']
gitlab_url ||= use_socket ? "http+unix://#{ERB::Util.url_encode(workhorse_url)}" : "http://#{workhorse_url}#{relative_path}"
gitlab_relative_path = relative_path || '' if use_socket
# If no internal_api_url is specified, default to the IP/port Unicorn listens on
webserver_service = WebServerHelper.service_name
api_url = node['gitlab']['gitlab-rails']['internal_api_url']
api_url ||= "http://#{node['gitlab'][webserver_service]['listen']}:#{node['gitlab'][webserver_service]['port']}#{node['gitlab'][webserver_service]['relative_url']}"
 
templatesymlink "Create a config.yml and create a symlink to Rails root" do
link_from File.join(gitlab_shell_dir, "config.yml")
Loading
Loading
@@ -68,8 +63,7 @@ templatesymlink "Create a config.yml and create a symlink to Rails root" do
group git_group
variables({
user: git_user,
gitlab_url: gitlab_url,
gitlab_relative_path: gitlab_relative_path,
api_url: api_url,
authorized_keys: authorized_keys,
log_file: File.join(log_directory, "gitlab-shell.log"),
log_level: node['gitlab']['gitlab-shell']['log_level'],
Loading
Loading
Loading
Loading
@@ -6,11 +6,7 @@
user: <%= @user %>
 
# Url to gitlab instance. Used for api calls. May but need not end with a slash.
gitlab_url: "<%= @gitlab_url %>"
<% if @gitlab_relative_path %>
gitlab_relative_url_root: <%= @gitlab_relative_path %>
<% end %>
gitlab_url: "<%= @api_url %>"
 
http_settings:
<%= @http_settings.to_json if @http_settings %>
Loading
Loading
Loading
Loading
@@ -48,9 +48,7 @@ RSpec.describe 'gitlab::gitlab-shell' do
log_file: '/var/log/gitlab/gitlab-shell/gitlab-shell.log',
log_format: "json",
custom_hooks_dir: nil,
migration: { enabled: true, features: [] },
gitlab_url: 'http+unix://%2Fvar%2Fopt%2Fgitlab%2Fgitlab-workhorse%2Fsocket',
gitlab_relative_path: ''
migration: { enabled: true, features: [] }
)
)
end
Loading
Loading
@@ -172,71 +170,5 @@ RSpec.describe 'gitlab::gitlab-shell' do
)
end
end
context 'with a non-default workhorse unix socket' do
before do
stub_gitlab_rb(gitlab_workhorse: { listen_addr: '/fake/workhorse/socket' })
end
it 'create config file with provided values' do
expect(chef_run).to create_templatesymlink('Create a config.yml and create a symlink to Rails root').with_variables(
hash_including(
gitlab_url: 'http+unix://%2Ffake%2Fworkhorse%2Fsocket',
gitlab_relative_path: ''
)
)
end
end
context 'with a tcp workhorse listener' do
before do
stub_gitlab_rb(
external_url: 'http://example.com/gitlab',
gitlab_workhorse: {
listen_network: 'tcp',
listen_addr: 'localhost:1234'
}
)
end
it 'create config file with provided values' do
expect(chef_run).to create_templatesymlink('Create a config.yml and create a symlink to Rails root').with_variables(
hash_including(
gitlab_url: 'http://localhost:1234/gitlab',
gitlab_relative_path: nil
)
)
end
end
context 'with relative path in external_url' do
before do
stub_gitlab_rb(external_url: 'http://example.com/gitlab')
end
it 'create config file with provided values' do
expect(chef_run).to create_templatesymlink('Create a config.yml and create a symlink to Rails root').with_variables(
hash_including(
gitlab_url: 'http+unix://%2Fvar%2Fopt%2Fgitlab%2Fgitlab-workhorse%2Fsocket',
gitlab_relative_path: '/gitlab'
)
)
end
end
context 'with internal_api_url specified' do
before do
stub_gitlab_rb(gitlab_rails: { internal_api_url: 'http://localhost:8080' })
end
it 'create config file with provided values' do
expect(chef_run).to create_templatesymlink('Create a config.yml and create a symlink to Rails root').with_variables(
hash_including(
gitlab_url: 'http://localhost:8080',
gitlab_relative_path: ''
)
)
end
end
end
end
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