mirror of
https://github.com/LukeHagar/dokploy.git
synced 2025-12-10 04:19:48 +00:00
[autofix.ci] apply automated fixes
This commit is contained in:
@@ -100,16 +100,16 @@ export const refreshGiteaToken = async (giteaProviderId: string) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const buildGiteaCloneUrl = (
|
const buildGiteaCloneUrl = (
|
||||||
giteaUrl: string,
|
giteaUrl: string,
|
||||||
accessToken: string,
|
accessToken: string,
|
||||||
owner: string,
|
owner: string,
|
||||||
repository: string
|
repository: string,
|
||||||
) => {
|
) => {
|
||||||
const protocol = giteaUrl.startsWith("http://") ? "http" : "https";
|
const protocol = giteaUrl.startsWith("http://") ? "http" : "https";
|
||||||
const baseUrl = giteaUrl.replace(/^https?:\/\//, "");
|
const baseUrl = giteaUrl.replace(/^https?:\/\//, "");
|
||||||
const repoClone = `${owner}/${repository}.git`;
|
const repoClone = `${owner}/${repository}.git`;
|
||||||
const cloneUrl = `${protocol}://oauth2:${accessToken}@${baseUrl}/${repoClone}`;
|
const cloneUrl = `${protocol}://oauth2:${accessToken}@${baseUrl}/${repoClone}`;
|
||||||
return cloneUrl;
|
return cloneUrl;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ApplicationWithGitea = InferResultType<
|
export type ApplicationWithGitea = InferResultType<
|
||||||
@@ -161,8 +161,13 @@ export const getGiteaCloneCommand = async (
|
|||||||
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");
|
||||||
|
|
||||||
const repoClone = `${giteaOwner}/${giteaRepository}.git`;
|
const repoClone = `${giteaOwner}/${giteaRepository}.git`;
|
||||||
const cloneUrl = buildGiteaCloneUrl(gitea?.giteaUrl!, gitea?.accessToken!, giteaOwner!, giteaRepository!);
|
const cloneUrl = buildGiteaCloneUrl(
|
||||||
|
gitea?.giteaUrl!,
|
||||||
|
gitea?.accessToken!,
|
||||||
|
giteaOwner!,
|
||||||
|
giteaRepository!,
|
||||||
|
);
|
||||||
|
|
||||||
const cloneCommand = `
|
const cloneCommand = `
|
||||||
rm -rf ${outputPath};
|
rm -rf ${outputPath};
|
||||||
@@ -216,8 +221,13 @@ export const cloneGiteaRepository = async (
|
|||||||
const outputPath = join(basePath, appName, "code");
|
const outputPath = join(basePath, appName, "code");
|
||||||
await recreateDirectory(outputPath);
|
await recreateDirectory(outputPath);
|
||||||
|
|
||||||
const repoClone = `${giteaOwner}/${giteaRepository}.git`;
|
const repoClone = `${giteaOwner}/${giteaRepository}.git`;
|
||||||
const cloneUrl = buildGiteaCloneUrl(giteaProvider.giteaUrl, giteaProvider.accessToken!, giteaOwner!, giteaRepository!);
|
const cloneUrl = buildGiteaCloneUrl(
|
||||||
|
giteaProvider.giteaUrl,
|
||||||
|
giteaProvider.accessToken!,
|
||||||
|
giteaOwner!,
|
||||||
|
giteaRepository!,
|
||||||
|
);
|
||||||
|
|
||||||
writeStream.write(`\nCloning Repo ${repoClone} to ${outputPath}...\n`);
|
writeStream.write(`\nCloning Repo ${repoClone} to ${outputPath}...\n`);
|
||||||
|
|
||||||
@@ -280,7 +290,12 @@ export const cloneRawGiteaRepository = async (entity: Compose) => {
|
|||||||
const outputPath = join(basePath, appName, "code");
|
const outputPath = join(basePath, appName, "code");
|
||||||
await recreateDirectory(outputPath);
|
await recreateDirectory(outputPath);
|
||||||
|
|
||||||
const cloneUrl = buildGiteaCloneUrl(giteaProvider.giteaUrl, giteaProvider.accessToken!, giteaOwner!, giteaRepository!);
|
const cloneUrl = buildGiteaCloneUrl(
|
||||||
|
giteaProvider.giteaUrl,
|
||||||
|
giteaProvider.accessToken!,
|
||||||
|
giteaOwner!,
|
||||||
|
giteaRepository!,
|
||||||
|
);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await spawnAsync("git", [
|
await spawnAsync("git", [
|
||||||
@@ -326,9 +341,14 @@ export const cloneRawGiteaRepositoryRemote = async (compose: Compose) => {
|
|||||||
const giteaProvider = await findGiteaById(giteaId);
|
const giteaProvider = await findGiteaById(giteaId);
|
||||||
const basePath = COMPOSE_PATH;
|
const basePath = COMPOSE_PATH;
|
||||||
const outputPath = join(basePath, appName, "code");
|
const outputPath = join(basePath, appName, "code");
|
||||||
const cloneUrl = buildGiteaCloneUrl(giteaProvider.giteaUrl, giteaProvider.accessToken!, giteaOwner!, giteaRepository!);
|
const cloneUrl = buildGiteaCloneUrl(
|
||||||
|
giteaProvider.giteaUrl,
|
||||||
|
giteaProvider.accessToken!,
|
||||||
|
giteaOwner!,
|
||||||
|
giteaRepository!,
|
||||||
|
);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const command = `
|
const command = `
|
||||||
rm -rf ${outputPath};
|
rm -rf ${outputPath};
|
||||||
git clone --branch ${giteaBranch} --depth 1 ${enableSubmodules ? "--recurse-submodules" : ""} ${cloneUrl} ${outputPath}
|
git clone --branch ${giteaBranch} --depth 1 ${enableSubmodules ? "--recurse-submodules" : ""} ${cloneUrl} ${outputPath}
|
||||||
|
|||||||
Reference in New Issue
Block a user