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
|
||||
let publishDirectory = undefined;
|
||||
let port = undefined
|
||||
const { baseImage, baseBuildImage, baseBuildImages, baseImages, } = setDefaultBaseImage(
|
||||
const { baseImage, baseBuildImage, baseBuildImages, baseImages } = setDefaultBaseImage(
|
||||
buildPack, deploymentType
|
||||
);
|
||||
if (buildPack === 'nextjs') {
|
||||
@ -56,8 +56,7 @@ export async function getImages(request: FastifyRequest<GetImages>) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return { baseBuildImage, baseBuildImages, publishDirectory, port }
|
||||
return { baseImage, baseImages, baseBuildImage, baseBuildImages, publishDirectory, port }
|
||||
} catch ({ status, message }) {
|
||||
return errorHandler({ status, message })
|
||||
}
|
||||
@ -232,7 +231,6 @@ export async function saveApplication(request: FastifyRequest<SaveApplication>,
|
||||
baseBuildImage,
|
||||
deploymentType
|
||||
} = request.body
|
||||
|
||||
if (port) port = Number(port);
|
||||
if (exposePort) {
|
||||
exposePort = Number(exposePort);
|
||||
|
@ -114,10 +114,30 @@
|
||||
buildPack: application.buildPack,
|
||||
deploymentType: application.deploymentType
|
||||
});
|
||||
application = {
|
||||
...application,
|
||||
...data
|
||||
};
|
||||
const baseImageCorrect = data.baseImages.filter(
|
||||
(image: any) => image.value === application.baseImage
|
||||
);
|
||||
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) {
|
||||
if (name === 'debug') {
|
||||
@ -631,9 +651,7 @@
|
||||
bind:value={application.port}
|
||||
placeholder="{$t('forms.default')}: 'python' ? '8000' : '3000'"
|
||||
/>
|
||||
<Explainer
|
||||
text={'The port your application listens on.'}
|
||||
/>
|
||||
<Explainer text={'The port your application listens on.'} />
|
||||
</div>
|
||||
{/if}
|
||||
<div class="grid grid-cols-2 items-center">
|
||||
|
Loading…
x
Reference in New Issue
Block a user