refactor: update application deployment logic to utilize environment context for project name and organization ID, enhancing clarity and consistency across services

This commit is contained in:
Mauricio Siu
2025-09-01 22:51:35 -06:00
parent de3c845ab0
commit 3e7eff11cd
3 changed files with 13 additions and 22 deletions

View File

@@ -17,22 +17,13 @@ import { buildNixpacks, getNixpacksCommand } from "./nixpacks";
import { buildPaketo, getPaketoCommand } from "./paketo";
import { buildRailpack, getRailpackCommand } from "./railpack";
import { buildStatic, getStaticCommand } from "./static";
import { findApplicationById } from "@dokploy/server/services/application";
// NIXPACKS codeDirectory = where is the path of the code directory
// HEROKU codeDirectory = where is the path of the code directory
// PAKETO codeDirectory = where is the path of the code directory
// DOCKERFILE codeDirectory = where is the exact path of the (Dockerfile)
export type ApplicationNested = InferResultType<
"applications",
{
mounts: true;
security: true;
redirects: true;
ports: true;
registry: true;
project: true;
}
>;
export type ApplicationNested = Awaited<ReturnType<typeof findApplicationById>>;
export const buildApplication = async (
application: ApplicationNested,
@@ -148,7 +139,7 @@ export const mechanizeDockerContainer = async (
const filesMount = generateFileMounts(appName, application);
const envVariables = prepareEnvironmentVariables(
env,
application.project.env,
application.environment.project.env,
);
const image = getImageName(application);

View File

@@ -26,7 +26,7 @@ export const buildRailpack = async (
const buildAppDirectory = getBuildAppDirectory(application);
const envVariables = prepareEnvironmentVariables(
env,
application.project.env,
application.environment.project.env,
);
try {
@@ -123,7 +123,7 @@ export const getRailpackCommand = (
const buildAppDirectory = getBuildAppDirectory(application);
const envVariables = prepareEnvironmentVariables(
env,
application.project.env,
application.environment.project.env,
);
// Prepare command