mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-12 15:05:19 +00:00
Merge pull request #2304 from Dokploy/1681-application-automated-build-fails-due-connection-http-basic-access-denied
refactor(gitea, gitlab): remove unused parameters and fetch entities …
This commit is contained in:
@@ -3,8 +3,8 @@ import { join } from "node:path";
|
|||||||
import { paths } from "@dokploy/server/constants";
|
import { paths } from "@dokploy/server/constants";
|
||||||
import type { Compose } from "@dokploy/server/services/compose";
|
import type { Compose } from "@dokploy/server/services/compose";
|
||||||
import {
|
import {
|
||||||
type Gitea,
|
|
||||||
findGiteaById,
|
findGiteaById,
|
||||||
|
type Gitea,
|
||||||
updateGitea,
|
updateGitea,
|
||||||
} from "@dokploy/server/services/gitea";
|
} from "@dokploy/server/services/gitea";
|
||||||
import type { InferResultType } from "@dokploy/server/types/with";
|
import type { InferResultType } from "@dokploy/server/types/with";
|
||||||
@@ -118,7 +118,6 @@ export const getGiteaCloneCommand = async (
|
|||||||
giteaOwner,
|
giteaOwner,
|
||||||
giteaRepository,
|
giteaRepository,
|
||||||
serverId,
|
serverId,
|
||||||
gitea,
|
|
||||||
enableSubmodules,
|
enableSubmodules,
|
||||||
} = entity;
|
} = entity;
|
||||||
|
|
||||||
@@ -145,6 +144,7 @@ export const getGiteaCloneCommand = async (
|
|||||||
// Use paths(true) for remote operations
|
// Use paths(true) for remote operations
|
||||||
const { COMPOSE_PATH, APPLICATIONS_PATH } = paths(true);
|
const { COMPOSE_PATH, APPLICATIONS_PATH } = paths(true);
|
||||||
await refreshGiteaToken(giteaId);
|
await refreshGiteaToken(giteaId);
|
||||||
|
const gitea = await findGiteaById(giteaId);
|
||||||
const basePath = isCompose ? COMPOSE_PATH : APPLICATIONS_PATH;
|
const basePath = isCompose ? COMPOSE_PATH : APPLICATIONS_PATH;
|
||||||
const outputPath = join(basePath, appName, "code");
|
const outputPath = join(basePath, appName, "code");
|
||||||
|
|
||||||
|
|||||||
@@ -112,7 +112,6 @@ export const cloneGitlabRepository = async (
|
|||||||
appName,
|
appName,
|
||||||
gitlabBranch,
|
gitlabBranch,
|
||||||
gitlabId,
|
gitlabId,
|
||||||
gitlab,
|
|
||||||
gitlabPathNamespace,
|
gitlabPathNamespace,
|
||||||
enableSubmodules,
|
enableSubmodules,
|
||||||
} = entity;
|
} = entity;
|
||||||
@@ -125,6 +124,7 @@ export const cloneGitlabRepository = async (
|
|||||||
}
|
}
|
||||||
|
|
||||||
await refreshGitlabToken(gitlabId);
|
await refreshGitlabToken(gitlabId);
|
||||||
|
const gitlab = await findGitlabById(gitlabId);
|
||||||
|
|
||||||
const requirements = getErrorCloneRequirements(entity);
|
const requirements = getErrorCloneRequirements(entity);
|
||||||
|
|
||||||
@@ -187,7 +187,6 @@ export const getGitlabCloneCommand = async (
|
|||||||
gitlabBranch,
|
gitlabBranch,
|
||||||
gitlabId,
|
gitlabId,
|
||||||
serverId,
|
serverId,
|
||||||
gitlab,
|
|
||||||
enableSubmodules,
|
enableSubmodules,
|
||||||
} = entity;
|
} = entity;
|
||||||
|
|
||||||
@@ -235,6 +234,7 @@ export const getGitlabCloneCommand = async (
|
|||||||
|
|
||||||
const { COMPOSE_PATH, APPLICATIONS_PATH } = paths(true);
|
const { COMPOSE_PATH, APPLICATIONS_PATH } = paths(true);
|
||||||
await refreshGitlabToken(gitlabId);
|
await refreshGitlabToken(gitlabId);
|
||||||
|
const gitlab = await findGitlabById(gitlabId);
|
||||||
const basePath = isCompose ? COMPOSE_PATH : APPLICATIONS_PATH;
|
const basePath = isCompose ? COMPOSE_PATH : APPLICATIONS_PATH;
|
||||||
const outputPath = join(basePath, appName, "code");
|
const outputPath = join(basePath, appName, "code");
|
||||||
await recreateDirectory(outputPath);
|
await recreateDirectory(outputPath);
|
||||||
@@ -371,9 +371,9 @@ export const cloneRawGitlabRepository = async (entity: Compose) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const gitlabProvider = await findGitlabById(gitlabId);
|
|
||||||
const { COMPOSE_PATH } = paths();
|
const { COMPOSE_PATH } = paths();
|
||||||
await refreshGitlabToken(gitlabId);
|
await refreshGitlabToken(gitlabId);
|
||||||
|
const gitlabProvider = await findGitlabById(gitlabId);
|
||||||
const basePath = COMPOSE_PATH;
|
const basePath = COMPOSE_PATH;
|
||||||
const outputPath = join(basePath, appName, "code");
|
const outputPath = join(basePath, appName, "code");
|
||||||
await recreateDirectory(outputPath);
|
await recreateDirectory(outputPath);
|
||||||
@@ -419,9 +419,9 @@ export const cloneRawGitlabRepositoryRemote = async (compose: Compose) => {
|
|||||||
message: "Gitlab Provider not found",
|
message: "Gitlab Provider not found",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const gitlabProvider = await findGitlabById(gitlabId);
|
|
||||||
const { COMPOSE_PATH } = paths(true);
|
const { COMPOSE_PATH } = paths(true);
|
||||||
await refreshGitlabToken(gitlabId);
|
await refreshGitlabToken(gitlabId);
|
||||||
|
const gitlabProvider = await findGitlabById(gitlabId);
|
||||||
const basePath = COMPOSE_PATH;
|
const basePath = COMPOSE_PATH;
|
||||||
const outputPath = join(basePath, appName, "code");
|
const outputPath = join(basePath, appName, "code");
|
||||||
const repoClone = getGitlabRepoClone(gitlabProvider, gitlabPathNamespace);
|
const repoClone = getGitlabRepoClone(gitlabProvider, gitlabPathNamespace);
|
||||||
|
|||||||
Reference in New Issue
Block a user