@@ -18,7 +18,7 @@ const archiver = require("../helpers/archiver"),
18
18
downloadBuildArtifacts = require ( '../helpers/buildArtifacts' ) . downloadBuildArtifacts ,
19
19
updateNotifier = require ( 'update-notifier' ) ,
20
20
pkg = require ( '../../package.json' ) ;
21
- module . exports = function run ( args ) {
21
+ module . exports = function run ( args , rawArgs ) {
22
22
let bsConfigPath = utils . getConfigPath ( args . cf ) ;
23
23
//Delete build_results.txt from log folder if already present.
24
24
initTimeComponents ( ) ;
@@ -102,7 +102,7 @@ module.exports = function run(args) {
102
102
utils . setParallels ( bsConfig , args , specFiles . length ) ;
103
103
104
104
// warn if specFiles cross our limit
105
- utils . warnSpecLimit ( bsConfig , args , specFiles ) ;
105
+ utils . warnSpecLimit ( bsConfig , args , specFiles , rawArgs ) ;
106
106
markBlockEnd ( 'preArchiveSteps' ) ;
107
107
markBlockStart ( 'checkAlreadyUploaded' ) ;
108
108
return checkUploaded . checkUploadedMd5 ( bsConfig , args , { markBlockStart, markBlockEnd} ) . then ( function ( md5data ) {
@@ -130,7 +130,7 @@ module.exports = function run(args) {
130
130
// Create build
131
131
//setup Local Testing
132
132
markBlockStart ( 'localSetup' ) ;
133
- let bs_local = await utils . setupLocalTesting ( bsConfig , args ) ;
133
+ let bs_local = await utils . setupLocalTesting ( bsConfig , args , rawArgs ) ;
134
134
markBlockEnd ( 'localSetup' ) ;
135
135
markBlockStart ( 'createBuild' ) ;
136
136
return build . createBuild ( bsConfig , zip ) . then ( function ( data ) {
@@ -166,22 +166,22 @@ module.exports = function run(args) {
166
166
167
167
168
168
if ( args . sync ) {
169
- syncRunner . pollBuildStatus ( bsConfig , data ) . then ( async ( exitCode ) => {
169
+ syncRunner . pollBuildStatus ( bsConfig , data , rawArgs ) . then ( async ( exitCode ) => {
170
170
171
171
// stop the Local instance
172
- await utils . stopLocalBinary ( bsConfig , bs_local , args ) ;
172
+ await utils . stopLocalBinary ( bsConfig , bs_local , args , rawArgs ) ;
173
173
174
174
// waiting for 5 secs for upload to complete (as a safety measure)
175
175
await new Promise ( resolve => setTimeout ( resolve , 5000 ) ) ;
176
176
177
177
// download build artifacts
178
178
if ( utils . nonEmptyArray ( bsConfig . run_settings . downloads ) ) {
179
- await downloadBuildArtifacts ( bsConfig , data . build_id , args ) ;
179
+ await downloadBuildArtifacts ( bsConfig , data . build_id , args , rawArgs ) ;
180
180
}
181
181
182
182
// Generate custom report!
183
- reportGenerator ( bsConfig , data . build_id , args , function ( ) {
184
- utils . sendUsageReport ( bsConfig , args , `${ message } \n${ dashboardLink } ` , Constants . messageTypes . SUCCESS , null , buildReportData ) ;
183
+ reportGenerator ( bsConfig , data . build_id , args , rawArgs , function ( ) {
184
+ utils . sendUsageReport ( bsConfig , args , `${ message } \n${ dashboardLink } ` , Constants . messageTypes . SUCCESS , null , buildReportData , rawArgs ) ;
185
185
utils . handleSyncExit ( exitCode , data . dashboard_url ) ;
186
186
} ) ;
187
187
} ) ;
@@ -210,30 +210,30 @@ module.exports = function run(args) {
210
210
}
211
211
}
212
212
buildReportData = { ...buildReportData , ...dataToSend } ;
213
- utils . sendUsageReport ( bsConfig , args , `${ message } \n${ dashboardLink } ` , Constants . messageTypes . SUCCESS , null , buildReportData ) ;
213
+ utils . sendUsageReport ( bsConfig , args , `${ message } \n${ dashboardLink } ` , Constants . messageTypes . SUCCESS , null , buildReportData , rawArgs ) ;
214
214
return ;
215
215
} ) . catch ( async function ( err ) {
216
216
// Build creation failed
217
217
logger . error ( err ) ;
218
218
// stop the Local instance
219
- await utils . stopLocalBinary ( bsConfig , bs_local , args ) ;
219
+ await utils . stopLocalBinary ( bsConfig , bs_local , args , rawArgs ) ;
220
220
221
- utils . sendUsageReport ( bsConfig , args , err , Constants . messageTypes . ERROR , 'build_failed' ) ;
221
+ utils . sendUsageReport ( bsConfig , args , err , Constants . messageTypes . ERROR , 'build_failed' , null , rawArgs ) ;
222
222
process . exitCode = Constants . ERROR_EXIT_CODE ;
223
223
} ) ;
224
224
} ) . catch ( function ( err ) {
225
225
// Zip Upload failed | Local Start failed
226
226
logger . error ( err ) ;
227
227
if ( err === Constants . userMessages . LOCAL_START_FAILED ) {
228
- utils . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . userMessages . LOCAL_START_FAILED } ` , Constants . messageTypes . ERROR , 'local_start_failed' ) ;
228
+ utils . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . userMessages . LOCAL_START_FAILED } ` , Constants . messageTypes . ERROR , 'local_start_failed' , null , rawArgs ) ;
229
229
} else {
230
230
logger . error ( Constants . userMessages . ZIP_UPLOAD_FAILED ) ;
231
231
fileHelpers . deleteZip ( ) ;
232
- utils . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . userMessages . ZIP_UPLOAD_FAILED } ` , Constants . messageTypes . ERROR , 'zip_upload_failed' ) ;
232
+ utils . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . userMessages . ZIP_UPLOAD_FAILED } ` , Constants . messageTypes . ERROR , 'zip_upload_failed' , null , rawArgs ) ;
233
233
try {
234
234
fileHelpers . deletePackageArchieve ( ) ;
235
235
} catch ( err ) {
236
- utils . sendUsageReport ( bsConfig , args , Constants . userMessages . NPM_DELETE_FAILED , Constants . messageTypes . ERROR , 'npm_deletion_failed' ) ;
236
+ utils . sendUsageReport ( bsConfig , args , Constants . userMessages . NPM_DELETE_FAILED , Constants . messageTypes . ERROR , 'npm_deletion_failed' , null , rawArgs ) ;
237
237
}
238
238
}
239
239
process . exitCode = Constants . ERROR_EXIT_CODE ;
@@ -242,36 +242,36 @@ module.exports = function run(args) {
242
242
// Zipping failed
243
243
logger . error ( err ) ;
244
244
logger . error ( Constants . userMessages . FAILED_TO_ZIP ) ;
245
- utils . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . userMessages . FAILED_TO_ZIP } ` , Constants . messageTypes . ERROR , 'zip_creation_failed' ) ;
245
+ utils . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . userMessages . FAILED_TO_ZIP } ` , Constants . messageTypes . ERROR , 'zip_creation_failed' , null , rawArgs ) ;
246
246
try {
247
247
fileHelpers . deleteZip ( ) ;
248
248
} catch ( err ) {
249
- utils . sendUsageReport ( bsConfig , args , Constants . userMessages . ZIP_DELETE_FAILED , Constants . messageTypes . ERROR , 'zip_deletion_failed' ) ;
249
+ utils . sendUsageReport ( bsConfig , args , Constants . userMessages . ZIP_DELETE_FAILED , Constants . messageTypes . ERROR , 'zip_deletion_failed' , null , rawArgs ) ;
250
250
}
251
251
try {
252
252
fileHelpers . deletePackageArchieve ( ) ;
253
253
} catch ( err ) {
254
- utils . sendUsageReport ( bsConfig , args , Constants . userMessages . NPM_DELETE_FAILED , Constants . messageTypes . ERROR , 'npm_deletion_failed' ) ;
254
+ utils . sendUsageReport ( bsConfig , args , Constants . userMessages . NPM_DELETE_FAILED , Constants . messageTypes . ERROR , 'npm_deletion_failed' , null , rawArgs ) ;
255
255
}
256
256
process . exitCode = Constants . ERROR_EXIT_CODE ;
257
257
} ) ;
258
258
} ) . catch ( function ( err ) {
259
259
// package installer failed
260
260
logger . error ( err ) ;
261
261
logger . error ( Constants . userMessages . FAILED_CREATE_NPM_ARCHIVE ) ;
262
- utils . sendUsageReport ( bsConfig , args , Constants . userMessages . FAILED_CREATE_NPM_ARCHIVE , Constants . messageTypes . ERROR , 'npm_package_archive_failed' ) ;
262
+ utils . sendUsageReport ( bsConfig , args , Constants . userMessages . FAILED_CREATE_NPM_ARCHIVE , Constants . messageTypes . ERROR , 'npm_package_archive_failed' , null , rawArgs ) ;
263
263
try {
264
264
fileHelpers . deletePackageArchieve ( ) ;
265
265
} catch ( err ) {
266
- utils . sendUsageReport ( bsConfig , args , Constants . userMessages . NPM_DELETE_FAILED , Constants . messageTypes . ERROR , 'npm_deletion_failed' ) ;
266
+ utils . sendUsageReport ( bsConfig , args , Constants . userMessages . NPM_DELETE_FAILED , Constants . messageTypes . ERROR , 'npm_deletion_failed' , null , rawArgs ) ;
267
267
}
268
268
process . exitCode = Constants . ERROR_EXIT_CODE ;
269
269
} ) ;
270
270
} ) . catch ( function ( err ) {
271
271
// md5 check failed
272
272
logger . error ( err ) ;
273
273
logger . error ( Constants . userMessages . FAILED_MD5_CHECK ) ;
274
- utils . sendUsageReport ( bsConfig , args , Constants . userMessages . MD5_CHECK_FAILED , Constants . messageTypes . ERROR , 'zip_already_uploaded_failed' ) ;
274
+ utils . sendUsageReport ( bsConfig , args , Constants . userMessages . MD5_CHECK_FAILED , Constants . messageTypes . ERROR , 'zip_already_uploaded_failed' , null , rawArgs ) ;
275
275
process . exitCode = Constants . ERROR_EXIT_CODE ;
276
276
} ) ;
277
277
} ) . catch ( function ( err ) {
@@ -285,14 +285,14 @@ module.exports = function run(args) {
285
285
}
286
286
287
287
let error_code = utils . getErrorCodeFromMsg ( err ) ;
288
- utils . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . validationMessages . NOT_VALID } ` , Constants . messageTypes . ERROR , error_code ) ;
288
+ utils . sendUsageReport ( bsConfig , args , `${ err } \n${ Constants . validationMessages . NOT_VALID } ` , Constants . messageTypes . ERROR , error_code , null , rawArgs ) ;
289
289
process . exitCode = Constants . ERROR_EXIT_CODE ;
290
290
} ) ;
291
291
} ) . catch ( function ( err ) {
292
292
logger . error ( err ) ;
293
293
utils . setUsageReportingFlag ( null , args . disableUsageReporting ) ;
294
294
let bsJsonData = utils . readBsConfigJSON ( bsConfigPath ) ;
295
- utils . sendUsageReport ( bsJsonData , args , err . message , Constants . messageTypes . ERROR , utils . getErrorCodeFromErr ( err ) ) ;
295
+ utils . sendUsageReport ( bsJsonData , args , err . message , Constants . messageTypes . ERROR , utils . getErrorCodeFromErr ( err ) , null , rawArgs ) ;
296
296
process . exitCode = Constants . ERROR_EXIT_CODE ;
297
297
} ) . finally ( function ( ) {
298
298
updateNotifier ( {
0 commit comments