Created
November 30, 2018 15:21
-
-
Save padupuy/ee626048364c9eba67aa1987bb88432d to your computer and use it in GitHub Desktop.
Upload JS sourcemap files to sentry
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
[defaults] | |
url=https://sentry.yourcompany.com | |
project=yourproject | |
org=yourcompany | |
[auth] | |
token = yourtoken |
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 SentryCli = require('@sentry/cli'); | |
const { version } = require('./package.json'); | |
async function uploadSourceMaps() { | |
//default config file is read from ~/.sentryclirc | |
const cli = new SentryCli(); | |
// Use the version defined in package.json or ask sentry for a new one | |
// const releaseVersion = await cli.releases.proposeVersion(); | |
console.log('Proposed version:\n', version); | |
const options = { | |
debug: false, | |
include: ['./build/'], | |
urlPrefix: '~', | |
rewrite: true, | |
ignore: ['node_modules'] | |
}; | |
console.log('upload options:\n', options); | |
await cli.releases.new(version); | |
await cli.releases.uploadSourceMaps(version, options); | |
await cli.releases.finalize(version); | |
} | |
uploadSourceMaps(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nice snippet! helped me out