mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
refactor: simplify names of colums
This commit is contained in:
37
apps/dokploy/drizzle/0047_optimal_peter_quill.sql
Normal file
37
apps/dokploy/drizzle/0047_optimal_peter_quill.sql
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
ALTER TABLE "application" RENAME COLUMN "githubProviderId" TO "githubId";--> statement-breakpoint
|
||||||
|
ALTER TABLE "application" RENAME COLUMN "gitlabProviderId" TO "gitlabId";--> statement-breakpoint
|
||||||
|
ALTER TABLE "application" RENAME COLUMN "bitbucketProviderId" TO "bitbucketId";--> statement-breakpoint
|
||||||
|
ALTER TABLE "bitbucket_provider" RENAME COLUMN "bitbucketProviderId" TO "bitbucketId";--> statement-breakpoint
|
||||||
|
ALTER TABLE "github_provider" RENAME COLUMN "githubProviderId" TO "githubId";--> statement-breakpoint
|
||||||
|
ALTER TABLE "gitlab_provider" RENAME COLUMN "gitlabProviderId" TO "gitlabId";--> statement-breakpoint
|
||||||
|
ALTER TABLE "application" DROP CONSTRAINT "application_githubProviderId_github_provider_githubProviderId_fk";
|
||||||
|
--> statement-breakpoint
|
||||||
|
ALTER TABLE "application" DROP CONSTRAINT "application_gitlabProviderId_gitlab_provider_gitlabProviderId_fk";
|
||||||
|
--> statement-breakpoint
|
||||||
|
ALTER TABLE "application" DROP CONSTRAINT "application_bitbucketProviderId_bitbucket_provider_bitbucketProviderId_fk";
|
||||||
|
--> statement-breakpoint
|
||||||
|
DO $$ BEGIN
|
||||||
|
ALTER TABLE "application" ADD CONSTRAINT "application_githubId_github_provider_githubId_fk" FOREIGN KEY ("githubId") REFERENCES "public"."github_provider"("githubId") ON DELETE set null ON UPDATE no action;
|
||||||
|
EXCEPTION
|
||||||
|
WHEN duplicate_object THEN null;
|
||||||
|
END $$;
|
||||||
|
--> statement-breakpoint
|
||||||
|
DO $$ BEGIN
|
||||||
|
ALTER TABLE "application" ADD CONSTRAINT "application_gitlabId_gitlab_provider_gitlabId_fk" FOREIGN KEY ("gitlabId") REFERENCES "public"."gitlab_provider"("gitlabId") ON DELETE set null ON UPDATE no action;
|
||||||
|
EXCEPTION
|
||||||
|
WHEN duplicate_object THEN null;
|
||||||
|
END $$;
|
||||||
|
--> statement-breakpoint
|
||||||
|
DO $$ BEGIN
|
||||||
|
ALTER TABLE "application" ADD CONSTRAINT "application_bitbucketId_bitbucket_provider_bitbucketId_fk" FOREIGN KEY ("bitbucketId") REFERENCES "public"."bitbucket_provider"("bitbucketId") ON DELETE set null ON UPDATE no action;
|
||||||
|
EXCEPTION
|
||||||
|
WHEN duplicate_object THEN null;
|
||||||
|
END $$;
|
||||||
|
--> statement-breakpoint
|
||||||
|
ALTER TABLE "admin" DROP COLUMN IF EXISTS "githubAppId";--> statement-breakpoint
|
||||||
|
ALTER TABLE "admin" DROP COLUMN IF EXISTS "githubAppName";--> statement-breakpoint
|
||||||
|
ALTER TABLE "admin" DROP COLUMN IF EXISTS "githubClientId";--> statement-breakpoint
|
||||||
|
ALTER TABLE "admin" DROP COLUMN IF EXISTS "githubClientSecret";--> statement-breakpoint
|
||||||
|
ALTER TABLE "admin" DROP COLUMN IF EXISTS "githubInstallationId";--> statement-breakpoint
|
||||||
|
ALTER TABLE "admin" DROP COLUMN IF EXISTS "githubPrivateKey";--> statement-breakpoint
|
||||||
|
ALTER TABLE "admin" DROP COLUMN IF EXISTS "githubWebhookSecret";
|
||||||
3413
apps/dokploy/drizzle/meta/0047_snapshot.json
Normal file
3413
apps/dokploy/drizzle/meta/0047_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -330,6 +330,13 @@
|
|||||||
"when": 1725168434474,
|
"when": 1725168434474,
|
||||||
"tag": "0046_wonderful_oracle",
|
"tag": "0046_wonderful_oracle",
|
||||||
"breakpoints": true
|
"breakpoints": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idx": 47,
|
||||||
|
"version": "6",
|
||||||
|
"when": 1725172770448,
|
||||||
|
"tag": "0047_optimal_peter_quill",
|
||||||
|
"breakpoints": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -50,7 +50,7 @@ export default async function handler(
|
|||||||
.set({
|
.set({
|
||||||
githubInstallationId: installation_id,
|
githubInstallationId: installation_id,
|
||||||
})
|
})
|
||||||
.where(eq(githubProvider.githubProviderId, value as string))
|
.where(eq(githubProvider.githubId, value as string))
|
||||||
.returning();
|
.returning();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export default async function handler(
|
|||||||
return res.status(400).json({ error: "Missing or invalid code" });
|
return res.status(400).json({ error: "Missing or invalid code" });
|
||||||
}
|
}
|
||||||
const expiresAt = Math.floor(Date.now() / 1000) + result.expires_in;
|
const expiresAt = Math.floor(Date.now() / 1000) + result.expires_in;
|
||||||
const updatedGiltab = await updateGitlabProvider(gitlab.gitlabProviderId, {
|
const updatedGiltab = await updateGitlabProvider(gitlab.gitlabId, {
|
||||||
accessToken: result.access_token,
|
accessToken: result.access_token,
|
||||||
refreshToken: result.refresh_token,
|
refreshToken: result.refresh_token,
|
||||||
expiresAt,
|
expiresAt,
|
||||||
|
|||||||
@@ -31,9 +31,9 @@ export const gitProvider = createTRPCRouter({
|
|||||||
getAll: protectedProcedure.query(async () => {
|
getAll: protectedProcedure.query(async () => {
|
||||||
return await db.query.gitProvider.findMany({
|
return await db.query.gitProvider.findMany({
|
||||||
with: {
|
with: {
|
||||||
gitlabProvider: true,
|
gitlab: true,
|
||||||
bitbucketProvider: true,
|
bitbucket: true,
|
||||||
githubProvider: true,
|
github: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
@@ -86,7 +86,7 @@ export const gitProvider = createTRPCRouter({
|
|||||||
.filter((provider) => haveGithubRequirements(provider))
|
.filter((provider) => haveGithubRequirements(provider))
|
||||||
.map((provider) => {
|
.map((provider) => {
|
||||||
return {
|
return {
|
||||||
githubProviderId: provider.githubProviderId,
|
githubId: provider.githubId,
|
||||||
gitProvider: {
|
gitProvider: {
|
||||||
...provider.gitProvider,
|
...provider.gitProvider,
|
||||||
},
|
},
|
||||||
@@ -105,7 +105,7 @@ export const gitProvider = createTRPCRouter({
|
|||||||
.filter((provider) => haveGitlabRequirements(provider))
|
.filter((provider) => haveGitlabRequirements(provider))
|
||||||
.map((provider) => {
|
.map((provider) => {
|
||||||
return {
|
return {
|
||||||
gitlabProviderId: provider.gitlabProviderId,
|
gitlabId: provider.gitlabId,
|
||||||
gitProvider: {
|
gitProvider: {
|
||||||
...provider.gitProvider,
|
...provider.gitProvider,
|
||||||
},
|
},
|
||||||
@@ -120,7 +120,7 @@ export const gitProvider = createTRPCRouter({
|
|||||||
gitProvider: true,
|
gitProvider: true,
|
||||||
},
|
},
|
||||||
columns: {
|
columns: {
|
||||||
bitbucketProviderId: true,
|
bitbucketId: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
@@ -182,3 +182,20 @@ export const gitProvider = createTRPCRouter({
|
|||||||
return await getGithubBranches(input);
|
return await getGithubBranches(input);
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
// 1725175543
|
||||||
|
// {
|
||||||
|
// access_token: '11d422887d8fac712191ee9b09dfdb043a705938cd67a4a39f36b4bc65b3106d',
|
||||||
|
// token_type: 'Bearer',
|
||||||
|
// expires_in: 7200,
|
||||||
|
// refresh_token: '3806d8022d32886c19d91eb9d1cea9328b864387f39c5d0469d08c48e18b674e',
|
||||||
|
// scope: 'api read_user read_repository',
|
||||||
|
// created_at: 1725167656
|
||||||
|
// }
|
||||||
|
// {
|
||||||
|
// access_token: 'd256b52b10bf72ebf2784f8c0528e48a04a7d249c28695b6cc105b47b09c7336',
|
||||||
|
// token_type: 'Bearer',
|
||||||
|
// expires_in: 7200,
|
||||||
|
// refresh_token: '265eb87d0bbef410e0c30a2c239c4fa3698943219a439fb43cf2f8227d1fcaf2',
|
||||||
|
// scope: 'api read_user read_repository',
|
||||||
|
// created_at: 1725167803
|
||||||
|
// }
|
||||||
|
|||||||
@@ -119,9 +119,9 @@ export const removeGithubProvider = async (gitProviderId: string) => {
|
|||||||
return result[0];
|
return result[0];
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getGithubProvider = async (githubProviderId: string) => {
|
export const getGithubProvider = async (githubId: string) => {
|
||||||
const githubProviderResult = await db.query.githubProvider.findFirst({
|
const githubProviderResult = await db.query.githubProvider.findFirst({
|
||||||
where: eq(githubProvider.githubProviderId, githubProviderId),
|
where: eq(githubProvider.githubId, githubId),
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!githubProviderResult) {
|
if (!githubProviderResult) {
|
||||||
@@ -142,9 +142,9 @@ export const haveGithubRequirements = (githubProvider: GithubProvider) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getGitlabProvider = async (gitlabProviderId: string) => {
|
export const getGitlabProvider = async (gitlabId: string) => {
|
||||||
const gitlabProviderResult = await db.query.gitlabProvider.findFirst({
|
const gitlabProviderResult = await db.query.gitlabProvider.findFirst({
|
||||||
where: eq(gitlabProvider.gitlabProviderId, gitlabProviderId),
|
where: eq(gitlabProvider.gitlabId, gitlabId),
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!gitlabProviderResult) {
|
if (!gitlabProviderResult) {
|
||||||
@@ -158,7 +158,7 @@ export const getGitlabProvider = async (gitlabProviderId: string) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const updateGitlabProvider = async (
|
export const updateGitlabProvider = async (
|
||||||
gitlabProviderId: string,
|
gitlabId: string,
|
||||||
input: Partial<GitlabProvider>,
|
input: Partial<GitlabProvider>,
|
||||||
) => {
|
) => {
|
||||||
const result = await db
|
const result = await db
|
||||||
@@ -166,15 +166,15 @@ export const updateGitlabProvider = async (
|
|||||||
.set({
|
.set({
|
||||||
...input,
|
...input,
|
||||||
})
|
})
|
||||||
.where(eq(gitlabProvider.gitlabProviderId, gitlabProviderId))
|
.where(eq(gitlabProvider.gitlabId, gitlabId))
|
||||||
.returning();
|
.returning();
|
||||||
|
|
||||||
return result[0];
|
return result[0];
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getBitbucketProvider = async (bitbucketProviderId: string) => {
|
export const getBitbucketProvider = async (bitbucketId: string) => {
|
||||||
const bitbucketProviderResult = await db.query.bitbucketProvider.findFirst({
|
const bitbucketProviderResult = await db.query.bitbucketProvider.findFirst({
|
||||||
where: eq(bitbucketProvider.bitbucketProviderId, bitbucketProviderId),
|
where: eq(bitbucketProvider.bitbucketId, bitbucketId),
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!bitbucketProviderResult) {
|
if (!bitbucketProviderResult) {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { generatePassword } from "@/templates/utils";
|
|
||||||
import { relations } from "drizzle-orm";
|
import { relations } from "drizzle-orm";
|
||||||
import {
|
import {
|
||||||
boolean,
|
boolean,
|
||||||
@@ -186,20 +185,14 @@ export const applications = pgTable("application", {
|
|||||||
projectId: text("projectId")
|
projectId: text("projectId")
|
||||||
.notNull()
|
.notNull()
|
||||||
.references(() => projects.projectId, { onDelete: "cascade" }),
|
.references(() => projects.projectId, { onDelete: "cascade" }),
|
||||||
githubProviderId: text("githubProviderId").references(
|
githubId: text("githubId").references(() => githubProvider.githubId, {
|
||||||
() => githubProvider.githubProviderId,
|
onDelete: "set null",
|
||||||
{
|
}),
|
||||||
onDelete: "set null",
|
gitlabId: text("gitlabId").references(() => gitlabProvider.gitlabId, {
|
||||||
},
|
onDelete: "set null",
|
||||||
),
|
}),
|
||||||
gitlabProviderId: text("gitlabProviderId").references(
|
bitbucketId: text("bitbucketId").references(
|
||||||
() => gitlabProvider.gitlabProviderId,
|
() => bitbucketProvider.bitbucketId,
|
||||||
{
|
|
||||||
onDelete: "set null",
|
|
||||||
},
|
|
||||||
),
|
|
||||||
bitbucketProviderId: text("bitbucketProviderId").references(
|
|
||||||
() => bitbucketProvider.bitbucketProviderId,
|
|
||||||
{
|
{
|
||||||
onDelete: "set null",
|
onDelete: "set null",
|
||||||
},
|
},
|
||||||
@@ -228,16 +221,16 @@ export const applicationsRelations = relations(
|
|||||||
references: [registry.registryId],
|
references: [registry.registryId],
|
||||||
}),
|
}),
|
||||||
githubProvider: one(githubProvider, {
|
githubProvider: one(githubProvider, {
|
||||||
fields: [applications.githubProviderId],
|
fields: [applications.githubId],
|
||||||
references: [githubProvider.githubProviderId],
|
references: [githubProvider.githubId],
|
||||||
}),
|
}),
|
||||||
gitlabProvider: one(gitlabProvider, {
|
gitlabProvider: one(gitlabProvider, {
|
||||||
fields: [applications.gitlabProviderId],
|
fields: [applications.gitlabId],
|
||||||
references: [gitlabProvider.gitlabProviderId],
|
references: [gitlabProvider.gitlabId],
|
||||||
}),
|
}),
|
||||||
bitbucketProvider: one(bitbucketProvider, {
|
bitbucketProvider: one(bitbucketProvider, {
|
||||||
fields: [applications.bitbucketProviderId],
|
fields: [applications.bitbucketId],
|
||||||
references: [bitbucketProvider.bitbucketProviderId],
|
references: [bitbucketProvider.bitbucketId],
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
@@ -416,7 +409,7 @@ export const apiSaveGithubProvider = createSchema
|
|||||||
branch: true,
|
branch: true,
|
||||||
owner: true,
|
owner: true,
|
||||||
buildPath: true,
|
buildPath: true,
|
||||||
githubProviderId: true,
|
githubId: true,
|
||||||
})
|
})
|
||||||
.required();
|
.required();
|
||||||
|
|
||||||
@@ -427,7 +420,7 @@ export const apiSaveGitlabProvider = createSchema
|
|||||||
gitlabBuildPath: true,
|
gitlabBuildPath: true,
|
||||||
gitlabOwner: true,
|
gitlabOwner: true,
|
||||||
gitlabRepository: true,
|
gitlabRepository: true,
|
||||||
gitlabProviderId: true,
|
gitlabId: true,
|
||||||
})
|
})
|
||||||
.required();
|
.required();
|
||||||
|
|
||||||
@@ -437,7 +430,7 @@ export const apiSaveBitbucketProvider = createSchema
|
|||||||
bitbucketBuildPath: true,
|
bitbucketBuildPath: true,
|
||||||
bitbucketOwner: true,
|
bitbucketOwner: true,
|
||||||
bitbucketRepository: true,
|
bitbucketRepository: true,
|
||||||
bitbucketProviderId: true,
|
bitbucketId: true,
|
||||||
applicationId: true,
|
applicationId: true,
|
||||||
})
|
})
|
||||||
.required();
|
.required();
|
||||||
|
|||||||
@@ -27,15 +27,15 @@ export const gitProvider = pgTable("git_provider", {
|
|||||||
});
|
});
|
||||||
|
|
||||||
export const gitProviderRelations = relations(gitProvider, ({ one, many }) => ({
|
export const gitProviderRelations = relations(gitProvider, ({ one, many }) => ({
|
||||||
githubProvider: one(githubProvider, {
|
github: one(githubProvider, {
|
||||||
fields: [gitProvider.gitProviderId],
|
fields: [gitProvider.gitProviderId],
|
||||||
references: [githubProvider.gitProviderId],
|
references: [githubProvider.gitProviderId],
|
||||||
}),
|
}),
|
||||||
gitlabProvider: one(gitlabProvider, {
|
gitlab: one(gitlabProvider, {
|
||||||
fields: [gitProvider.gitProviderId],
|
fields: [gitProvider.gitProviderId],
|
||||||
references: [gitlabProvider.gitProviderId],
|
references: [gitlabProvider.gitProviderId],
|
||||||
}),
|
}),
|
||||||
bitbucketProvider: one(bitbucketProvider, {
|
bitbucket: one(bitbucketProvider, {
|
||||||
fields: [gitProvider.gitProviderId],
|
fields: [gitProvider.gitProviderId],
|
||||||
references: [bitbucketProvider.gitProviderId],
|
references: [bitbucketProvider.gitProviderId],
|
||||||
}),
|
}),
|
||||||
@@ -46,7 +46,7 @@ export const gitProviderRelations = relations(gitProvider, ({ one, many }) => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
export const githubProvider = pgTable("github_provider", {
|
export const githubProvider = pgTable("github_provider", {
|
||||||
githubProviderId: text("githubProviderId")
|
githubId: text("githubId")
|
||||||
.notNull()
|
.notNull()
|
||||||
.primaryKey()
|
.primaryKey()
|
||||||
.$defaultFn(() => nanoid()),
|
.$defaultFn(() => nanoid()),
|
||||||
@@ -73,7 +73,7 @@ export const githubProviderRelations = relations(
|
|||||||
);
|
);
|
||||||
|
|
||||||
export const gitlabProvider = pgTable("gitlab_provider", {
|
export const gitlabProvider = pgTable("gitlab_provider", {
|
||||||
gitlabProviderId: text("gitlabProviderId")
|
gitlabId: text("gitlabId")
|
||||||
.notNull()
|
.notNull()
|
||||||
.primaryKey()
|
.primaryKey()
|
||||||
.$defaultFn(() => nanoid()),
|
.$defaultFn(() => nanoid()),
|
||||||
@@ -100,7 +100,7 @@ export const gitlabProviderRelations = relations(
|
|||||||
);
|
);
|
||||||
|
|
||||||
export const bitbucketProvider = pgTable("bitbucket_provider", {
|
export const bitbucketProvider = pgTable("bitbucket_provider", {
|
||||||
bitbucketProviderId: text("bitbucketProviderId")
|
bitbucketId: text("bitbucketId")
|
||||||
.notNull()
|
.notNull()
|
||||||
.primaryKey()
|
.primaryKey()
|
||||||
.$defaultFn(() => nanoid()),
|
.$defaultFn(() => nanoid()),
|
||||||
|
|||||||
@@ -23,11 +23,11 @@ export const cloneBitbucketRepository = async (
|
|||||||
bitbucketRepository,
|
bitbucketRepository,
|
||||||
bitbucketOwner,
|
bitbucketOwner,
|
||||||
bitbucketBranch,
|
bitbucketBranch,
|
||||||
bitbucketProviderId,
|
bitbucketId,
|
||||||
bitbucketProvider,
|
bitbucketProvider,
|
||||||
} = entity;
|
} = entity;
|
||||||
|
|
||||||
if (!bitbucketProviderId) {
|
if (!bitbucketId) {
|
||||||
throw new TRPCError({
|
throw new TRPCError({
|
||||||
code: "NOT_FOUND",
|
code: "NOT_FOUND",
|
||||||
message: "Bitbucket Provider not found",
|
message: "Bitbucket Provider not found",
|
||||||
@@ -77,11 +77,11 @@ export const cloneRawBitbucketRepository = async (
|
|||||||
bitbucketRepository,
|
bitbucketRepository,
|
||||||
bitbucketOwner,
|
bitbucketOwner,
|
||||||
bitbucketBranch,
|
bitbucketBranch,
|
||||||
bitbucketProviderId,
|
bitbucketId,
|
||||||
bitbucketProvider,
|
bitbucketProvider,
|
||||||
} = entity;
|
} = entity;
|
||||||
|
|
||||||
if (!bitbucketProviderId) {
|
if (!bitbucketId) {
|
||||||
throw new TRPCError({
|
throw new TRPCError({
|
||||||
code: "NOT_FOUND",
|
code: "NOT_FOUND",
|
||||||
message: "Bitbucket Provider not found",
|
message: "Bitbucket Provider not found",
|
||||||
|
|||||||
@@ -77,9 +77,9 @@ export const cloneGithubRepository = async (
|
|||||||
isCompose = false,
|
isCompose = false,
|
||||||
) => {
|
) => {
|
||||||
const writeStream = createWriteStream(logPath, { flags: "a" });
|
const writeStream = createWriteStream(logPath, { flags: "a" });
|
||||||
const { appName, repository, owner, branch, githubProviderId } = entity;
|
const { appName, repository, owner, branch, githubId } = entity;
|
||||||
|
|
||||||
if (!githubProviderId) {
|
if (!githubId) {
|
||||||
throw new TRPCError({
|
throw new TRPCError({
|
||||||
code: "NOT_FOUND",
|
code: "NOT_FOUND",
|
||||||
message: "GitHub Provider not found",
|
message: "GitHub Provider not found",
|
||||||
@@ -102,7 +102,7 @@ export const cloneGithubRepository = async (
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const githubProvider = await getGithubProvider(githubProviderId);
|
const githubProvider = await getGithubProvider(githubId);
|
||||||
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 octokit = authGithub(githubProvider);
|
const octokit = authGithub(githubProvider);
|
||||||
@@ -143,15 +143,15 @@ export const cloneGithubRepository = async (
|
|||||||
export const cloneRawGithubRepository = async (
|
export const cloneRawGithubRepository = async (
|
||||||
entity: ApplicationWithGithub,
|
entity: ApplicationWithGithub,
|
||||||
) => {
|
) => {
|
||||||
const { appName, repository, owner, branch, githubProviderId } = entity;
|
const { appName, repository, owner, branch, githubId } = entity;
|
||||||
|
|
||||||
if (!githubProviderId) {
|
if (!githubId) {
|
||||||
throw new TRPCError({
|
throw new TRPCError({
|
||||||
code: "NOT_FOUND",
|
code: "NOT_FOUND",
|
||||||
message: "GitHub Provider not found",
|
message: "GitHub Provider not found",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const githubProvider = await getGithubProvider(githubProviderId);
|
const githubProvider = await getGithubProvider(githubId);
|
||||||
const basePath = COMPOSE_PATH;
|
const basePath = COMPOSE_PATH;
|
||||||
const outputPath = join(basePath, appName, "code");
|
const outputPath = join(basePath, appName, "code");
|
||||||
const octokit = authGithub(githubProvider);
|
const octokit = authGithub(githubProvider);
|
||||||
|
|||||||
@@ -88,18 +88,18 @@ export const cloneGitlabRepository = async (
|
|||||||
gitlabRepository,
|
gitlabRepository,
|
||||||
gitlabOwner,
|
gitlabOwner,
|
||||||
gitlabBranch,
|
gitlabBranch,
|
||||||
gitlabProviderId,
|
gitlabId,
|
||||||
gitlabProvider,
|
gitlabProvider,
|
||||||
} = entity;
|
} = entity;
|
||||||
|
|
||||||
if (!gitlabProviderId) {
|
if (!gitlabId) {
|
||||||
throw new TRPCError({
|
throw new TRPCError({
|
||||||
code: "NOT_FOUND",
|
code: "NOT_FOUND",
|
||||||
message: "Gitlab Provider not found",
|
message: "Gitlab Provider not found",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
await refreshGitlabToken(gitlabProviderId);
|
await refreshGitlabToken(gitlabId);
|
||||||
|
|
||||||
const requirements = getErrorCloneRequirements(entity);
|
const requirements = getErrorCloneRequirements(entity);
|
||||||
|
|
||||||
@@ -258,18 +258,18 @@ export const cloneRawGitlabRepository = async (
|
|||||||
gitlabRepository,
|
gitlabRepository,
|
||||||
gitlabOwner,
|
gitlabOwner,
|
||||||
gitlabBranch,
|
gitlabBranch,
|
||||||
gitlabProviderId,
|
gitlabId,
|
||||||
gitlabProvider,
|
gitlabProvider,
|
||||||
} = entity;
|
} = entity;
|
||||||
|
|
||||||
if (!gitlabProviderId) {
|
if (!gitlabId) {
|
||||||
throw new TRPCError({
|
throw new TRPCError({
|
||||||
code: "NOT_FOUND",
|
code: "NOT_FOUND",
|
||||||
message: "Gitlab Provider not found",
|
message: "Gitlab Provider not found",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
await refreshGitlabToken(gitlabProviderId);
|
await refreshGitlabToken(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);
|
||||||
|
|||||||
Reference in New Issue
Block a user