feat(hostedapp): add hosted app lifecycle protocol support
This commit is contained in:
@@ -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: [],
|
||||
|
||||
Reference in New Issue
Block a user