Skip to content

Instantly share code, notes, and snippets.

@danharper
Last active October 31, 2016 16:14
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 danharper/a2b419d78a48f871399ab67fb20b3040 to your computer and use it in GitHub Desktop.
Save danharper/a2b419d78a48f871399ab67fb20b3040 to your computer and use it in GitHub Desktop.
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