Created
April 6, 2021 15:02
-
-
Save kpittman-securus/f520eac614dcaff4a339c3d786bd92f2 to your computer and use it in GitHub Desktop.
NewRelic deploy via browser JS
This file contains hidden or 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