@@ -201,7 +201,11 @@ export function configureDeployCommand(program: Command) {
201201 localBuild : true ,
202202 } )
203203 )
204- . addOption ( new CommandOption ( "--local-build" , "Build the deployment image locally" ) )
204+ . addOption (
205+ new CommandOption ( "--local-build" , "Build the deployment image locally" ) . conflicts (
206+ "nativeBuildServer"
207+ )
208+ )
205209 . addOption ( new CommandOption ( "--push" , "Push the image after local builds" ) . hideHelp ( ) )
206210 . addOption (
207211 new CommandOption ( "--no-push" , "Do not push the image after local builds" ) . hideHelp ( )
@@ -420,14 +424,19 @@ async function _deployCommand(dir: string, options: DeployCommandOptions) {
420424 gitMeta,
421425 type : features . run_engine_v2 ? "MANAGED" : "V1" ,
422426 runtime : buildManifest . runtime ,
427+ isLocal : options . localBuild ,
423428 isNativeBuild : false ,
424429 triggeredVia : getTriggeredVia ( ) ,
425430 } ,
426431 envVars . TRIGGER_EXISTING_DEPLOYMENT_ID
427432 ) ;
433+
434+ // When `externalBuildData` is not present the deployment implicitly goes into the local build path
435+ // which is used in self-hosted setups. There are a few subtle differences between local builds for the cloud
436+ // and local builds for self-hosted setups. We need to make the separation of the two paths clearer to avoid confusion.
428437 const isLocalBuild = options . localBuild || ! deployment . externalBuildData ;
429- // Would be best to actually store this separately in the deployment object. This is an okay proxy for now.
430- const remoteBuildExplicitlySkipped = options . localBuild && ! ! deployment . externalBuildData ;
438+ const authenticateToTriggerRegistry = options . localBuild ;
439+ const skipServerSideRegistryPush = options . localBuild ;
431440
432441 // Fail fast if we know local builds will fail
433442 if ( isLocalBuild ) {
@@ -559,7 +568,7 @@ async function _deployCommand(dir: string, options: DeployCommandOptions) {
559568 network : options . network ,
560569 builder : options . builder ,
561570 push : options . push ,
562- authenticateToRegistry : remoteBuildExplicitlySkipped ,
571+ authenticateToRegistry : authenticateToTriggerRegistry ,
563572 } ) ;
564573
565574 logger . debug ( "Build result" , buildResult ) ;
@@ -657,7 +666,7 @@ async function _deployCommand(dir: string, options: DeployCommandOptions) {
657666 {
658667 imageDigest : buildResult . digest ,
659668 skipPromotion : options . skipPromotion ,
660- skipPushToRegistry : remoteBuildExplicitlySkipped ,
669+ skipPushToRegistry : skipServerSideRegistryPush ,
661670 } ,
662671 ( logMessage ) => {
663672 if ( options . plain || isCI ) {
0 commit comments