mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
format: fix formatting
This commit is contained in:
parent
fa710d4855
commit
c6892ba188
@ -83,7 +83,7 @@ export const createCompose = async (input: typeof apiCreateCompose._type) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const createComposeByTemplate = async (
|
export const createComposeByTemplate = async (
|
||||||
input: typeof compose.$inferInsert
|
input: typeof compose.$inferInsert,
|
||||||
) => {
|
) => {
|
||||||
const appName = cleanAppName(input.appName);
|
const appName = cleanAppName(input.appName);
|
||||||
if (appName) {
|
if (appName) {
|
||||||
@ -140,7 +140,7 @@ export const findComposeById = async (composeId: string) => {
|
|||||||
|
|
||||||
export const loadServices = async (
|
export const loadServices = async (
|
||||||
composeId: string,
|
composeId: string,
|
||||||
type: "fetch" | "cache" = "fetch"
|
type: "fetch" | "cache" = "fetch",
|
||||||
) => {
|
) => {
|
||||||
const compose = await findComposeById(composeId);
|
const compose = await findComposeById(composeId);
|
||||||
|
|
||||||
@ -163,7 +163,7 @@ export const loadServices = async (
|
|||||||
if (compose.randomize && composeData) {
|
if (compose.randomize && composeData) {
|
||||||
const randomizedCompose = randomizeSpecificationFile(
|
const randomizedCompose = randomizeSpecificationFile(
|
||||||
composeData,
|
composeData,
|
||||||
compose.suffix
|
compose.suffix,
|
||||||
);
|
);
|
||||||
composeData = randomizedCompose;
|
composeData = randomizedCompose;
|
||||||
}
|
}
|
||||||
@ -182,7 +182,7 @@ export const loadServices = async (
|
|||||||
|
|
||||||
export const updateCompose = async (
|
export const updateCompose = async (
|
||||||
composeId: string,
|
composeId: string,
|
||||||
composeData: Partial<Compose>
|
composeData: Partial<Compose>,
|
||||||
) => {
|
) => {
|
||||||
const { appName, ...rest } = composeData;
|
const { appName, ...rest } = composeData;
|
||||||
const composeResult = await db
|
const composeResult = await db
|
||||||
@ -333,19 +333,19 @@ export const deployRemoteCompose = async ({
|
|||||||
command += await getGitlabCloneCommand(
|
command += await getGitlabCloneCommand(
|
||||||
compose,
|
compose,
|
||||||
deployment.logPath,
|
deployment.logPath,
|
||||||
true
|
true,
|
||||||
);
|
);
|
||||||
} else if (compose.sourceType === "bitbucket") {
|
} else if (compose.sourceType === "bitbucket") {
|
||||||
command += await getBitbucketCloneCommand(
|
command += await getBitbucketCloneCommand(
|
||||||
compose,
|
compose,
|
||||||
deployment.logPath,
|
deployment.logPath,
|
||||||
true
|
true,
|
||||||
);
|
);
|
||||||
} else if (compose.sourceType === "git") {
|
} else if (compose.sourceType === "git") {
|
||||||
command += await getCustomGitCloneCommand(
|
command += await getCustomGitCloneCommand(
|
||||||
compose,
|
compose,
|
||||||
deployment.logPath,
|
deployment.logPath,
|
||||||
true
|
true,
|
||||||
);
|
);
|
||||||
} else if (compose.sourceType === "raw") {
|
} else if (compose.sourceType === "raw") {
|
||||||
command += getCreateComposeFileCommand(compose, deployment.logPath);
|
command += getCreateComposeFileCommand(compose, deployment.logPath);
|
||||||
@ -376,7 +376,7 @@ export const deployRemoteCompose = async ({
|
|||||||
`
|
`
|
||||||
echo "\n\n===================================EXTRA LOGS============================================" >> ${deployment.logPath};
|
echo "\n\n===================================EXTRA LOGS============================================" >> ${deployment.logPath};
|
||||||
echo "Error occurred ❌, check the logs for details." >> ${deployment.logPath};
|
echo "Error occurred ❌, check the logs for details." >> ${deployment.logPath};
|
||||||
echo "${encodedContent}" | base64 -d >> "${deployment.logPath}";`
|
echo "${encodedContent}" | base64 -d >> "${deployment.logPath}";`,
|
||||||
);
|
);
|
||||||
await updateDeploymentStatus(deployment.deploymentId, "error");
|
await updateDeploymentStatus(deployment.deploymentId, "error");
|
||||||
await updateCompose(composeId, {
|
await updateCompose(composeId, {
|
||||||
@ -429,7 +429,7 @@ export const rebuildRemoteCompose = async ({
|
|||||||
`
|
`
|
||||||
echo "\n\n===================================EXTRA LOGS============================================" >> ${deployment.logPath};
|
echo "\n\n===================================EXTRA LOGS============================================" >> ${deployment.logPath};
|
||||||
echo "Error occurred ❌, check the logs for details." >> ${deployment.logPath};
|
echo "Error occurred ❌, check the logs for details." >> ${deployment.logPath};
|
||||||
echo "${encodedContent}" | base64 -d >> "${deployment.logPath}";`
|
echo "${encodedContent}" | base64 -d >> "${deployment.logPath}";`,
|
||||||
);
|
);
|
||||||
await updateDeploymentStatus(deployment.deploymentId, "error");
|
await updateDeploymentStatus(deployment.deploymentId, "error");
|
||||||
await updateCompose(composeId, {
|
await updateCompose(composeId, {
|
||||||
@ -443,7 +443,7 @@ export const rebuildRemoteCompose = async ({
|
|||||||
|
|
||||||
export const removeCompose = async (
|
export const removeCompose = async (
|
||||||
compose: Compose,
|
compose: Compose,
|
||||||
deleteVolumes: boolean
|
deleteVolumes: boolean,
|
||||||
) => {
|
) => {
|
||||||
try {
|
try {
|
||||||
const { COMPOSE_PATH } = paths(!!compose.serverId);
|
const { COMPOSE_PATH } = paths(!!compose.serverId);
|
||||||
@ -496,8 +496,8 @@ export const startCompose = async (composeId: string) => {
|
|||||||
`cd ${join(
|
`cd ${join(
|
||||||
COMPOSE_PATH,
|
COMPOSE_PATH,
|
||||||
compose.appName,
|
compose.appName,
|
||||||
"code"
|
"code",
|
||||||
)} && docker compose -p ${compose.appName} up -d`
|
)} && docker compose -p ${compose.appName} up -d`,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
await execAsync(`docker compose -p ${compose.appName} up -d`, {
|
await execAsync(`docker compose -p ${compose.appName} up -d`, {
|
||||||
@ -529,7 +529,7 @@ export const stopCompose = async (composeId: string) => {
|
|||||||
compose.serverId,
|
compose.serverId,
|
||||||
`cd ${join(COMPOSE_PATH, compose.appName)} && docker compose -p ${
|
`cd ${join(COMPOSE_PATH, compose.appName)} && docker compose -p ${
|
||||||
compose.appName
|
compose.appName
|
||||||
} stop`
|
} stop`,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
await execAsync(`docker compose -p ${compose.appName} stop`, {
|
await execAsync(`docker compose -p ${compose.appName} stop`, {
|
||||||
|
Loading…
Reference in New Issue
Block a user