1import { getIsDevAction } from '../../deployF/getDefaultEnvF.mts'2import { klusterCtx, type KlusterCfg } from '../../deployF/k8sF/ctxF/klusterCtxF.mts'3import { getAnyHostname } from './hostnameF.mts'4import { syncBuildDeployNextApp } from './syncBuildDeployNextAppF.mts'5import { isWcDnsSuffix } from '../../deployF/harvF/getWcSuffixF.mts'6import { appCfgCtx, type AppCfg } from '../../deployF/k8sF/ctxF/appCfgCtxF.mts'7import { throwIf } from '../../sharedF/throwErrorF/throwIfF.mts'8import { doPtDeployAction } from '../../deployF/ptDeployActions/do1PtDeployActionF.mts'9import { syncOtherNextAppResources } from './syncOtherNextAppResourcesF.mts'11export const deployNextApp = async (appConfig: AppCfg) => {12 klusterCtx.enterWith(appConfig as KlusterCfg)14 const {wcHostname} = appConfig16 const kube_extHostname = getAnyHostname(appConfig)18 Object.assign(appConfig, {kube_extHostname})20 if (!getIsDevAction(appConfig)) {21 const match = kube_extHostname ? isWcDnsSuffix(kube_extHostname) : undefined23 }25 const returnedCfg = await syncBuildDeployNextApp(appConfig)26 if (returnedCfg) Object.assign(appConfig, returnedCfg)27 appCfgCtx.enterWith(appConfig)29 if (getIsDevAction(appConfig)) return31 await syncOtherNextAppResources()33 await doPtDeployAction({isPostAction: true})34}