Last active
October 31, 2016 16:14
-
-
Save danharper/a2b419d78a48f871399ab67fb20b3040 to your computer and use it in GitHub Desktop.
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
const { execSync } = require('child_process') | |
const SENTRY_URL = 'https://app.getsentry.com/api/0/projects/radweb/inventorybase-go/releases' | |
const SENTRY_API_KEY = process.env.SENTRY_API_KEY | |
const VERSION = process.env.CIRCLE_SHA1 | |
function createSentryRelease() { | |
execSync(`curl ${SENTRY_URL} -u ${SENTRY_API_KEY} -X POST -d '${JSON.stringify({ version: VERSION })}' -H 'Content-Type: application-json'`) | |
} | |
function uploadToSentry(file, filename) { | |
execSync(`curl ${SENTRY_URL}/${VERSION}/files/ -u ${SENTRY_API_KEY} -X POST -F file=@${file} -F name='${filename}'`) | |
} | |
createSentryRelease() | |
uploadToSentry('build/app.js', 'app.js') | |
uploadToSentry('build/app.js.map', 'app.js.map') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment