Skip to content

Instantly share code, notes, and snippets.

@benlemasurier
Created April 16, 2014 17:51
Show Gist options
  • Save benlemasurier/10913256 to your computer and use it in GitHub Desktop.
Save benlemasurier/10913256 to your computer and use it in GitHub Desktop.
begin
node_storage = data_bag_item('nodes', node.name)
requested_revision = node_storage['deployments'].last['revision']
rescue Net::HTTPServerException
# data bag item does not exist, create it
new_node = {
'id' => node.name,
'deployments' => [{
'date' => Time.now,
'revision' => 'HEAD',
'log' => ''
}]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment