I like go. One of the things I like is not worrying about dependencies during deployment. You just scp your binary to your server and you’re done. Well, after you configure it to connect to the database, ah yes, we forgot about haproxy, let’s set that up as well, but after scping to a server and doing some minor setup you’re ready to go, scale it out you say? Just scp to other servers, do the same config setup……..
Here’s how it works. The go-binary layer looks in the top level of your charm for a go-binary.yaml file that contains the name of your binary and any arguments that should be passed to it.
1 2 3
Your compiled binary should be placed in a “files” directory at the top level of your charm. Build your charm and you’re all done.
1 2 3 4 5 6 7
Under the covers the go-binary layer will add your binary to $PATH,write an upstart file for your binary and start it when the server starts.
There are examples of this in action with the http (website) relation (https://github.com/mattyw/simple-server-charm)
and with the mongodb relation (https://github.com/mattyw/simple-server-mongo-charm).
If you’d like to see these charms in action take a look at the following videos: