mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-01 17:52:17 +00:00
[autofix.ci] apply automated fixes
This commit is contained in:
@@ -216,7 +216,8 @@ echo "$json_output"
|
|||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const cleanupFullDocker = async (serverId?: string) => cleanupAll(serverId);
|
export const cleanupFullDocker = async (serverId?: string) =>
|
||||||
|
cleanupAll(serverId);
|
||||||
|
|
||||||
export const getDockerResourceType = async (
|
export const getDockerResourceType = async (
|
||||||
resourceName: string,
|
resourceName: string,
|
||||||
|
|||||||
@@ -6,9 +6,7 @@ import { eq } from "drizzle-orm";
|
|||||||
import { scheduleJob } from "node-schedule";
|
import { scheduleJob } from "node-schedule";
|
||||||
import { db } from "../../db/index";
|
import { db } from "../../db/index";
|
||||||
import { startLogCleanup } from "../access-log/handler";
|
import { startLogCleanup } from "../access-log/handler";
|
||||||
import {
|
import { cleanupAll } from "../docker/utils";
|
||||||
cleanupAll
|
|
||||||
} from "../docker/utils";
|
|
||||||
import { sendDockerCleanupNotifications } from "../notifications/docker-cleanup";
|
import { sendDockerCleanupNotifications } from "../notifications/docker-cleanup";
|
||||||
import { execAsync, execAsyncRemote } from "../process/execAsync";
|
import { execAsync, execAsyncRemote } from "../process/execAsync";
|
||||||
import { getS3Credentials, scheduleBackup } from "./utils";
|
import { getS3Credentials, scheduleBackup } from "./utils";
|
||||||
@@ -47,7 +45,7 @@ export const initCronJobs = async () => {
|
|||||||
scheduleJob(serverId, "0 0 * * *", async () => {
|
scheduleJob(serverId, "0 0 * * *", async () => {
|
||||||
console.log(
|
console.log(
|
||||||
`SERVER-BACKUP[${new Date().toLocaleString()}] Running Cleanup ${name}`,
|
`SERVER-BACKUP[${new Date().toLocaleString()}] Running Cleanup ${name}`,
|
||||||
)
|
);
|
||||||
|
|
||||||
await cleanupImages(serverId);
|
await cleanupImages(serverId);
|
||||||
|
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ echo "Execution completed."`;
|
|||||||
export const cleanupContainers = async (serverId?: string) => {
|
export const cleanupContainers = async (serverId?: string) => {
|
||||||
try {
|
try {
|
||||||
const command = "docker container prune --force";
|
const command = "docker container prune --force";
|
||||||
|
|
||||||
if (serverId) {
|
if (serverId) {
|
||||||
await execAsyncRemote(serverId, dockerSafeExec(command));
|
await execAsyncRemote(serverId, dockerSafeExec(command));
|
||||||
} else await execAsync(dockerSafeExec(command));
|
} else await execAsync(dockerSafeExec(command));
|
||||||
@@ -183,7 +183,7 @@ export const cleanupContainers = async (serverId?: string) => {
|
|||||||
export const cleanupImages = async (serverId?: string) => {
|
export const cleanupImages = async (serverId?: string) => {
|
||||||
try {
|
try {
|
||||||
const command = "docker image prune --all --force";
|
const command = "docker image prune --all --force";
|
||||||
|
|
||||||
if (serverId) {
|
if (serverId) {
|
||||||
await execAsyncRemote(serverId, dockerSafeExec(command));
|
await execAsyncRemote(serverId, dockerSafeExec(command));
|
||||||
} else await execAsync(dockerSafeExec(command));
|
} else await execAsync(dockerSafeExec(command));
|
||||||
@@ -197,7 +197,7 @@ export const cleanupImages = async (serverId?: string) => {
|
|||||||
export const cleanupVolumes = async (serverId?: string) => {
|
export const cleanupVolumes = async (serverId?: string) => {
|
||||||
try {
|
try {
|
||||||
const command = "docker volume prune --all --force";
|
const command = "docker volume prune --all --force";
|
||||||
|
|
||||||
if (serverId) {
|
if (serverId) {
|
||||||
await execAsyncRemote(serverId, dockerSafeExec(command));
|
await execAsyncRemote(serverId, dockerSafeExec(command));
|
||||||
} else await execAsync(dockerSafeExec(command));
|
} else await execAsync(dockerSafeExec(command));
|
||||||
@@ -211,7 +211,7 @@ export const cleanupVolumes = async (serverId?: string) => {
|
|||||||
export const cleanupBuilders = async (serverId?: string) => {
|
export const cleanupBuilders = async (serverId?: string) => {
|
||||||
try {
|
try {
|
||||||
const command = "docker builder prune --all --force";
|
const command = "docker builder prune --all --force";
|
||||||
|
|
||||||
if (serverId) {
|
if (serverId) {
|
||||||
await execAsyncRemote(serverId, dockerSafeExec(command));
|
await execAsyncRemote(serverId, dockerSafeExec(command));
|
||||||
} else await execAsync(dockerSafeExec(command));
|
} else await execAsync(dockerSafeExec(command));
|
||||||
@@ -225,7 +225,7 @@ export const cleanupBuilders = async (serverId?: string) => {
|
|||||||
export const cleanupSystem = async (serverId?: string) => {
|
export const cleanupSystem = async (serverId?: string) => {
|
||||||
try {
|
try {
|
||||||
const command = "docker system prune --all --volumes --force";
|
const command = "docker system prune --all --volumes --force";
|
||||||
|
|
||||||
if (serverId) {
|
if (serverId) {
|
||||||
await execAsyncRemote(serverId, dockerSafeExec(command));
|
await execAsyncRemote(serverId, dockerSafeExec(command));
|
||||||
} else await execAsync(dockerSafeExec(command));
|
} else await execAsync(dockerSafeExec(command));
|
||||||
@@ -260,7 +260,7 @@ export const cleanupAll = async (serverId?: string) => {
|
|||||||
await cleanupBuilders(serverId);
|
await cleanupBuilders(serverId);
|
||||||
await cleanupSystem(serverId);
|
await cleanupSystem(serverId);
|
||||||
await cleanupInactiveContainers();
|
await cleanupInactiveContainers();
|
||||||
}
|
};
|
||||||
|
|
||||||
export const startService = async (appName: string) => {
|
export const startService = async (appName: string) => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user