From 2083c297e68754e4b74cfd920f0e4f83f2230cd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Garn=C3=A6s?= Date: Fri, 15 Jun 2018 07:44:29 +0200 Subject: [PATCH] Use New Relic revision as configuration (#186) This allows you to override revision retrieval for custom builds. This is useful for builds where the revision is not in the current directory. --- CHANGELOG.md | 1 + recipe/newrelic.php | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 51ec97c..b791e66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Added grafana recipe. - Added yammer recipe, based on Slack recipe. - Added Google Hangouts Chat recipe, based on Slack recipe. +- Added support for New Relic deployment revision as config. ### Fixed - Fixed telegram recipe (#170) and updated docs diff --git a/recipe/newrelic.php b/recipe/newrelic.php index c178315..9ef8bde 100644 --- a/recipe/newrelic.php +++ b/recipe/newrelic.php @@ -17,6 +17,10 @@ return runLocally('git log -n 1 --format="%an: %s" | tr \'"\' "\'"'); }); +set('newrelic_revision', function() { + return runLocally('git log -n 1 --format="%h"'); +}); + desc('Notifying New Relic of deployment'); task('newrelic:notify', function () { $appId = get('newrelic_app_id'); @@ -24,7 +28,7 @@ $data = [ 'user' => get('user'), - 'revision' => runLocally('git log -n 1 --format="%h"'), + 'revision' => get('newrelic_revision'), 'description' => get('newrelic_description'), ];