feat(hostedapp): add hosted app lifecycle protocol support

This commit is contained in:
2026-05-26 15:27:00 +00:00
parent f6ab7460e1
commit 2adb86c5ea
9 changed files with 404 additions and 28 deletions
+12 -1
View File
@@ -240,6 +240,12 @@ export class CloudlyAppStoreManager {
.slice(0, 25);
}
public async startHostedAppUpgrade(serviceIdArg: string, targetVersionArg: string): Promise<IAppStoreUpgradeOperation> {
const operation = await this.createUpgradeOperation(serviceIdArg, targetVersionArg);
void this.performUpgrade(operation.id).catch(() => {});
return operation;
}
public async getAppStoreUpgradePreview(
serviceIdArg: string,
targetVersionArg?: string,
@@ -545,7 +551,11 @@ export class CloudlyAppStoreManager {
this.assertRuntimeCompatibility(config);
this.assertSupportedPlatformRequirements(config);
this.assertSupportedPublishedPorts(publishedPorts);
const envVars = this.getAppStoreEnvVars(config, optionsArg.envVars || {});
const hostedAppRuntime = this.cloudlyRef.hostedAppManager.createHostedAppRuntimeEnvVars(optionsArg.serviceName);
const envVars = {
...this.getAppStoreEnvVars(config, optionsArg.envVars || {}),
...hostedAppRuntime.envVars,
};
if (this.requiresTemplateValue(envVars, 'SERVICE_DOMAIN') && !optionsArg.domain) {
throw new Error('A domain is required because the app template uses ${SERVICE_DOMAIN}');
}
@@ -567,6 +577,7 @@ export class CloudlyAppStoreManager {
appTemplateId: optionsArg.appId,
appTemplateVersion: appStoreVersion,
appStoreUpgradePolicy: 'manual',
hostedAppLifecycle: hostedAppRuntime.lifecycle,
environment: envVars,
secretBundleId: secretBundle.id,
additionalSecretBundleIds: [],