We did not open source any of this work, but the cookbooks are trivial. The recipe for the go web server is:
directory node['our_webservice']['config_dir'] do
template node[:our_webservice][:config_file] do
source "our_webservice.conf.erb"
notifies :restart, "service[our_webservice]", :delayed
package node['our_webservice']['package_name'] do
notifies :restart, "service[our_webservice]", :delayed
service "our_webservice" do
provider Chef::Provider::Service::Upstart
All of the useful bits are in the packaging script. We used a tool called FPM to do the actual deb package creation. In sort:
1) create a tempdir and give it the following structure:
$TMPDIR/usr/bin/our_webservice
$TMPDIR/etc/init/our_webservice.conf # this is the upstart job definition
$TMPDIR/etc/logrotate.d/our_webservice.conf
etc...
And then you can basically point FPM at that temp dir and say 'make me a deb that installs this'. I've done real debian packaging, this is easier, especially under a deadline. The TMPDIR creation & fpm invocation & some other sanity checks (like if go is actually creating static binaries) are all in a 'package.bash' file, for easy version controlling. This means you can have your jenkins execute a shell script target that looks like:
go build
go test
./package.bash
or some such (jenkins halts the job at the first command that exits non-zero, so if the build or tests fail, it won't package things).
Hope this helps.