diff --git a/packages/server/src/utils/providers/gitea.ts b/packages/server/src/utils/providers/gitea.ts index bbd8ed1b4..21265bf37 100644 --- a/packages/server/src/utils/providers/gitea.ts +++ b/packages/server/src/utils/providers/gitea.ts @@ -3,8 +3,8 @@ import { join } from "node:path"; import { paths } from "@dokploy/server/constants"; import type { Compose } from "@dokploy/server/services/compose"; import { - type Gitea, findGiteaById, + type Gitea, updateGitea, } from "@dokploy/server/services/gitea"; import type { InferResultType } from "@dokploy/server/types/with"; @@ -118,7 +118,6 @@ export const getGiteaCloneCommand = async ( giteaOwner, giteaRepository, serverId, - gitea, enableSubmodules, } = entity; @@ -145,6 +144,7 @@ export const getGiteaCloneCommand = async ( // Use paths(true) for remote operations const { COMPOSE_PATH, APPLICATIONS_PATH } = paths(true); await refreshGiteaToken(giteaId); + const gitea = await findGiteaById(giteaId); const basePath = isCompose ? COMPOSE_PATH : APPLICATIONS_PATH; const outputPath = join(basePath, appName, "code"); diff --git a/packages/server/src/utils/providers/gitlab.ts b/packages/server/src/utils/providers/gitlab.ts index 774cd818f..f68bd3be7 100644 --- a/packages/server/src/utils/providers/gitlab.ts +++ b/packages/server/src/utils/providers/gitlab.ts @@ -112,7 +112,6 @@ export const cloneGitlabRepository = async ( appName, gitlabBranch, gitlabId, - gitlab, gitlabPathNamespace, enableSubmodules, } = entity; @@ -125,6 +124,7 @@ export const cloneGitlabRepository = async ( } await refreshGitlabToken(gitlabId); + const gitlab = await findGitlabById(gitlabId); const requirements = getErrorCloneRequirements(entity); @@ -187,7 +187,6 @@ export const getGitlabCloneCommand = async ( gitlabBranch, gitlabId, serverId, - gitlab, enableSubmodules, } = entity; @@ -235,6 +234,7 @@ export const getGitlabCloneCommand = async ( const { COMPOSE_PATH, APPLICATIONS_PATH } = paths(true); await refreshGitlabToken(gitlabId); + const gitlab = await findGitlabById(gitlabId); const basePath = isCompose ? COMPOSE_PATH : APPLICATIONS_PATH; const outputPath = join(basePath, appName, "code"); await recreateDirectory(outputPath); @@ -371,9 +371,9 @@ export const cloneRawGitlabRepository = async (entity: Compose) => { }); } - const gitlabProvider = await findGitlabById(gitlabId); const { COMPOSE_PATH } = paths(); await refreshGitlabToken(gitlabId); + const gitlabProvider = await findGitlabById(gitlabId); const basePath = COMPOSE_PATH; const outputPath = join(basePath, appName, "code"); await recreateDirectory(outputPath); @@ -419,9 +419,9 @@ export const cloneRawGitlabRepositoryRemote = async (compose: Compose) => { message: "Gitlab Provider not found", }); } - const gitlabProvider = await findGitlabById(gitlabId); const { COMPOSE_PATH } = paths(true); await refreshGitlabToken(gitlabId); + const gitlabProvider = await findGitlabById(gitlabId); const basePath = COMPOSE_PATH; const outputPath = join(basePath, appName, "code"); const repoClone = getGitlabRepoClone(gitlabProvider, gitlabPathNamespace);