mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-21 19:38:47 +00:00
fix(build): set default railpackVersion to '0.2.2' and ensure cleanup in build process
- Updated the ShowBuildChooseForm component to default railpackVersion to '0.2.2' if not specified. - Added cleanup step in the buildRailpack function to remove the builder container after execution. - Refactored application router to include railpackVersion in the application schema.
This commit is contained in:
@@ -185,7 +185,9 @@ export const ShowBuildChooseForm = ({ applicationId }: Props) => {
|
|||||||
isStaticSpa:
|
isStaticSpa:
|
||||||
data.buildType === BuildType.static ? data.isStaticSpa : null,
|
data.buildType === BuildType.static ? data.isStaticSpa : null,
|
||||||
railpackVersion:
|
railpackVersion:
|
||||||
data.buildType === BuildType.railpack ? data.railpackVersion : null,
|
data.buildType === BuildType.railpack
|
||||||
|
? data.railpackVersion || "0.2.2"
|
||||||
|
: null,
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
toast.success("Build type saved");
|
toast.success("Build type saved");
|
||||||
|
|||||||
@@ -1,31 +1,4 @@
|
|||||||
import {
|
import {
|
||||||
createTRPCRouter,
|
|
||||||
protectedProcedure,
|
|
||||||
uploadProcedure,
|
|
||||||
} from "@/server/api/trpc";
|
|
||||||
import { db } from "@/server/db";
|
|
||||||
import {
|
|
||||||
apiCreateApplication,
|
|
||||||
apiFindMonitoringStats,
|
|
||||||
apiFindOneApplication,
|
|
||||||
apiReloadApplication,
|
|
||||||
apiSaveBitbucketProvider,
|
|
||||||
apiSaveBuildType,
|
|
||||||
apiSaveDockerProvider,
|
|
||||||
apiSaveEnvironmentVariables,
|
|
||||||
apiSaveGitProvider,
|
|
||||||
apiSaveGiteaProvider,
|
|
||||||
apiSaveGithubProvider,
|
|
||||||
apiSaveGitlabProvider,
|
|
||||||
apiUpdateApplication,
|
|
||||||
applications,
|
|
||||||
} from "@/server/db/schema";
|
|
||||||
import type { DeploymentJob } from "@/server/queues/queue-types";
|
|
||||||
import { cleanQueuesByApplication, myQueue } from "@/server/queues/queueSetup";
|
|
||||||
import { deploy } from "@/server/utils/deploy";
|
|
||||||
import { uploadFileSchema } from "@/utils/schema";
|
|
||||||
import {
|
|
||||||
IS_CLOUD,
|
|
||||||
addNewService,
|
addNewService,
|
||||||
checkServiceAccess,
|
checkServiceAccess,
|
||||||
createApplication,
|
createApplication,
|
||||||
@@ -34,6 +7,7 @@ import {
|
|||||||
findGitProviderById,
|
findGitProviderById,
|
||||||
findProjectById,
|
findProjectById,
|
||||||
getApplicationStats,
|
getApplicationStats,
|
||||||
|
IS_CLOUD,
|
||||||
mechanizeDockerContainer,
|
mechanizeDockerContainer,
|
||||||
readConfig,
|
readConfig,
|
||||||
readRemoteConfig,
|
readRemoteConfig,
|
||||||
@@ -57,6 +31,32 @@ import { TRPCError } from "@trpc/server";
|
|||||||
import { eq } from "drizzle-orm";
|
import { eq } from "drizzle-orm";
|
||||||
import { nanoid } from "nanoid";
|
import { nanoid } from "nanoid";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
import {
|
||||||
|
createTRPCRouter,
|
||||||
|
protectedProcedure,
|
||||||
|
uploadProcedure,
|
||||||
|
} from "@/server/api/trpc";
|
||||||
|
import { db } from "@/server/db";
|
||||||
|
import {
|
||||||
|
apiCreateApplication,
|
||||||
|
apiFindMonitoringStats,
|
||||||
|
apiFindOneApplication,
|
||||||
|
apiReloadApplication,
|
||||||
|
apiSaveBitbucketProvider,
|
||||||
|
apiSaveBuildType,
|
||||||
|
apiSaveDockerProvider,
|
||||||
|
apiSaveEnvironmentVariables,
|
||||||
|
apiSaveGiteaProvider,
|
||||||
|
apiSaveGithubProvider,
|
||||||
|
apiSaveGitlabProvider,
|
||||||
|
apiSaveGitProvider,
|
||||||
|
apiUpdateApplication,
|
||||||
|
applications,
|
||||||
|
} from "@/server/db/schema";
|
||||||
|
import type { DeploymentJob } from "@/server/queues/queue-types";
|
||||||
|
import { cleanQueuesByApplication, myQueue } from "@/server/queues/queueSetup";
|
||||||
|
import { deploy } from "@/server/utils/deploy";
|
||||||
|
import { uploadFileSchema } from "@/utils/schema";
|
||||||
|
|
||||||
export const applicationRouter = createTRPCRouter({
|
export const applicationRouter = createTRPCRouter({
|
||||||
create: protectedProcedure
|
create: protectedProcedure
|
||||||
@@ -364,6 +364,7 @@ export const applicationRouter = createTRPCRouter({
|
|||||||
dockerBuildStage: input.dockerBuildStage,
|
dockerBuildStage: input.dockerBuildStage,
|
||||||
herokuVersion: input.herokuVersion,
|
herokuVersion: input.herokuVersion,
|
||||||
isStaticSpa: input.isStaticSpa,
|
isStaticSpa: input.isStaticSpa,
|
||||||
|
railpackVersion: input.railpackVersion,
|
||||||
});
|
});
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -110,6 +110,8 @@ export const buildRailpack = async (
|
|||||||
return true;
|
return true;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw e;
|
throw e;
|
||||||
|
} finally {
|
||||||
|
await execAsync("docker buildx rm builder-containerd");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user