-
Couldn't load subscription status.
- Fork 116
feat: Add setCommits option #139
Conversation
|
Also I realised that I also might need to use deploys. This is for the thread #71. BTW I wrote simple webpack-3 plugin: I run this Also I'll write and use similar So what do you think: do we really need such functionality in this plugin? |
|
Oh, no way! We need to add |
change condition for setCommits call
|
@kamilogorek can you review this? |
|
Also I wrote and use following plugin for Sentry Deploys: I use Sentry API here instead of sentry-cli because bridge-like thing from Rust to JS does not implemented like for const assert = require('assert')
const axios = require('axios').default
class SentryDeploysPlugin {
constructor(options) {
this.options = options
}
apply(compiler) {
compiler.hooks.emit.tapAsync(
'SentryDeploysPlugin',
async (compilation, callback) => {
const {
version,
authToken,
orgSlug,
serverUrl,
} = this.options
assert(typeof version === 'string', 'option version is incorrect')
assert(typeof authToken === 'string', 'option authToken is incorrect')
assert(typeof orgSlug === 'string', 'option orgSlug is incorrect')
assert(typeof serverUrl === 'string', 'option serverUrl is incorrect')
try {
console.info('\n\n> Creating sentry deploy...')
await axios.post(`${serverUrl}api/0/organizations/${orgSlug}/releases/${version}/deploys/`, {
environment: 'production',
}, {
headers: {
Authorization: `Bearer ${authToken}`,
},
})
console.info('> Sentry deploy created successfully\n')
callback()
} catch (error) {
console.info('> Sentry deploy failed!\n')
console.error('Sentry server response: ', error.response.data)
callback(error)
}
}
)
}
}
module.exports = SentryDeploysPlugin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
edit: missed one thing. Updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few minor changes
|
Thanks! |
I added setCommits command to be able set associated commits through this plugin as requested here #71. Without this options you forced to use sentry-cli to set associated commits directly. Please check this out.
ToDo: