summaryrefslogtreecommitdiff
path: root/lib/gitlab_shell.rb
diff options
context:
space:
mode:
authorKim "BKC" Carlbäcker <kim.carlbacker@gmail.com>2017-06-26 17:36:15 +0200
committerKim "BKC" Carlbäcker <kim.carlbacker@gmail.com>2017-07-03 19:12:05 +0200
commit799417a3f59b5b6e2923016c6fa3ecf1f84851bb (patch)
tree3c703ebd078f4bd6be231ccacd6ebb7452f79d07 /lib/gitlab_shell.rb
parent4539a066ecd2c5a16cab66f9e85f8f0ab747fc5f (diff)
downloadgitlab-shell-799417a3f59b5b6e2923016c6fa3ecf1f84851bb.tar.gz
- Update gitaly vendoring
- Wire up gitaly-*-pack to Gitaly. Don't pass git-*-pack to go - Disable tests for go1.5 & 1.6
Diffstat (limited to 'lib/gitlab_shell.rb')
-rw-r--r--lib/gitlab_shell.rb15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/gitlab_shell.rb b/lib/gitlab_shell.rb
index e7d0254..f3981fb 100644
--- a/lib/gitlab_shell.rb
+++ b/lib/gitlab_shell.rb
@@ -17,7 +17,7 @@ class GitlabShell
API_COMMANDS = %w(2fa_recovery_codes)
GL_PROTOCOL = 'ssh'.freeze
- attr_accessor :key_id, :gl_repository, :repo_name, :command, :git_access
+ attr_accessor :key_id, :gl_repository, :repo_name, :command, :git_access, :repository, :gitaly_address
attr_reader :repo_path
def initialize(key_id)
@@ -99,6 +99,7 @@ class GitlabShell
self.repo_path = status.repository_path
@gl_repository = status.gl_repository
+ @gitaly = status.gitaly
end
def process_cmd(args)
@@ -115,15 +116,16 @@ class GitlabShell
executable = @command
args = [repo_path]
- if GITALY_MIGRATED_COMMANDS.has_key?(executable)
+ if GITALY_MIGRATED_COMMANDS.has_key?(executable) && @gitaly
executable = GITALY_MIGRATED_COMMANDS[executable]
- gitaly_address = '' # would be returned by gitlab-rails internal API
+ gitaly_address = @gitaly['address']
# The entire gitaly_request hash should be built in gitlab-ce and passed
# on as-is. For now we build a fake one on the spot.
gitaly_request = JSON.dump({
- 'repository' => { 'path' => repo_path },
+ 'repository' => @gitaly['repository'],
+ 'gl_repository' => @gl_repository,
'gl_id' => @key_id,
})
@@ -153,6 +155,11 @@ class GitlabShell
'GL_PROTOCOL' => GL_PROTOCOL,
'GL_REPOSITORY' => @gl_repository
}
+ if @gitaly && @gitaly.has?('token')
+ env.merge!({
+ 'GITALY_TOKEN' => @gitaly['token']
+ })
+ end
if git_trace_available?
env.merge!({