Skip to content

Instantly share code, notes, and snippets.

@danharper danharper/release.js
Last active Oct 31, 2016

Embed
What would you like to do?
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
You can’t perform that action at this time.