refactor(multi server): rename functions

This commit is contained in:
Mauricio Siu 2024-09-21 02:10:25 -06:00
parent 8bf6a22db8
commit 698ff9e918
2 changed files with 2 additions and 7 deletions

View File

@ -358,7 +358,6 @@ export const settingsRouter = createTRPCRouter({
if (input?.serverId) { if (input?.serverId) {
const result = await execAsyncRemote(input.serverId, command); const result = await execAsyncRemote(input.serverId, command);
console.log(result);
return result.stdout.trim(); return result.stdout.trim();
} }
const result = await execAsync(command); const result = await execAsync(command);
@ -393,8 +392,6 @@ export const settingsRouter = createTRPCRouter({
} }
const parsed: any[] = JSON.parse(stdout.trim()); const parsed: any[] = JSON.parse(stdout.trim());
console.log(parsed);
for (const port of parsed) { for (const port of parsed) {
if (port.PublishedPort === 8080) { if (port.PublishedPort === 8080) {
return true; return true;

View File

@ -34,8 +34,7 @@ export const setupServer = async (serverId: string) => {
const writeStream = createWriteStream(deployment.logPath, { flags: "a" }); const writeStream = createWriteStream(deployment.logPath, { flags: "a" });
try { try {
writeStream.write("\nInstalling Server Dependencies: ✅\n"); writeStream.write("\nInstalling Server Dependencies: ✅\n");
await connectToServer(serverId, deployment.logPath); await installRequirements(serverId, deployment.logPath);
writeStream.close(); writeStream.close();
await updateDeploymentStatus(deployment.deploymentId, "done"); await updateDeploymentStatus(deployment.deploymentId, "done");
@ -47,7 +46,7 @@ export const setupServer = async (serverId: string) => {
} }
}; };
const connectToServer = async (serverId: string, logPath: string) => { const installRequirements = async (serverId: string, logPath: string) => {
const writeStream = createWriteStream(logPath, { flags: "a" }); const writeStream = createWriteStream(logPath, { flags: "a" });
const client = new Client(); const client = new Client();
const server = await findServerById(serverId); const server = await findServerById(serverId);
@ -276,7 +275,6 @@ export const createTraefikInstance = () => {
--label traefik.enable=true \ --label traefik.enable=true \
--publish mode=host,target=443,published=443 \ --publish mode=host,target=443,published=443 \
--publish mode=host,target=80,published=80 \ --publish mode=host,target=80,published=80 \
--publish mode=host,target=8080,published=8080 \
traefik:v3.1.2 traefik:v3.1.2
fi fi
`; `;