@@ -6,7 +6,7 @@ const LOG_PREFIX = '[BugsnagBuildReporterPlugin]'
66
77class BugsnagBuildReporterPlugin {
88 constructor ( build , options ) {
9- this . build = Object . assign ( { buildTool : 'webpack-bugsnag-plugins' } , build )
9+ this . build = Object . assign ( { buildTool : 'webpack-bugsnag-plugins' , sourceControl : { } , logLevel : 'warn' , path : process . cwd ( ) } , build )
1010 this . options = Object . assign ( { logLevel : 'warn' } , options )
1111 }
1212
@@ -17,14 +17,15 @@ class BugsnagBuildReporterPlugin {
1717 const logger = compiler . getInfrastructureLogger ? compiler . getInfrastructureLogger ( 'BugsnagBuildReporterPlugin' ) : console
1818 const logPrefix = compiler . getInfrastructureLogger ? '' : `${ LOG_PREFIX } `
1919 const cmdopts = this . getBuildOpts ( this )
20+ const path = this . options . path || this . build . path
2021
2122 logger . info ( `${ logPrefix } creating build for version "${ cmdopts . versionName } " using the bugsnag-cli` )
2223
2324 for ( const [ key , value ] of Object . entries ( cmdopts ) ) {
2425 logger . debug ( `${ logPrefix } ${ key } : ${ value } ` )
2526 }
2627
27- BugsnagCLI . CreateBuild ( cmdopts , process . cwd ( ) )
28+ BugsnagCLI . CreateBuild ( cmdopts , path )
2829 . then ( ( output ) => {
2930 // Split output by lines, prefix each line, and log them
3031 output . split ( '\n' ) . forEach ( ( line ) => {
@@ -62,12 +63,16 @@ class BugsnagBuildReporterPlugin {
6263 autoAssignRelease : opts . build . autoAssignRelease ,
6364 builderName : opts . build . builderName ,
6465 metadata : opts . build . metadata ,
65- provider : opts . build . provider ,
66+ provider : opts . build . sourceControl . provider ,
67+ repository : opts . build . sourceControl . repository ,
68+ revision : opts . build . sourceControl . revision ,
6669 releaseStage : opts . build . releaseStage ,
67- repository : opts . build . repository ,
68- revision : opts . build . revision ,
6970 buildApiRootUrl : opts . build . endpoint ,
70- logLevel : opts . options . logLevel
71+ logLevel : opts . build . logLevel || opts . options . logLevel ,
72+ dryRun : opts . build . dryRun || opts . options . dryRun ,
73+ verbose : opts . build . verbose || opts . options . verbose ,
74+ retries : opts . build . retries || opts . options . retries ,
75+ timeout : opts . build . timeout || opts . options . timeout
7176 }
7277
7378 for ( const [ key , value ] of Object . entries ( optionalOpts ) ) {
0 commit comments