feat: docker compose

This commit is contained in:
Andras Bacsai
2022-10-06 15:51:08 +02:00
parent 0c4850b91d
commit 9bb125cebd
14 changed files with 227 additions and 473 deletions

View File

@@ -14,8 +14,9 @@
export let foundConfig: any;
export let scanning: any;
export let packageManager: any;
export let dockerComposeFile: any = null;
export let dockerComposeFile: string | null = null;
export let dockerComposeFileLocation: string | null = null;
export let dockerComposeConfiguration: any = null;
async function handleSubmit(name: string) {
try {
@@ -27,11 +28,19 @@
delete tempBuildPack.fancyName;
delete tempBuildPack.color;
delete tempBuildPack.hoverColor;
let composeConfiguration: any = {}
if (!dockerComposeConfiguration && dockerComposeFile) {
for (const [name, _] of Object.entries(JSON.parse(dockerComposeFile).services)) {
composeConfiguration[name] = {};
}
}
await post(`/applications/${id}`, {
...tempBuildPack,
buildPack: name,
dockerComposeFile,
dockerComposeFileLocation
dockerComposeFileLocation,
dockerComposeConfiguration: JSON.stringify(composeConfiguration) || JSON.stringify({})
});
await post(`/applications/${id}/configuration/buildpack`, { buildPack: name });
return await goto(from || `/applications/${id}`);