Download data/apps/dokploy/server/utils/deploy.ts from llama1/dokpl0y: direct link, hf CLI and curl.
- Browser
- Download file 666 Bytes
-
https://huggingface.co/datasets/llama1/dokpl0y/resolve/main/data/apps/dokploy/server/utils/deploy.ts
- Command line
-
hf download hf://datasets/llama1/dokpl0y/data/apps/dokploy/server/utils/deploy.ts
-
curl -L -o deploy.ts https://huggingface.co/datasets/llama1/dokpl0y/resolve/main/data/apps/dokploy/server/utils/deploy.ts
666 Bytes
| import { findServerById } from "@dokploy/server"; | |
| import type { DeploymentJob } from "../queues/queue-types"; | |
| export const deploy = async (jobData: DeploymentJob) => { | |
| try { | |
| const server = await findServerById(jobData.serverId as string); | |
| if (server.serverStatus === "inactive") { | |
| throw new Error("Server is inactive"); | |
| } | |
| const result = await fetch(`${process.env.SERVER_URL}/deploy`, { | |
| method: "POST", | |
| headers: { | |
| "Content-Type": "application/json", | |
| "X-API-Key": process.env.API_KEY || "NO-DEFINED", | |
| }, | |
| body: JSON.stringify(jobData), | |
| }); | |
| const data = await result.json(); | |
| return data; | |
| } catch (error) { | |
| throw error; | |
| } | |
| }; | |