Skip to content

Instantly share code, notes, and snippets.

@monkpit
Forked from kpittman-securus/deploy.ts
Created April 28, 2021 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save monkpit/9779b6a22409b5cc10cc6bc0c15a96fb to your computer and use it in GitHub Desktop.
Save monkpit/9779b6a22409b5cc10cc6bc0c15a96fb to your computer and use it in GitHub Desktop.
NewRelic deploy via browser JS
step('Trigger NewRelic marker', async (b: Browser) => {
const description = `Flood run started - ${ENV.FLOOD_SEQUENCE_ID}`;
await b.page.evaluate(
(_description, sequenceId) => {
const applicationId = '123';
fetch(`https://api.newrelic.com/v2/applications/${applicationId}/deployments.json`, {
method: 'POST',
body: JSON.stringify({
deployment: {
description: _description,
user: 'flood.io',
revision: sequenceId,
},
}),
headers: {
'Content-Type': 'application/json',
'X-Api-Key': 'secret',
},
});
},
description,
ENV.FLOOD_SEQUENCE_ID,
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment