related to previous stackoverflow
I followed the steps where I prefixed the authorized key with a run to a ruby script that creates the repo. The script successfully creates a repo, but the git-receive-pack sending of code fails to unload properly. the repo is owned by the same user doing the push.
fatal: ''/path/to/my/repo'' does not appear to be a git repository
Also as another symptom my ssh session automatically closes with a command prefix in place. As soon as I remove the command, it pushes without issue.
For our build system this would be a nice feature to have, so looking for any insight on the behavior.
script for example
require 'git'
require 'fileutils'
require 'mixlib/shellout'
var = ENV['SSH_ORIGINAL_COMMAND']
def process_request(var)
path = var.split[1].gsub("'", '')
unless File.exist?(path)
FileUtils.mkdir_p(File.dirname(path))
Git.init(path, bare: true)
end
command = Mixlib::ShellOut.new(var)
command.run_command
end
process_request(var) if var.to_s.include?('git-receive-pack')