@@ -57,12 +57,12 @@ export function startBuildProcess(
5757 const scriptCommands = prepareCommands ( proc , scriptTypes ) ;
5858 let beforeDeployCommands = prepareCommands ( proc , [ CommandType . before_deploy ] ) ;
5959 const afterDeployCommands = prepareCommands ( proc , [ CommandType . after_deploy ] ) ;
60- const deployCommands = prepareCommands ( proc , [ CommandType . deploy ] ) ;
60+ let deployCommands = prepareCommands ( proc , [ CommandType . deploy ] ) ;
61+
6162 let deployPreferences ;
62- if ( deployCommands . length ) {
63- deployPreferences = deployCommands
64- . map ( p => p . command )
65- . reduce ( ( a , b ) => Object . assign ( b , a ) ) ;
63+ if ( deployCommands . length && typeof deployCommands [ 0 ] . command === 'object' ) {
64+ deployPreferences = deployCommands . reduce ( ( curr , acc ) => Object . assign ( acc , curr . command ) ) ;
65+ deployCommands = [ ] ;
6666 }
6767
6868 let restoreCache : Observable < any > = Observable . empty ( ) ;
@@ -116,6 +116,7 @@ export function startBuildProcess(
116116 . concat ( ...scriptCommands . map ( cmd => docker . attachExec ( name , cmd ) ) )
117117 . concat ( ...beforeDeployCommands . map ( cmd => docker . attachExec ( name , cmd ) ) )
118118 . concat ( ...deployCommands . map ( cmd => docker . attachExec ( name , cmd ) ) )
119+ . concat ( deploy ( deployPreferences , name , envs ) )
119120 . concat ( ...afterDeployCommands . map ( cmd => docker . attachExec ( name , cmd ) ) )
120121 . timeoutWith ( idleTimeout , Observable . throw ( new Error ( 'command timeout' ) ) )
121122 . takeUntil ( Observable . timer ( jobTimeout ) . timeInterval ( ) . mergeMap ( ( ) => {
0 commit comments