do not reconfigure apps when infra version has not changed

This commit is contained in:
Girish Ramakrishnan
2016-07-25 18:57:54 -07:00
parent 33c70dad8b
commit a3c270c4a1
+14 -1
View File
@@ -57,7 +57,7 @@ function initialize(callback) {
createDockerNetwork,
startAddons.bind(null, existingInfra),
removeOldImages,
existingInfra.version === 'none' ? apps.restoreInstalledApps : apps.configureInstalledApps,
startApps.bind(null, existingInfra),
loadAddonVars,
fs.writeFile.bind(fs, paths.INFRA_VERSION_FILE, JSON.stringify(infra))
], function (error) {
@@ -278,6 +278,19 @@ function startAddons(existingInfra, callback) {
async.series(startFuncs, callback);
}
function startApps(existingInfra, callback) {
if (existingInfra.version === infra.version) {
debug('startApp: apps are already uptodate');
callback();
} else if (existingInfra.version === 'none') {
debug('startApps: restoring installed apps');
apps.restoreInstalledApps(callback);
} else {
debug('startApps: reconfiguring installed apps');
apps.configureInstalledApps(callback);
}
}
function loadAddonVars(callback) {
gAddonVars = {
mail: ini.parse(fs.readFileSync(paths.DATA_DIR + '/addons/mail_vars.sh', 'utf8')),