@@ -22,6 +22,12 @@ const verdaccio = spawn('npx', ['verdaccio', '-c', 'verdaccio/config.yaml'], pip
22
22
. on ( 'error' , e => {
23
23
throw e
24
24
} )
25
+ . on ( 'close' , ( code , signal ) => {
26
+ console . log ( `verdaccio process closed with code ${ code } or signal ${ signal } ` ) ;
27
+ } )
28
+ . on ( 'exit' , ( code , signal ) => {
29
+ console . log ( `verdaccio process exited with code ${ code } or signal ${ signal } ` ) ;
30
+ } )
25
31
26
32
// Publish all changed packages the local verdaccio server.
27
33
// Anything that has not been changed will match what is in npm
@@ -35,21 +41,33 @@ const args = [
35
41
'--no-git-reset' ,
36
42
'--preid' , 'ci' ,
37
43
'--no-verify-access' ,
38
- '--force-publish'
44
+ '--force-publish' ,
45
+ '--loglevel' , 'warn' ,
46
+ '--no-progress'
39
47
]
40
- spawn ( 'npx' , args , pipeStdIo )
41
- . on ( 'close' , ( code ) => {
48
+ timeout = 60000 * 2
49
+ console . log ( `Starting lerna publish with timeout of ${ timeout } ` ) ;
50
+ spawn ( 'npx' , args , {
51
+ stdio : [ process . stdin , process . stdout , process . stderr ] ,
52
+ timeout : timeout
53
+ } ) . on ( 'close' , ( code , signal ) => {
54
+ console . log ( `lerna terminated due to receipt of signal ${ signal } or code ${ code } ` ) ;
42
55
// The above command will make some modifications,
43
56
// Roll them back
44
57
// Ideally, we would find a way to not have to do this
45
58
execSync ( 'git checkout -- modules/**/package.json' )
46
59
execSync ( 'git checkout -- lerna.json' )
60
+ execSync ( 'git restore package-lock.json' )
47
61
48
62
// Kill the background verdaccio server
49
- verdaccio . kill ( )
50
-
63
+ verdaccioKilledStatus = verdaccio . kill ( )
64
+ console . log ( `killing Verdaccio returned ${ verdaccioKilledStatus } ` ) ;
65
+
51
66
// If this command had an error,
52
67
// we need to forward this.
53
68
// Otherwise the entire CI build may think that things succeeded.
54
69
if ( code !== 0 ) throw Error ( `Exit code: ${ code } ` )
55
- } )
70
+
71
+ process . exit ( )
72
+ } )
73
+
0 commit comments