An output only opinionated concourse resource for adding deployment markers in New Relic
Details of Deployment markers can be found here
api_key
: Required. Rest API key for adding deployment markers to an applicationuser
: Required. This Username will appear in the deployments dashboard
In order to add an deployment marker, a revision number and a description may be provided to the New Relic API.
For this purpose provide a git
resource in the put step so that New Relic concourse resource
takes the revision from (SHA of origin/HEAD commit)
and description from (Commit message of origin/HEAD commit)
.
git_src_directory
: Required. source code of the deployed version. Format is/tmp/build/put/<<name of git resource>>
api_url
: Mandatory. Deployment REST api endpointapp_id
: Optional (deprecated
in favour of api_url) Application ID from New Relic, ifapi_url
is not provided this defaults to US API endpoint
resource_types:
- name: newrelic-deployment-marker
type: docker-image
source:
repository: shyamz22/newrelic-resource
tag: latest
resources:
- name: src
type: git
source:
uri: [email protected]:shyamz-22/PactIt.git
branch: master
private_key: ((git-key))
- name: deployment-marker
type: newrelic-deployment-marker
source:
api_key: ((newrelic-rest-api-key))
user: [email protected]
jobs:
- name: deploy
plan:
- get: src # <-- 🤓 source code of deployed app
trigger: true
- task: deploy
config:
platform: linux
image_resource:
type: docker-image
source:
repository: alpine
inputs:
- name: src
run:
path: sh
args:
- -exc
- |
export TERM=dumb
set -x
# deploy
echo "deployment-successful"
on_success:
put: deployment-marker
params:
git_src_directory: /tmp/build/put/src # <-- 🤓
api_url: https://api.newrelic.com/v2/applications/((app-id))/deployments.json