# 项目编译/部署
## 项目编译
- 通过 `go build main.go` 命令可以将项目编译成一个二进制可执行文件;
- 将 可执行文件和 config,storage目录打包即生成一个构建好的项目;
- 通过 orange 命令也能快速的将项目编译并打包,通过如下命令完成
```
> window: `orange.exe build`
> linux:`orange build`
```
## 项目部署
### Supervisord部署
- 安装 Supervisord
~~~
wget https://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg
sh setuptools-0.6c11-py2.7.egg
easy_install supervisor
echo_supervisord_conf >/etc/supervisord.conf
mkdir /etc/supervisord.conf.d
~~~
- 修改配置 `/etc/supervisord.conf`
~~~
[include]
files = /etc/supervisord.conf.d/*.conf
~~~
- 新建项目配置
~~~
cd /etc/supervisord.conf.d
vim orangepkg.conf
~~~
- 配置文件
~~~
[program:orangepkg]
directory = /opt/app/orangepkg
command = /opt/app/orangepkg/orange
autostart = true
startsecs = 5
user = root
redirect_stderr = true
stdout_logfile = /var/log/supervisord/orangepkg.log
~~~