db upgrade: stop containers only after exporting

we cannot export if the containers were nuked in the platform logic.
for this reason, move the removal near the place where they get started.
This commit is contained in:
Girish Ramakrishnan
2020-07-30 14:36:11 -07:00
parent b0d65a1bae
commit d089444441
5 changed files with 70 additions and 63 deletions
+4 -1
View File
@@ -630,7 +630,10 @@ function configureMail(mailFqdn, mailDomain, callback) {
if (!safe.child_process.execSync(`cp ${bundle.certFilePath} ${mailCertFilePath}`)) return callback(new BoxError(BoxError.FS_ERROR, 'Could not create cert file:' + safe.error.message));
if (!safe.child_process.execSync(`cp ${bundle.keyFilePath} ${mailKeyFilePath}`)) return callback(new BoxError(BoxError.FS_ERROR, 'Could not create key file:' + safe.error.message));
shell.exec('startMail', 'docker rm -f mail || true', function (error) {
async.series([
shell.exec.bind(null, 'stopMail', 'docker stop mail || true'),
shell.exec.bind(null, 'removeMail', 'docker rm -f mail || true'),
], function (error) {
if (error) return callback(error);
createMailConfig(mailFqdn, mailDomain, function (error, allowInbound) {