fix: next/nuxt deployment type
This commit is contained in:
parent
6760d7e776
commit
d7fd1fc65b
@ -34,7 +34,7 @@ export async function getImages(request: FastifyRequest<GetImages>) {
|
|||||||
const { buildPack, deploymentType } = request.body
|
const { buildPack, deploymentType } = request.body
|
||||||
let publishDirectory = undefined;
|
let publishDirectory = undefined;
|
||||||
let port = undefined
|
let port = undefined
|
||||||
const { baseImage, baseBuildImage, baseBuildImages, baseImages, } = setDefaultBaseImage(
|
const { baseImage, baseBuildImage, baseBuildImages, baseImages } = setDefaultBaseImage(
|
||||||
buildPack, deploymentType
|
buildPack, deploymentType
|
||||||
);
|
);
|
||||||
if (buildPack === 'nextjs') {
|
if (buildPack === 'nextjs') {
|
||||||
@ -56,8 +56,7 @@ export async function getImages(request: FastifyRequest<GetImages>) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return { baseImage, baseImages, baseBuildImage, baseBuildImages, publishDirectory, port }
|
||||||
return { baseBuildImage, baseBuildImages, publishDirectory, port }
|
|
||||||
} catch ({ status, message }) {
|
} catch ({ status, message }) {
|
||||||
return errorHandler({ status, message })
|
return errorHandler({ status, message })
|
||||||
}
|
}
|
||||||
@ -232,7 +231,6 @@ export async function saveApplication(request: FastifyRequest<SaveApplication>,
|
|||||||
baseBuildImage,
|
baseBuildImage,
|
||||||
deploymentType
|
deploymentType
|
||||||
} = request.body
|
} = request.body
|
||||||
|
|
||||||
if (port) port = Number(port);
|
if (port) port = Number(port);
|
||||||
if (exposePort) {
|
if (exposePort) {
|
||||||
exposePort = Number(exposePort);
|
exposePort = Number(exposePort);
|
||||||
|
@ -114,10 +114,30 @@
|
|||||||
buildPack: application.buildPack,
|
buildPack: application.buildPack,
|
||||||
deploymentType: application.deploymentType
|
deploymentType: application.deploymentType
|
||||||
});
|
});
|
||||||
application = {
|
const baseImageCorrect = data.baseImages.filter(
|
||||||
...application,
|
(image: any) => image.value === application.baseImage
|
||||||
...data
|
);
|
||||||
};
|
if (baseImageCorrect.length === 0) {
|
||||||
|
application.baseImage = data.baseImage;
|
||||||
|
}
|
||||||
|
application.baseImages = data.baseImages;
|
||||||
|
|
||||||
|
const baseBuildImageCorrect = data.baseBuildImages.filter(
|
||||||
|
(image: any) => image.value === application.baseBuildImage
|
||||||
|
);
|
||||||
|
if (baseBuildImageCorrect.length === 0) {
|
||||||
|
application.baseBuildImage = data.baseBuildImage;
|
||||||
|
}
|
||||||
|
application.baseBuildImages = data.baseBuildImages;
|
||||||
|
if (application.deploymentType === 'static' && application.port !== '80') {
|
||||||
|
application.port = data.port;
|
||||||
|
}
|
||||||
|
if (application.deploymentType === 'node' && application.port === '80') {
|
||||||
|
application.port = data.port;
|
||||||
|
}
|
||||||
|
if (!application.publishDirectory) {
|
||||||
|
application.publishDirectory = data.publishDirectory;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
async function changeSettings(name: any) {
|
async function changeSettings(name: any) {
|
||||||
if (name === 'debug') {
|
if (name === 'debug') {
|
||||||
@ -631,9 +651,7 @@
|
|||||||
bind:value={application.port}
|
bind:value={application.port}
|
||||||
placeholder="{$t('forms.default')}: 'python' ? '8000' : '3000'"
|
placeholder="{$t('forms.default')}: 'python' ? '8000' : '3000'"
|
||||||
/>
|
/>
|
||||||
<Explainer
|
<Explainer text={'The port your application listens on.'} />
|
||||||
text={'The port your application listens on.'}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
<div class="grid grid-cols-2 items-center">
|
<div class="grid grid-cols-2 items-center">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user