telia-oss / concourse-tasks

Common concourse tasks.
MIT License
3 stars 5 forks source link

Git log message to be written to output file #26

Closed georgpet closed 5 years ago

georgpet commented 5 years ago

We are sending slack notification after every apply and it would be useful to get git log message included. I could create the task just to get the message myself, but this small update will make the solution cleaner + someone else my find it useful as well.

itsdalmo commented 5 years ago

I don't think the git message should be an output from this task, primarily because there is no guarantee that the terraform apply is done in a git repository (i.e., the terraform code could just as well be stored in s3).

Instead you should get the git message directly from the git resource in Concourse: https://github.com/concourse/git-resource#in-clone-the-repository-at-the-given-ref

From that link, you can see that after you do a get: something you'll have access to something/.git/commit_message in the following tasks in Concourse. So the information is already available to you.