-
-
Save monkpit/9779b6a22409b5cc10cc6bc0c15a96fb to your computer and use it in GitHub Desktop.
NewRelic deploy via browser JS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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