Fixes: 
- Default Nuxt port changed to 3000 (thanks to @yurgeman).
- Cleanup old images effectively.
- More attempts on container startups (3->6).
- Always clean up server logs on restart/redeploy.
This commit is contained in:
Andras Bacsai
2021-04-26 11:45:04 +02:00
committed by GitHub
parent e16b7d65d4
commit b416e3ab3e
8 changed files with 22 additions and 25 deletions

View File

@@ -2,6 +2,7 @@
const Deployment = require('../../../../models/Deployment')
const ApplicationLog = require('../../../../models/Logs/Application')
const { verifyUserId, cleanupTmp } = require('../../../../libs/common')
const { purgeImagesContainers } = require('../../../../libs/applications/cleanup')
const { queueAndBuild } = require('../../../../libs/applications')
const { setDefaultConfiguration, precheckDeployment } = require('../../../../libs/applications/configuration')
const { docker } = require('../../../../libs/docker')
@@ -55,12 +56,14 @@ module.exports = async function (fastify) {
await Deployment.findOneAndUpdate(
{ repoId: id, branch, deployId, organization, name, domain },
{ repoId: id, branch, deployId, organization, name, domain, progress: 'failed' })
cleanupTmp(configuration.general.workdir)
if (error.name) {
if (error.message && error.stack) await saveServerLog(error)
if (reply.sent) await new ApplicationLog({ repoId: id, branch, deployId, event: `[ERROR 😖]: ${error.stack}` }).save()
}
throw new Error(error)
} finally {
cleanupTmp(configuration.general.workdir)
await purgeImagesContainers(configuration)
}
})
}