Revert "apptask: backupId/format is not part of install anymore"

This reverts commit 49e5c60422.
This commit is contained in:
Girish Ramakrishnan
2019-10-11 20:21:32 -07:00
parent eb5c2ed30b
commit ad13445c93
2 changed files with 13 additions and 4 deletions

View File

@@ -710,6 +710,8 @@ function install(data, user, auditSource, callback) {
robotsTxt = data.robotsTxt || null,
enableBackup = 'enableBackup' in data ? data.enableBackup : true,
enableAutomaticUpdate = 'enableAutomaticUpdate' in data ? data.enableAutomaticUpdate : true,
backupId = data.backupId || null,
backupFormat = data.backupFormat || 'tgz',
alternateDomains = data.alternateDomains || [],
env = data.env || {},
mailboxName = data.mailboxName || '',
@@ -743,6 +745,9 @@ function install(data, user, auditSource, callback) {
error = validateRobotsTxt(robotsTxt);
if (error) return callback(error);
error = validateBackupFormat(backupFormat);
if (error) return callback(error);
error = validateLabel(label);
if (error) return callback(error);
@@ -798,7 +803,7 @@ function install(data, user, auditSource, callback) {
label: label,
tags: tags,
runState: exports.RSTATE_RUNNING,
installationState: exports.ISTATE_PENDING_INSTALL
installationState: backupId ? exports.ISTATE_PENDING_RESTORE : exports.ISTATE_PENDING_INSTALL
};
appdb.add(appId, appStoreId, manifest, location, domain, translatePortBindings(portBindings, manifest), data, function (error) {
@@ -815,13 +820,14 @@ function install(data, user, auditSource, callback) {
if (error) return callback(new AppsError(AppsError.INTERNAL_ERROR, 'Error setting cert: ' + error.message));
}
const restoreConfig = backupId ? { backupId: backupId, backupFormat: backupFormat } : null;
const task = {
args: { restoreConfig: null, overwriteDns },
args: { restoreConfig, overwriteDns },
values: { },
requiredState: exports.ISTATE_PENDING_INSTALL
requiredState: data.installationState
};
addTask(appId, exports.ISTATE_PENDING_INSTALL, task, function (error, result) {
addTask(appId, data.installationState, task, function (error, result) {
if (error) return callback(error);
const newApp = _.extend({}, data, { appStoreId, manifest, location, domain, portBindings });