Simple golang build and deploy script

There are many ways to build and deploy a golang application, the best method I have found so far is to use code ship which I will cover in a future article. The simplest method is to push your code to version control on your local development environment. Then log into the production server and run a script on the server which completes the following steps: Syncs the code from version control Complies the code Stops the application via the upstart script Moves the code to the production location Starts the application via the upstart script. [Read More]

Setup a basic golang build on ubuntu

One of the most simple ways to get started with serving a golang web application is to set-up the golang build environment on the server. This allows you to push your code to version control on your local development environment and then sync it down and build it on the server before deploying it. It should be noted that this is not the recommended approach in many cases and using a service like code ship is my preferred method but can be slightly more complex to configure so to get you up and running this method can be very convenient. [Read More]

Golang nginx reverse proxy for ubuntu

If you have configured your golang application to run using upstart the best way to serve it to the world is behind a reverse proxy on a single server instance or haproxy using mutiple servers. To run an a golang application on a single server listening on port 8080 you will need to use nginx to proxy requests from the standard port 80. To install nginx on ubuntu first ensure that apache is not installed on the server and then install nginx [Read More]

Golang upstart script for Ubuntu

Golang rocks as a language, it complies your code to a single binary which can then easily be deployed to remote systems. The problem with it compared to .NET, Java or languages like PHP or Ruby is that it is not invoked by fast CGI or any another technologies. It instead needs to be run as a background process listening to a specific port. My choice of OS is Ubuntu deployed from code ship which means the best way to start the app and keep is running is upstart. [Read More]