diff --git a/packages/server/src/utils/builders/index.ts b/packages/server/src/utils/builders/index.ts index 9baf73a3..198b953d 100644 --- a/packages/server/src/utils/builders/index.ts +++ b/packages/server/src/utils/builders/index.ts @@ -113,10 +113,6 @@ export const getBuildCommand = ( export const mechanizeDockerContainer = async ( application: ApplicationNested, ) => { - console.log( - `Starting to mechanize Docker container for ${application.appName}`, - ); - const { appName, env, @@ -197,10 +193,8 @@ export const mechanizeDockerContainer = async ( }; try { - console.log(`Attempting to find existing service: ${appName}`); const service = docker.getService(appName); const inspect = await service.inspect(); - console.log(`Found existing service, updating: ${appName}`); await service.update({ version: Number.parseInt(inspect.Version.Index), @@ -210,22 +204,8 @@ export const mechanizeDockerContainer = async ( ForceUpdate: inspect.Spec.TaskTemplate.ForceUpdate + 1, }, }); - console.log(`Service updated successfully: ${appName}`); - } catch (error: unknown) { - const errorMessage = - error instanceof Error ? error.message : "Unknown error"; - console.log(`Service not found or error: ${errorMessage}`); - console.log(`Creating new service: ${appName}`); - - try { - await docker.createService(settings); - console.log(`Service created successfully: ${appName}`); - } catch (createError: unknown) { - const createErrorMessage = - createError instanceof Error ? createError.message : "Unknown error"; - console.error(`Failed to create service: ${createErrorMessage}`); - throw createError; - } + } catch (_error: unknown) { + await docker.createService(settings); } }; diff --git a/packages/server/src/utils/builders/nixpacks.ts b/packages/server/src/utils/builders/nixpacks.ts index 2d110d41..c0390722 100644 --- a/packages/server/src/utils/builders/nixpacks.ts +++ b/packages/server/src/utils/builders/nixpacks.ts @@ -85,19 +85,7 @@ export const buildNixpacks = async ( } return true; } catch (e) { - // Only try to remove the container if it might exist - try { - await spawnAsync("docker", ["rm", buildContainerId], writeToStream); - } catch (rmError) { - // Ignore errors from container removal - const errorMessage = - rmError instanceof Error - ? rmError.message - : "Unknown container cleanup error"; - - // Just log it but don't let it cause another error - writeToStream(`Container cleanup attempt: ${errorMessage}\n`); - } + await spawnAsync("docker", ["rm", buildContainerId], writeToStream); throw e; }