mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-30 03:25:22 +02:00
[autofix.ci] apply automated fixes
This commit is contained in:
@@ -208,8 +208,10 @@ export const deployApplication = async ({
|
||||
|
||||
// Apply patches after cloning (for non-docker sources only)
|
||||
if (application.sourceType !== "docker") {
|
||||
const patches = await findPatchesByApplicationId(application.applicationId);
|
||||
const enabledPatches = patches.filter(p => p.enabled);
|
||||
const patches = await findPatchesByApplicationId(
|
||||
application.applicationId,
|
||||
);
|
||||
const enabledPatches = patches.filter((p) => p.enabled);
|
||||
if (enabledPatches.length > 0) {
|
||||
command += generateApplyPatchesCommand({
|
||||
appName: application.appName,
|
||||
|
||||
@@ -40,10 +40,7 @@ import {
|
||||
updateDeployment,
|
||||
updateDeploymentStatus,
|
||||
} from "./deployment";
|
||||
import {
|
||||
findPatchesByComposeId,
|
||||
generateApplyPatchesCommand,
|
||||
} from "./patch";
|
||||
import { findPatchesByComposeId, generateApplyPatchesCommand } from "./patch";
|
||||
import { validUniqueServerAppName } from "./project";
|
||||
|
||||
export type Compose = typeof compose.$inferSelect;
|
||||
@@ -255,7 +252,7 @@ export const deployCompose = async ({
|
||||
// Apply patches after cloning (for non-raw sources only)
|
||||
if (compose.sourceType !== "raw") {
|
||||
const patches = await findPatchesByComposeId(compose.composeId);
|
||||
const enabledPatches = patches.filter(p => p.enabled);
|
||||
const enabledPatches = patches.filter((p) => p.enabled);
|
||||
if (enabledPatches.length > 0) {
|
||||
const patchCommand = generateApplyPatchesCommand({
|
||||
appName: compose.appName,
|
||||
|
||||
@@ -76,7 +76,7 @@ echo "Repository cloned successfully";
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// Repo exists - check if on correct branch and update
|
||||
// Repo exists - check if on correct branch and update
|
||||
const updateCommand = `
|
||||
set -e;
|
||||
cd "${repoPath}";
|
||||
@@ -161,7 +161,7 @@ export const readPatchRepoDirectory = async (
|
||||
for (let i = 0; i < parts.length; i++) {
|
||||
const part = parts[i];
|
||||
if (!part) continue;
|
||||
|
||||
|
||||
const isFile = i === parts.length - 1;
|
||||
const parentPath = currentPath;
|
||||
currentPath = currentPath ? `${currentPath}/${part}` : part;
|
||||
@@ -295,7 +295,9 @@ rm -rf "${tempDir}";
|
||||
/**
|
||||
* Clean all patch repos
|
||||
*/
|
||||
export const cleanPatchRepos = async (serverId?: string | null): Promise<void> => {
|
||||
export const cleanPatchRepos = async (
|
||||
serverId?: string | null,
|
||||
): Promise<void> => {
|
||||
const { PATCH_REPOS_PATH } = paths(!!serverId);
|
||||
|
||||
const command = `rm -rf "${PATCH_REPOS_PATH}"/* 2>/dev/null || true`;
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
import { join } from "node:path";
|
||||
import { paths } from "@dokploy/server/constants";
|
||||
import { db } from "@dokploy/server/db";
|
||||
import {
|
||||
type apiCreatePatch,
|
||||
patch,
|
||||
} from "@dokploy/server/db/schema";
|
||||
import { type apiCreatePatch, patch } from "@dokploy/server/db/schema";
|
||||
import {
|
||||
execAsync,
|
||||
execAsyncRemote,
|
||||
@@ -98,10 +95,7 @@ export const findPatchByFilePath = async (
|
||||
return null;
|
||||
};
|
||||
|
||||
export const updatePatch = async (
|
||||
patchId: string,
|
||||
data: Partial<Patch>,
|
||||
) => {
|
||||
export const updatePatch = async (patchId: string, data: Partial<Patch>) => {
|
||||
const result = await db
|
||||
.update(patch)
|
||||
.set({
|
||||
|
||||
Reference in New Issue
Block a user