File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,8 +27,17 @@ module.exports = function() {
2727
2828 gutil . log ( "Migrations found, stopping to apply, in maintenance mode" ) ;
2929 fs . writeFileSync ( path . join ( projectRoot , '.maintenance' ) , '' ) ;
30- execSync ( '/usr/local/bin/pm2 stop all' ) ; // todo gracefulShutdown
3130
31+ try {
32+ execSync ( '/usr/local/bin/pm2 stop all' ) ; // todo gracefulShutdown
33+ } catch ( e ) {
34+ if ( e . code == 1 ) {
35+ // OK
36+ // [PM2][WARN] No process found (already stopped)
37+ } else {
38+ throw e ;
39+ }
40+ }
3241 gutil . log ( "Migrations, applying all up" ) ;
3342
3443 yield migrationManager . migrateAllUp ( ) ;
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ module.exports = function() {
3131 yield * client . runInTarget ( `git merge origin/production --no-edit` ) ;
3232
3333 // if there any migrations, this will stop the server and apply them
34- yield * client . runInTarget ( `gulp deploy:migrate` ) ;
34+ yield * client . runInTarget ( `gulp deploy:migrate --stop ` ) ;
3535
3636 yield * client . runInTarget ( `/usr/local/bin/pm2 startOrGracefulReload ecosystem.json --env production` ) ;
3737 yield * client . runInTarget ( `gulp cache:clean` ) ;
You can’t perform that action at this time.
0 commit comments