Add option to disable recurse submodules

Add option to disable recurse submodules under "Provider Select the source of your code" form.

* Add a checkbox to disable recurse submodules in `apps/dokploy/components/dashboard/application/general/generic/save-git-provider.tsx`, `apps/dokploy/components/dashboard/application/general/generic/save-github-provider.tsx`, and `apps/dokploy/components/dashboard/application/general/generic/save-gitlab-provider.tsx`.
* Update the form schema in the above files to include the new option.
* Conditionally include the `--recurse-submodules` flag in the `git clone` command in the above files.
* Update the "Provider Select the source of your code" form in `apps/dokploy/components/dashboard/application/general/generic/show.tsx` to include the new option.
* Conditionally include the `--recurse-submodules` flag in the `git clone` command in `packages/server/src/utils/providers/bitbucket.ts`, `packages/server/src/utils/providers/git.ts`, `packages/server/src/utils/providers/github.ts`, and `packages/server/src/utils/providers/gitlab.ts`.
* Add the `--depth` flag to optimize submodule cloning performance in the `git clone` command in `packages/server/src/utils/providers/bitbucket.ts`, `packages/server/src/utils/providers/git.ts`, `packages/server/src/utils/providers/github.ts`, and `packages/server/src/utils/providers/gitlab.ts`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/Dokploy/dokploy?shareId=XXXX-XXXX-XXXX-XXXX).
This commit is contained in:
Yusoof Moh
2025-03-25 22:04:35 +07:00
parent e0433e9f7b
commit cc5a3e6873
7 changed files with 181 additions and 81 deletions

View File

@@ -57,6 +57,7 @@ const GithubProviderSchema = z.object({
branch: z.string().min(1, "Branch is required"),
githubId: z.string().min(1, "Github Provider is required"),
watchPaths: z.array(z.string()).optional(),
recurseSubmodules: z.boolean().default(true),
});
type GithubProvider = z.infer<typeof GithubProviderSchema>;
@@ -81,6 +82,7 @@ export const SaveGithubProvider = ({ applicationId }: Props) => {
},
githubId: "",
branch: "",
recurseSubmodules: true,
},
resolver: zodResolver(GithubProviderSchema),
});
@@ -124,6 +126,7 @@ export const SaveGithubProvider = ({ applicationId }: Props) => {
buildPath: data.buildPath || "/",
githubId: data.githubId || "",
watchPaths: data.watchPaths || [],
recurseSubmodules: data.recurseSubmodules ?? true,
});
}
}, [form.reset, data, form]);
@@ -137,6 +140,7 @@ export const SaveGithubProvider = ({ applicationId }: Props) => {
buildPath: data.buildPath,
githubId: data.githubId,
watchPaths: data.watchPaths || [],
recurseSubmodules: data.recurseSubmodules,
})
.then(async () => {
toast.success("Service Provided Saved");
@@ -458,6 +462,23 @@ export const SaveGithubProvider = ({ applicationId }: Props) => {
</FormItem>
)}
/>
<FormField
control={form.control}
name="recurseSubmodules"
render={({ field }) => (
<FormItem className="flex items-center space-x-2">
<FormControl>
<input
type="checkbox"
checked={field.value}
onChange={field.onChange}
className="h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"
/>
</FormControl>
<FormLabel>Recurse Submodules</FormLabel>
</FormItem>
)}
/>
</div>
<div className="flex w-full justify-end">
<Button