Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Can anyone with experience on this share what are their preferred (http) Go deployment option?


If you're using Puppet and like upstart, check out geetarista's go deployment workflow, simple and straight forward.

Locally compile go binary for target platform, upload to S3 (with a makefile + s3cmd), puppet runs, downloads version from s3 with shell script, unpacks, puts in bin, upstart starts and keeps service running.

https://github.com/geetarista/go-boilerplate

https://github.com/geetarista/puppet-go-boilerplate


So far, copy the binary to the server, add it as a service in upstart, and start the service.

When updating the application, copy the binary to the server and restart the service.


Could you share an example upstart configuration?


Sorry for the self-plug: https://coderwall.com/p/iekaog. Too big to post here.


Saves me the trouble ^^

I actually think i got the inspiration for mine from that post.


Thanks, very handy.


See the upstart documentation for examples. There are no special requirements for running a Go program with upstart.


I would recommend Supervisord (http://supervisord.org/).

To update app: Copy new binary, "supervisorctl restart myapp", done.

This will probably result in dropped requests if you aren't using a reverse proxy or load balancer in the middle.


Another Go article currently also on the front page uses heroku as the deployment platform:

Build, test and deploy a Go application to Heroku (https://news.ycombinator.com/item?id=6294921)


I have a git repository on the server & push to that repository. On the server, I just pull, compile the binary and use upstart (service xyz restart) to restart the binary. Not nice, because I kill all connections. I'll switch to something more elaborate when I'll have more users on the web service.


If you're interested in zero down time for a go service, then check out goagain [1], inspired by Unicorn. It uses simple fd passing to restart itself, passing the listening socket.

[1]: https://github.com/rcrowley/goagain


Thanks for the pointer! I remember seeing this, but I forgot about it. Glad to have it back.


For simple stuff I've been doing `nohub ./go-binary &`


Small typo, I guess it should read nohup.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: