代码改变世界

Go Web开发之Revel - 部署

2013-01-09 16:17  Danny.tian  阅读(2073)  评论(0编辑  收藏  举报

SCP

Revel应用程序可以被部署到没有安装Go功能的机器上. 命令行工具 提供了 package 命令,它可以编译和打包应用程序并附带一个运行它的脚本.

一个典型的部署看起来像下面这样:

# Run and test my app.
$ revel run import/path/to/app
.. test app ..

# Package it up.
$ revel package import/path/to/app
Your archive is ready: app.zip

# Copy to the target machine.
$ scp app.zip target:/srv/

# Run it on the target machine.
$ ssh target
$ cd /srv/
$ ./run.sh

开发区域:

  • 交叉编译 (e.g. 在OSX上开发, 在Linux上部署).

Heroku

jamesward 做了一个Revel的打包工具Heroku. 他也写了一篇blog a blog post about getting a sample app up and running on Heroku.