I’m implemented the “Github Hook” redmine plugin. It’s supposed to
execute a git command on my server via Open3.popen3 using this method:
def exec(command)
logger.info “GithubHook: Executing command: ‘#{command}’”
stdin, stdout, stderr = Open3.popen3(command)
output = stdout.readlines.collect(&:strip)
errors = stderr.readlines.collect(&:strip)
logger.info “GithubHook: Output from git:”
logger.info “GithubHook: * STDOUT: #{output}”
logger.info “GithubHook: * STDERR: #{output}”
end
However, the command doesn’t execute. It does what it’s supposed to do
when I execute it manually. Here’s the response from the log messages:
GithubHook: Executing command: ‘cd ‘/home/me/repositories/app/.git/’ &&
git fetch origin && git reset --soft refs/remotes/origin/master’
GithubHook: Output from git:
GithubHook: * STDOUT:
GithubHook: * STDERR:
I’ve never worked with Open3.popen3 before. What about my environment
(an ubuntu Hardy slice host box) might be preventing execution.
Thanks in advance!
Peter