Features:
- Rust support 🦀 (Thanks to @pepoviola)
- Add a default rewrite rule to PHP apps (to index.php)
- Able to control upgrades in a straightforward way

Fixes:
- Improved upgrade scripts
- Simplified prechecks before deployment
- Fixed path deployments
- Fixed already defined apps redirections
- Better error handling - still needs a lot of improvement here!
This commit is contained in:
Andras Bacsai
2021-04-15 22:40:44 +02:00
committed by GitHub
parent 166a573392
commit bad84289c4
56 changed files with 899 additions and 661 deletions

View File

@@ -1,60 +1,6 @@
const { docker } = require('../../libs/docker')
module.exports = async function (fastify) {
// const getConfig = {
// querystring: {
// type: 'object',
// properties: {
// repoId: { type: 'number' },
// branch: { type: 'string' }
// },
// required: ['repoId', 'branch']
// }
// }
// const saveConfig = {
// body: {
// type: 'object',
// properties: {
// build: {
// type: 'object',
// properties: {
// baseDir: { type: 'string' },
// installCmd: { type: 'string' },
// buildCmd: { type: 'string' }
// },
// required: ['baseDir', 'installCmd', 'buildCmd']
// },
// publish: {
// type: 'object',
// properties: {
// publishDir: { type: 'string' },
// domain: { type: 'string' },
// pathPrefix: { type: 'string' },
// port: { type: 'number' }
// },
// required: ['publishDir', 'domain', 'pathPrefix', 'port']
// },
// previewDeploy: { type: 'boolean' },
// branch: { type: 'string' },
// repoId: { type: 'number' },
// buildPack: { type: 'string' },
// fullName: { type: 'string' },
// installationId: { type: 'number' }
// },
// required: ['build', 'publish', 'previewDeploy', 'branch', 'repoId', 'buildPack', 'fullName', 'installationId']
// }
// }
// fastify.get("/all", async (request, reply) => {
// return await Config.find().select("-_id -__v");
// });
// fastify.get("/", { schema: getConfig }, async (request, reply) => {
// const { repoId, branch } = request.query;
// return await Config.findOne({ repoId, branch }).select("-_id -__v");
// });
fastify.post('/', async (request, reply) => {
const { name, organization, branch } = request.body
const services = await docker.engine.listServices()
@@ -79,25 +25,4 @@ module.exports = async function (fastify) {
reply.code(500).send({ message: 'No configuration found.' })
}
})
// fastify.delete("/", async (request, reply) => {
// const { repoId, branch } = request.body;
// const deploys = await Deployment.find({ repoId, branch })
// const found = deploys.filter(d => d.progress !== 'done' && d.progress !== 'failed')
// if (found.length > 0) {
// throw new Error('Deployment inprogress, cannot delete now.');
// }
// const config = await Config.findOneAndDelete({ repoId, branch })
// for (const deploy of deploys) {
// await ApplicationLog.findOneAndRemove({ deployId: deploy.deployId });
// }
// const secrets = await Secret.find({ repoId, branch });
// for (const secret of secrets) {
// await Secret.findByIdAndRemove(secret._id);
// }
// await execShellAsync(`docker stack rm ${config.containerName}`);
// return { message: 'Deleted application and related configurations.' };
// });
}