

Build, test and deploy a Go application to Heroku - thibaut_barrere
http://blog.wercker.com/2013/07/10/deploying-golang-to-heroku.html

======
pearkes
If you're like me and make golang apps with private packages on GitHub, you're
going to have a bad time deploying to Heroku.

This is because the heroku buildpack for go has to `go get
github.com/user/private-repo` the necessary packages. Public repos work fine
for this, but private repos need credentials. There's a few reasons this isn't
easy on Heroku.

I ended up working around it[1] but am still not happy with the security
implications.

[1] [https://github.com/kr/heroku-buildpack-
go/issues/17#issuecom...](https://github.com/kr/heroku-buildpack-
go/issues/17#issuecomment-21213899)

~~~
pjvds
This is an interesting scenario. I've resolved this by running the entire
build pipeline on wercker and only deploy the binary on Heroku by using the
null buildpack. I'll write up a post on this in the coming days.

~~~
miesie
btw you can find the Heroku null buildpack to launch binaries on Heroku here:

[https://github.com/ryandotsmith/null-
buildpack](https://github.com/ryandotsmith/null-buildpack)

------
johnb
I've been using wercker to test and auto deploy a few sideproject go apps and
the process has been really smooth. I'm about to switch one over to their new
ssh deploy stuff and will write a blog post about it.

Using them as a plain CI/badge system for libraries is really nice too: I'm
using them on
[https://github.com/joho/godotenv](https://github.com/joho/godotenv) for that
and have been really happy with that.

Two thumbs up from me for the service all round.

~~~
chourobin
How does wercker compare to Ansible or Chef?

Btw, great work on Goodfilms.

~~~
miesie
Ansible and Chef are tools that provision your servers. Wercker is a
continuous delivery platform that tests, builds and deploys your applications.
All of this packaged in an easy to use interface where you can also
collaborate with others.

You can leverage tools such as Ansible, Puppet and Chef on wercker to create
the environment (a wercker box) that mimics your production system, again to
build, test and deploy your app, keeping dev/prod parity in true 12factor
fashion:

[http://12factor.net/dev-prod-parity](http://12factor.net/dev-prod-parity)

We've written up a post on provisioning wercker boxes which you can deploy to
the wercker directory
([http://app.wercker.com/#explore](http://app.wercker.com/#explore)) here:

[http://blog.wercker.com/2013/08/21/Overview-of-
provisioning-...](http://blog.wercker.com/2013/08/21/Overview-of-provisioning-
boxes.html)

Feel free to contact me if you have any questions!

cheers

------
pjvds
I also spiked leveraging caching on wercker to improve build time:
[http://born2code.net/blog/2013/07/26/improving-Go-build-
time...](http://born2code.net/blog/2013/07/26/improving-Go-build-time-with-
wercker-cache/)

------
derefr
I'm starting to really wish that Heroku was just another Docker PaaS, so that
I could take all the Docker containers I've already made and deploy them
there, or vice-versa. I wonder if it'll ever happen?

~~~
miesie
Hi I'm the cofounder of wercker. As you say, Heroku doesn't support Docker,
but we're looking into deploying docker containers from wercker to any other
IaaS with the push of a button. Feel free to email mies[at]wercker[dot]com if
you want to beta test our new docker deployment capabilities.

------
damian2000
What was the actual go app doing in the example? was it a web app?

~~~
miesie
It's a small example web application (API) that returns some JSON. The app
also comes along with a unit test.

------
apphrase
This is one article that is going to be referenced for years to come. I like
the snowball-effect traction of 'how to deploy an X app on Heroku'.

------
lindseybateman
also check out this post on doing code coverage with gocov for your golang
apps:

[http://blog.wercker.com/2013/08/05/checking-code-coverage-
wi...](http://blog.wercker.com/2013/08/05/checking-code-coverage-with-
gocov.html)

