fixes related to docker-compose
This commit is contained in:
@@ -28,12 +28,15 @@
|
||||
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)) {
|
||||
let composeConfiguration: any = {};
|
||||
if (!dockerComposeConfiguration && dockerComposeFile && buildPack.name === 'compose') {
|
||||
const parsed = JSON.parse(dockerComposeFile);
|
||||
if (!parsed?.services) {
|
||||
throw new Error('No services found in docker-compose file. <br>Choose a different buildpack.');
|
||||
}
|
||||
for (const [name, _] of Object.entries(parsed.services)) {
|
||||
composeConfiguration[name] = {};
|
||||
}
|
||||
|
||||
}
|
||||
await post(`/applications/${id}`, {
|
||||
...tempBuildPack,
|
||||
|
@@ -366,6 +366,10 @@
|
||||
async function reloadCompose() {
|
||||
if (loading.reloadCompose) return;
|
||||
loading.reloadCompose = true;
|
||||
if (!$appSession.tokens.github) {
|
||||
const { token } = await get(`/applications/${id}/configuration/githubToken`);
|
||||
$appSession.tokens.github = token;
|
||||
}
|
||||
try {
|
||||
if (application.gitSource.type === 'github') {
|
||||
const composeLocation = application.dockerComposeFileLocation.startsWith('/')
|
||||
|
@@ -21,7 +21,7 @@
|
||||
onMount(async () => {
|
||||
const response = await get(`/applications/${id}`);
|
||||
application = response.application;
|
||||
if (response.application.dockerComposeFile) {
|
||||
if (response.application.dockerComposeFile && application.buildPack === 'compose') {
|
||||
services = normalizeDockerServices(
|
||||
JSON.parse(response.application.dockerComposeFile).services
|
||||
);
|
||||
|
@@ -55,7 +55,7 @@
|
||||
onMount(async () => {
|
||||
const response = await get(`/applications/${id}`);
|
||||
application = response.application;
|
||||
if (response.application.dockerComposeFile) {
|
||||
if (response.application.dockerComposeFile && application.buildPack === 'compose') {
|
||||
services = normalizeDockerServices(
|
||||
JSON.parse(response.application.dockerComposeFile).services
|
||||
);
|
||||
|
Reference in New Issue
Block a user