@@ -933,13 +933,13 @@ async function handleNativeBuildServerDeploy({
933933 ) ;
934934 }
935935
936- $deploymentSpinner . stop ( "Deployment files uploaded" ) ;
937-
938936 const [ unlinkError ] = await tryCatch ( unlink ( archivePath ) ) ;
939937 if ( unlinkError ) {
940938 logger . debug ( "Failed to delete deployment artifact file" , { archivePath, error : unlinkError } ) ;
941939 }
942940
941+ $deploymentSpinner . message ( "Deployment files uploaded" ) ;
942+
943943 const initializeDeploymentResult = await apiClient . initializeDeployment ( {
944944 contentHash : "-" ,
945945 userId,
@@ -952,7 +952,9 @@ async function handleNativeBuildServerDeploy({
952952 } ) ;
953953
954954 if ( ! initializeDeploymentResult . success ) {
955- throw new Error ( `Failed to initialize deployment: ${ initializeDeploymentResult . error } ` ) ;
955+ $deploymentSpinner . stop ( "Failed to initialize deployment" ) ;
956+ log . error ( chalk . bold ( chalkError ( initializeDeploymentResult . error ) ) ) ;
957+ throw new OutroCommandError ( `Deployment failed` ) ;
956958 }
957959
958960 const deployment = initializeDeploymentResult . data ;
@@ -962,6 +964,12 @@ async function handleNativeBuildServerDeploy({
962964 options . env === "prod" ? "prod" : "stg"
963965 } `;
964966
967+ const exposedDeploymentLink = isLinksSupported
968+ ? cliLink ( chalk . bold ( rawDeploymentLink ) , rawDeploymentLink )
969+ : chalk . bold ( rawDeploymentLink ) ;
970+ $deploymentSpinner . stop ( "Deployment initialized" ) ;
971+ log . info ( `View deployment: ${ exposedDeploymentLink } ` ) ;
972+
965973 setGithubActionsOutputAndEnvVars ( {
966974 envVars : {
967975 TRIGGER_DEPLOYMENT_VERSION : deployment . version ,
@@ -985,32 +993,18 @@ async function handleNativeBuildServerDeploy({
985993 if ( ! eventStream ) {
986994 log . warn ( `Failed streaming build logs, open the deployment in the dashboard to view the logs` ) ;
987995
988- if ( ! isLinksSupported ) {
989- log . info ( `View deployment: ${ rawDeploymentLink } ` ) ;
990- }
991-
992- outro (
993- `Version ${ deployment . version } is being deployed ${
994- isLinksSupported ? `| ${ cliLink ( "View deployment" , rawDeploymentLink ) } ` : ""
995- } `
996- ) ;
996+ outro ( `Version ${ deployment . version } is being deployed` ) ;
997997
998998 process . exit ( 0 ) ;
999999 }
10001000
1001- const exposedDeploymentLink = isLinksSupported
1002- ? cliLink ( chalk . bold ( rawDeploymentLink ) , rawDeploymentLink )
1003- : chalk . bold ( rawDeploymentLink ) ;
1004- log . info ( `View deployment: ${ exposedDeploymentLink } ` ) ;
1005-
10061001 const $queuedSpinner = spinner ( {
10071002 cancelMessage :
10081003 "Disconnecting from the build server log stream. If you intended to cancel the deployment instead, you can do that in the dashboard." ,
10091004 } ) ;
10101005 $queuedSpinner . start ( "Build queued" ) ;
10111006
10121007 const abortController = new AbortController ( ) ;
1013- let deploymentLog : ReturnType < typeof taskLog > | undefined ;
10141008
10151009 const s2 = new S2 ( { accessToken : eventStream . s2 . accessToken } ) ;
10161010 const basin = s2 . basin ( eventStream . s2 . basin ) ;
0 commit comments