Deploying Go apps to Heroku

1. Make sure the app is running fine locally.

2. Install dep, with the project in $GOPATH/src/<user>/<project>, run dep init inside the project directory, dep ensure to generate the vendor files

3. Download and install Heroku CLI, run heroku login to login and heroku create to create the app, then heroku buildpacks:set heroku/go to set the build environment (ref: https://devcenter.heroku.com/articles/buildpacks)

4. Edit Gopkg.toml to include metadata.heroku section

[meatadata.heroku]
root-package="github.com/<user>/<project>"
go-version = "1.0"
build = [.]
ensure="false"

5. Configure semaphoreci.com to load the git repo from Github.com and deploy to Heroku, all continuous build, test and integration.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.