将 Gollum wiki 部署到 Heroku
Gollum 是“一个简单的、由 Git 驱动的 wiki,具有出色的 API 和本地前端。”
它托管在 GitHub 上: http://github.com/github/gollum
它似乎是一个简单的 Sinatra app,因此,看起来应该很容易部署到 Heroku。我似乎无法让它发挥作用。主要是因为我对 Rake 和 config.ru 文件几乎一无所知。
是否有可能将 Gollum wiki 部署到 Heroku?如果是这样,我的 config.ru 文件需要是什么样子?
更新/编辑
lib/gollum/frontend/app:
module Precious
class App < Sinatra::Base
这从 bin/gollum 调用
require 'gollum/frontend/app'
Precious::App.set(:gollum_path, gollum_path)
Precious::App.run!(options)
Gollum is "A simple, Git-powered wiki with a sweet API and local frontend."
It's hosted on GitHub: http://github.com/github/gollum
It seems to be a simple Sinatra app, and as such, it seems like it should be easy to deploy to Heroku. I can't seem to get it to work. Mostly because I know next to nothing about Rake and config.ru files.
Is it even possible to deploy a Gollum wiki to Heroku? If so, what would my config.ru file need to look like?
Update/Edit
lib/gollum/frontend/app:
module Precious
class App < Sinatra::Base
This gets called from bin/gollum
require 'gollum/frontend/app'
Precious::App.set(:gollum_path, gollum_path)
Precious::App.run!(options)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
不可能从heroku 运行Gollum。当然不是作为一个可编辑的维基。 Heroku 文件系统是只读的。您也许可以使用它来提供静态内容,但我对此也不确定。
It's not possible to run Gollum from heroku. Certainly not as an editable wiki. The Heroku filesystem is read only. You might be able to use it to serve static content, but I'm not sure about that even.
正如已经提到的,问题在于 heroku 文件系统是只读的。
但真正的问题是底层的勇气,它依赖于 git 命令行工具。如果不将远程存储库克隆到本地目录,则无法使用它们。
请参阅相关的问题。
因此,解决方案是将存储库克隆到临时路径,在那里工作并将更改推送到远程存储库。开销很大:每次用户浏览 wiki 页面时都需要克隆存储库。
我想到的另一个解决方案是为 grit 制作一些 API,以便能够远程使用 git。
另一种解决方案是通过 ssh 使用 git。
As already mentioned, the problem is that the heroku filesystem is readonly.
But the real problem is underlying grit, which relies on the git command line tool. You can't work with remote repositories without cloning them to the local directory.
See the related question.
So, the solution will be to clone the repo to temporary path, work there and push changes to the remote repo. There is a much overhead: you need to clone repo every time a user browse a wiki page.
Another solution that comes to mind is making some API for grit that will enable to work with git remotely.
Yet another solution is to work with git over ssh.
http://docs.heroku.com/rack#sinatra
如果它是 sinatra 应用程序,则应该为你做。
http://docs.heroku.com/rack#sinatra
if it is a sinatra app, that should do it for you.