mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
Merge pull request #828 from Dokploy/feat/custom-heroku-version
Feat/custom heroku version
This commit is contained in:
@@ -41,6 +41,7 @@ const mySchema = z.discriminatedUnion("buildType", [
|
|||||||
}),
|
}),
|
||||||
z.object({
|
z.object({
|
||||||
buildType: z.literal("heroku_buildpacks"),
|
buildType: z.literal("heroku_buildpacks"),
|
||||||
|
herokuVersion: z.string().nullable().default(""),
|
||||||
}),
|
}),
|
||||||
z.object({
|
z.object({
|
||||||
buildType: z.literal("paketo_buildpacks"),
|
buildType: z.literal("paketo_buildpacks"),
|
||||||
@@ -90,6 +91,13 @@ export const ShowBuildChooseForm = ({ applicationId }: Props) => {
|
|||||||
dockerBuildStage: data.dockerBuildStage || "",
|
dockerBuildStage: data.dockerBuildStage || "",
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
} else if (data.buildType === "heroku_buildpacks") {
|
||||||
|
form.reset({
|
||||||
|
buildType: data.buildType,
|
||||||
|
...(data.buildType && {
|
||||||
|
herokuVersion: data.herokuVersion || "",
|
||||||
|
}),
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
form.reset({
|
form.reset({
|
||||||
buildType: data.buildType,
|
buildType: data.buildType,
|
||||||
@@ -110,6 +118,8 @@ export const ShowBuildChooseForm = ({ applicationId }: Props) => {
|
|||||||
data.buildType === "dockerfile" ? data.dockerContextPath : null,
|
data.buildType === "dockerfile" ? data.dockerContextPath : null,
|
||||||
dockerBuildStage:
|
dockerBuildStage:
|
||||||
data.buildType === "dockerfile" ? data.dockerBuildStage : null,
|
data.buildType === "dockerfile" ? data.dockerBuildStage : null,
|
||||||
|
herokuVersion:
|
||||||
|
data.buildType === "heroku_buildpacks" ? data.herokuVersion : null,
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
toast.success("Build type saved");
|
toast.success("Build type saved");
|
||||||
@@ -200,6 +210,28 @@ export const ShowBuildChooseForm = ({ applicationId }: Props) => {
|
|||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
{buildType === "heroku_buildpacks" && (
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="herokuVersion"
|
||||||
|
render={({ field }) => {
|
||||||
|
return (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>Heroku Version (Optional)</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input
|
||||||
|
placeholder={"Heroku Version (Default: 24)"}
|
||||||
|
{...field}
|
||||||
|
value={field.value ?? ""}
|
||||||
|
/>
|
||||||
|
</FormControl>
|
||||||
|
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
{buildType === "dockerfile" && (
|
{buildType === "dockerfile" && (
|
||||||
<>
|
<>
|
||||||
<FormField
|
<FormField
|
||||||
|
|||||||
1
apps/dokploy/drizzle/0047_tidy_revanche.sql
Normal file
1
apps/dokploy/drizzle/0047_tidy_revanche.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
ALTER TABLE "application" ADD COLUMN "herokuVersion" text;
|
||||||
1
apps/dokploy/drizzle/0048_flat_expediter.sql
Normal file
1
apps/dokploy/drizzle/0048_flat_expediter.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
ALTER TABLE "application" ALTER COLUMN "herokuVersion" SET DEFAULT '24';
|
||||||
3993
apps/dokploy/drizzle/meta/0047_snapshot.json
Normal file
3993
apps/dokploy/drizzle/meta/0047_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
3994
apps/dokploy/drizzle/meta/0048_snapshot.json
Normal file
3994
apps/dokploy/drizzle/meta/0048_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -330,6 +330,20 @@
|
|||||||
"when": 1732851191048,
|
"when": 1732851191048,
|
||||||
"tag": "0046_purple_sleeper",
|
"tag": "0046_purple_sleeper",
|
||||||
"breakpoints": true
|
"breakpoints": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idx": 47,
|
||||||
|
"version": "6",
|
||||||
|
"when": 1733599090582,
|
||||||
|
"tag": "0047_tidy_revanche",
|
||||||
|
"breakpoints": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idx": 48,
|
||||||
|
"version": "6",
|
||||||
|
"when": 1733599163710,
|
||||||
|
"tag": "0048_flat_expediter",
|
||||||
|
"breakpoints": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -296,6 +296,7 @@ export const applicationRouter = createTRPCRouter({
|
|||||||
publishDirectory: input.publishDirectory,
|
publishDirectory: input.publishDirectory,
|
||||||
dockerContextPath: input.dockerContextPath,
|
dockerContextPath: input.dockerContextPath,
|
||||||
dockerBuildStage: input.dockerBuildStage,
|
dockerBuildStage: input.dockerBuildStage,
|
||||||
|
herokuVersion: input.herokuVersion,
|
||||||
});
|
});
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -178,6 +178,7 @@ export const applications = pgTable("application", {
|
|||||||
.notNull()
|
.notNull()
|
||||||
.default("idle"),
|
.default("idle"),
|
||||||
buildType: buildType("buildType").notNull().default("nixpacks"),
|
buildType: buildType("buildType").notNull().default("nixpacks"),
|
||||||
|
herokuVersion: text("herokuVersion").default("24"),
|
||||||
publishDirectory: text("publishDirectory"),
|
publishDirectory: text("publishDirectory"),
|
||||||
createdAt: text("createdAt")
|
createdAt: text("createdAt")
|
||||||
.notNull()
|
.notNull()
|
||||||
@@ -368,6 +369,7 @@ const createSchema = createInsertSchema(applications, {
|
|||||||
"nixpacks",
|
"nixpacks",
|
||||||
"static",
|
"static",
|
||||||
]),
|
]),
|
||||||
|
herokuVersion: z.string().optional(),
|
||||||
publishDirectory: z.string().optional(),
|
publishDirectory: z.string().optional(),
|
||||||
owner: z.string(),
|
owner: z.string(),
|
||||||
healthCheckSwarm: HealthCheckSwarmSchema.nullable(),
|
healthCheckSwarm: HealthCheckSwarmSchema.nullable(),
|
||||||
@@ -408,6 +410,7 @@ export const apiSaveBuildType = createSchema
|
|||||||
dockerfile: true,
|
dockerfile: true,
|
||||||
dockerContextPath: true,
|
dockerContextPath: true,
|
||||||
dockerBuildStage: true,
|
dockerBuildStage: true,
|
||||||
|
herokuVersion: true,
|
||||||
})
|
})
|
||||||
.required()
|
.required()
|
||||||
.merge(createSchema.pick({ publishDirectory: true }));
|
.merge(createSchema.pick({ publishDirectory: true }));
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export const buildHeroku = async (
|
|||||||
"--path",
|
"--path",
|
||||||
buildAppDirectory,
|
buildAppDirectory,
|
||||||
"--builder",
|
"--builder",
|
||||||
"heroku/builder:24",
|
`heroku/builder:${application.herokuVersion || "24"}`,
|
||||||
];
|
];
|
||||||
|
|
||||||
for (const env of envVariables) {
|
for (const env of envVariables) {
|
||||||
@@ -58,7 +58,7 @@ export const getHerokuCommand = (
|
|||||||
"--path",
|
"--path",
|
||||||
buildAppDirectory,
|
buildAppDirectory,
|
||||||
"--builder",
|
"--builder",
|
||||||
"heroku/builder:24",
|
`heroku/builder:${application.herokuVersion || "24"}`,
|
||||||
];
|
];
|
||||||
|
|
||||||
for (const env of envVariables) {
|
for (const env of envVariables) {
|
||||||
|
|||||||
Reference in New Issue
Block a user