We use the Puppetlabs VCSRepo to checkout a repository. When this is done, we would like to push a notification containing the SHA of the new version. I have no clue how to get this.
We use the VCS Repo like this:
vcsrepo { "/opt/ourcompany/distribution":
ensure => latest,
owner => $owner,
provider => git,
require => [ Package["git"], User["ouruser" ]],
source => "git@domain.com:our/repository.git",
revision => 'master',
user => $owner,
}
Then we set-up a notification like this:
exec { "send-hipchat-message" :
command => "curl -d \"$body\" $url", #Parameters are set somewhere else
path => "/usr/bin/",
subscribe => Vcsrepo["/opt/ourcompany/distribution"],
refreshonly => true
}
So the question is: how do I get the SHA of the revision the vcs repo has just updated to?