From 1056810170ae597e9f56f4fbf82f5b738614beea Mon Sep 17 00:00:00 2001 From: idicesystem <79581397+PiyushDixit96@users.noreply.github.com> Date: Sun, 1 Dec 2024 22:07:51 +0530 Subject: [PATCH 1/2] Add support for configurable Heroku stack version Added a new environment variable HEROKU_STACK_VERSION that can be used to specify the desired Heroku stack version. Updated the buildHeroku and getHerokuCommand functions to use the specified stack version, or default to 24 if the environment variable is not set. Provided information about the available Heroku stack versions and their support details, as per the documentation from the Heroku DevCenter. https://devcenter.heroku.com/articles/stack#stack-support-details --- packages/server/src/utils/builders/heroku.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/server/src/utils/builders/heroku.ts b/packages/server/src/utils/builders/heroku.ts index 999b5fe61..21442d9ac 100644 --- a/packages/server/src/utils/builders/heroku.ts +++ b/packages/server/src/utils/builders/heroku.ts @@ -16,13 +16,14 @@ export const buildHeroku = async ( application.project.env, ); try { + const builderVersion = env.HEROKU_STACK_VERSION || '24'; const args = [ "build", appName, "--path", buildAppDirectory, "--builder", - "heroku/builder:24", + `heroku/builder:${builderVersion}`, ]; for (const env of envVariables) { @@ -52,13 +53,14 @@ export const getHerokuCommand = ( application.project.env, ); + const builderVersion = env.HEROKU_STACK_VERSION || '24'; const args = [ "build", appName, "--path", buildAppDirectory, "--builder", - "heroku/builder:24", + `heroku/builder:${builderVersion}`, ]; for (const env of envVariables) { From 4c45be14474e9f5bef230c05366b8493294d7f77 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sat, 7 Dec 2024 13:27:54 -0600 Subject: [PATCH 2/2] feat: add heroku version field --- .../dashboard/application/build/show.tsx | 32 + apps/dokploy/drizzle/0047_tidy_revanche.sql | 1 + apps/dokploy/drizzle/0048_flat_expediter.sql | 1 + apps/dokploy/drizzle/meta/0047_snapshot.json | 3993 ++++++++++++++++ apps/dokploy/drizzle/meta/0048_snapshot.json | 3994 +++++++++++++++++ apps/dokploy/drizzle/meta/_journal.json | 14 + .../dokploy/server/api/routers/application.ts | 1 + packages/server/src/db/schema/application.ts | 3 + packages/server/src/utils/builders/heroku.ts | 6 +- 9 files changed, 8041 insertions(+), 4 deletions(-) create mode 100644 apps/dokploy/drizzle/0047_tidy_revanche.sql create mode 100644 apps/dokploy/drizzle/0048_flat_expediter.sql create mode 100644 apps/dokploy/drizzle/meta/0047_snapshot.json create mode 100644 apps/dokploy/drizzle/meta/0048_snapshot.json diff --git a/apps/dokploy/components/dashboard/application/build/show.tsx b/apps/dokploy/components/dashboard/application/build/show.tsx index 4bd4ddd7b..edfb38ae8 100644 --- a/apps/dokploy/components/dashboard/application/build/show.tsx +++ b/apps/dokploy/components/dashboard/application/build/show.tsx @@ -41,6 +41,7 @@ const mySchema = z.discriminatedUnion("buildType", [ }), z.object({ buildType: z.literal("heroku_buildpacks"), + herokuVersion: z.string().nullable().default(""), }), z.object({ buildType: z.literal("paketo_buildpacks"), @@ -90,6 +91,13 @@ export const ShowBuildChooseForm = ({ applicationId }: Props) => { dockerBuildStage: data.dockerBuildStage || "", }), }); + } else if (data.buildType === "heroku_buildpacks") { + form.reset({ + buildType: data.buildType, + ...(data.buildType && { + herokuVersion: data.herokuVersion || "", + }), + }); } else { form.reset({ buildType: data.buildType, @@ -110,6 +118,8 @@ export const ShowBuildChooseForm = ({ applicationId }: Props) => { data.buildType === "dockerfile" ? data.dockerContextPath : null, dockerBuildStage: data.buildType === "dockerfile" ? data.dockerBuildStage : null, + herokuVersion: + data.buildType === "heroku_buildpacks" ? data.herokuVersion : null, }) .then(async () => { toast.success("Build type saved"); @@ -200,6 +210,28 @@ export const ShowBuildChooseForm = ({ applicationId }: Props) => { ); }} /> + {buildType === "heroku_buildpacks" && ( + { + return ( + + Heroku Version (Optional) + + + + + + + ); + }} + /> + )} {buildType === "dockerfile" && ( <>