Skip to content

Commit 6518407

Browse files
authored
Merge pull request #1563 from yusoofsh/add-disable-recurse-submodules-option
Add option to disable recurse submodules
2 parents 6f47999 + fe69d5d commit 6518407

26 files changed

+11199
-125
lines changed

apps/dokploy/__test__/drop/drop.test.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const baseApp: ApplicationNested = {
3434
giteaRepository: "",
3535
cleanCache: false,
3636
watchPaths: [],
37+
enableSubmodules: false,
3738
applicationStatus: "done",
3839
appName: "",
3940
autoDeploy: true,

apps/dokploy/__test__/traefik/traefik.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const baseApp: ApplicationNested = {
1616
applicationStatus: "done",
1717
appName: "",
1818
autoDeploy: true,
19+
enableSubmodules: false,
1920
serverId: "",
2021
branch: null,
2122
dockerBuildStage: "",

apps/dokploy/components/dashboard/application/general/generic/save-bitbucket-provider.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import {
3131
SelectTrigger,
3232
SelectValue,
3333
} from "@/components/ui/select";
34+
import { Switch } from "@/components/ui/switch";
3435
import {
3536
Tooltip,
3637
TooltipContent,
@@ -58,6 +59,7 @@ const BitbucketProviderSchema = z.object({
5859
branch: z.string().min(1, "Branch is required"),
5960
bitbucketId: z.string().min(1, "Bitbucket Provider is required"),
6061
watchPaths: z.array(z.string()).optional(),
62+
enableSubmodules: z.boolean().optional(),
6163
});
6264

6365
type BitbucketProvider = z.infer<typeof BitbucketProviderSchema>;
@@ -84,6 +86,7 @@ export const SaveBitbucketProvider = ({ applicationId }: Props) => {
8486
bitbucketId: "",
8587
branch: "",
8688
watchPaths: [],
89+
enableSubmodules: false,
8790
},
8891
resolver: zodResolver(BitbucketProviderSchema),
8992
});
@@ -130,6 +133,7 @@ export const SaveBitbucketProvider = ({ applicationId }: Props) => {
130133
buildPath: data.bitbucketBuildPath || "/",
131134
bitbucketId: data.bitbucketId || "",
132135
watchPaths: data.watchPaths || [],
136+
enableSubmodules: data.enableSubmodules || false,
133137
});
134138
}
135139
}, [form.reset, data, form]);
@@ -143,6 +147,7 @@ export const SaveBitbucketProvider = ({ applicationId }: Props) => {
143147
bitbucketId: data.bitbucketId,
144148
applicationId,
145149
watchPaths: data.watchPaths || [],
150+
enableSubmodules: data.enableSubmodules || false,
146151
})
147152
.then(async () => {
148153
toast.success("Service Provided Saved");
@@ -467,6 +472,21 @@ export const SaveBitbucketProvider = ({ applicationId }: Props) => {
467472
</FormItem>
468473
)}
469474
/>
475+
<FormField
476+
control={form.control}
477+
name="enableSubmodules"
478+
render={({ field }) => (
479+
<FormItem className="flex items-center space-x-2">
480+
<FormControl>
481+
<Switch
482+
checked={field.value}
483+
onCheckedChange={field.onChange}
484+
/>
485+
</FormControl>
486+
<FormLabel className="!mt-0">Enable Submodules</FormLabel>
487+
</FormItem>
488+
)}
489+
/>
470490
</div>
471491
<div className="flex w-full justify-end">
472492
<Button

apps/dokploy/components/dashboard/application/general/generic/save-git-provider.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
TooltipProvider,
2424
TooltipTrigger,
2525
} from "@/components/ui/tooltip";
26+
import { Switch } from "@/components/ui/switch";
2627
import { api } from "@/utils/api";
2728
import { zodResolver } from "@hookform/resolvers/zod";
2829
import { KeyRoundIcon, LockIcon, X } from "lucide-react";
@@ -44,6 +45,7 @@ const GitProviderSchema = z.object({
4445
branch: z.string().min(1, "Branch required"),
4546
sshKey: z.string().optional(),
4647
watchPaths: z.array(z.string()).optional(),
48+
enableSubmodules: z.boolean().default(false),
4749
});
4850

4951
type GitProvider = z.infer<typeof GitProviderSchema>;
@@ -67,6 +69,7 @@ export const SaveGitProvider = ({ applicationId }: Props) => {
6769
repositoryURL: "",
6870
sshKey: undefined,
6971
watchPaths: [],
72+
enableSubmodules: false,
7073
},
7174
resolver: zodResolver(GitProviderSchema),
7275
});
@@ -79,6 +82,7 @@ export const SaveGitProvider = ({ applicationId }: Props) => {
7982
buildPath: data.customGitBuildPath || "/",
8083
repositoryURL: data.customGitUrl || "",
8184
watchPaths: data.watchPaths || [],
85+
enableSubmodules: data.enableSubmodules ?? false,
8286
});
8387
}
8488
}, [form.reset, data, form]);
@@ -91,6 +95,7 @@ export const SaveGitProvider = ({ applicationId }: Props) => {
9195
customGitSSHKeyId: values.sshKey === "none" ? null : values.sshKey,
9296
applicationId,
9397
watchPaths: values.watchPaths || [],
98+
enableSubmodules: values.enableSubmodules,
9499
})
95100
.then(async () => {
96101
toast.success("Git Provider Saved");
@@ -294,6 +299,22 @@ export const SaveGitProvider = ({ applicationId }: Props) => {
294299
</FormItem>
295300
)}
296301
/>
302+
303+
<FormField
304+
control={form.control}
305+
name="enableSubmodules"
306+
render={({ field }) => (
307+
<FormItem className="flex items-center space-x-2">
308+
<FormControl>
309+
<Switch
310+
checked={field.value}
311+
onCheckedChange={field.onChange}
312+
/>
313+
</FormControl>
314+
<FormLabel className="!mt-0">Enable Submodules</FormLabel>
315+
</FormItem>
316+
)}
317+
/>
297318
</div>
298319

299320
<div className="flex flex-row justify-end">

apps/dokploy/components/dashboard/application/general/generic/save-gitea-provider.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import {
3131
SelectTrigger,
3232
SelectValue,
3333
} from "@/components/ui/select";
34+
import { Switch } from "@/components/ui/switch";
3435
import {
3536
Tooltip,
3637
TooltipContent,
@@ -74,6 +75,7 @@ const GiteaProviderSchema = z.object({
7475
branch: z.string().min(1, "Branch is required"),
7576
giteaId: z.string().min(1, "Gitea Provider is required"),
7677
watchPaths: z.array(z.string()).default([]),
78+
enableSubmodules: z.boolean().optional(),
7779
});
7880

7981
type GiteaProvider = z.infer<typeof GiteaProviderSchema>;
@@ -99,6 +101,7 @@ export const SaveGiteaProvider = ({ applicationId }: Props) => {
99101
giteaId: "",
100102
branch: "",
101103
watchPaths: [],
104+
enableSubmodules: false,
102105
},
103106
resolver: zodResolver(GiteaProviderSchema),
104107
});
@@ -152,6 +155,7 @@ export const SaveGiteaProvider = ({ applicationId }: Props) => {
152155
buildPath: data.giteaBuildPath || "/",
153156
giteaId: data.giteaId || "",
154157
watchPaths: data.watchPaths || [],
158+
enableSubmodules: data.enableSubmodules || false,
155159
});
156160
}
157161
}, [form.reset, data, form]);
@@ -165,6 +169,7 @@ export const SaveGiteaProvider = ({ applicationId }: Props) => {
165169
giteaId: data.giteaId,
166170
applicationId,
167171
watchPaths: data.watchPaths,
172+
enableSubmodules: data.enableSubmodules || false,
168173
})
169174
.then(async () => {
170175
toast.success("Service Provider Saved");
@@ -498,6 +503,21 @@ export const SaveGiteaProvider = ({ applicationId }: Props) => {
498503
</FormItem>
499504
)}
500505
/>
506+
<FormField
507+
control={form.control}
508+
name="enableSubmodules"
509+
render={({ field }) => (
510+
<FormItem className="flex items-center space-x-2">
511+
<FormControl>
512+
<Switch
513+
checked={field.value}
514+
onCheckedChange={field.onChange}
515+
/>
516+
</FormControl>
517+
<FormLabel className="!mt-0">Enable Submodules</FormLabel>
518+
</FormItem>
519+
)}
520+
/>
501521
</div>
502522
<div className="flex w-full justify-end">
503523
<Button

apps/dokploy/components/dashboard/application/general/generic/save-github-provider.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import {
3030
SelectTrigger,
3131
SelectValue,
3232
} from "@/components/ui/select";
33+
import { Switch } from "@/components/ui/switch";
3334
import {
3435
Tooltip,
3536
TooltipContent,
@@ -57,6 +58,7 @@ const GithubProviderSchema = z.object({
5758
branch: z.string().min(1, "Branch is required"),
5859
githubId: z.string().min(1, "Github Provider is required"),
5960
watchPaths: z.array(z.string()).optional(),
61+
enableSubmodules: z.boolean().default(false),
6062
});
6163

6264
type GithubProvider = z.infer<typeof GithubProviderSchema>;
@@ -81,6 +83,7 @@ export const SaveGithubProvider = ({ applicationId }: Props) => {
8183
},
8284
githubId: "",
8385
branch: "",
86+
enableSubmodules: false,
8487
},
8588
resolver: zodResolver(GithubProviderSchema),
8689
});
@@ -124,6 +127,7 @@ export const SaveGithubProvider = ({ applicationId }: Props) => {
124127
buildPath: data.buildPath || "/",
125128
githubId: data.githubId || "",
126129
watchPaths: data.watchPaths || [],
130+
enableSubmodules: data.enableSubmodules ?? false,
127131
});
128132
}
129133
}, [form.reset, data, form]);
@@ -137,6 +141,7 @@ export const SaveGithubProvider = ({ applicationId }: Props) => {
137141
buildPath: data.buildPath,
138142
githubId: data.githubId,
139143
watchPaths: data.watchPaths || [],
144+
enableSubmodules: data.enableSubmodules,
140145
})
141146
.then(async () => {
142147
toast.success("Service Provided Saved");
@@ -458,6 +463,22 @@ export const SaveGithubProvider = ({ applicationId }: Props) => {
458463
</FormItem>
459464
)}
460465
/>
466+
467+
<FormField
468+
control={form.control}
469+
name="enableSubmodules"
470+
render={({ field }) => (
471+
<FormItem className="flex items-center space-x-2">
472+
<FormControl>
473+
<Switch
474+
checked={field.value}
475+
onCheckedChange={field.onChange}
476+
/>
477+
</FormControl>
478+
<FormLabel className="!mt-0">Enable Submodules</FormLabel>
479+
</FormItem>
480+
)}
481+
/>
461482
</div>
462483
<div className="flex w-full justify-end">
463484
<Button

apps/dokploy/components/dashboard/application/general/generic/save-gitlab-provider.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import {
3131
SelectTrigger,
3232
SelectValue,
3333
} from "@/components/ui/select";
34+
import { Switch } from "@/components/ui/switch";
3435
import {
3536
Tooltip,
3637
TooltipContent,
@@ -60,6 +61,7 @@ const GitlabProviderSchema = z.object({
6061
branch: z.string().min(1, "Branch is required"),
6162
gitlabId: z.string().min(1, "Gitlab Provider is required"),
6263
watchPaths: z.array(z.string()).optional(),
64+
enableSubmodules: z.boolean().default(false),
6365
});
6466

6567
type GitlabProvider = z.infer<typeof GitlabProviderSchema>;
@@ -86,6 +88,7 @@ export const SaveGitlabProvider = ({ applicationId }: Props) => {
8688
},
8789
gitlabId: "",
8890
branch: "",
91+
enableSubmodules: false,
8992
},
9093
resolver: zodResolver(GitlabProviderSchema),
9194
});
@@ -135,6 +138,7 @@ export const SaveGitlabProvider = ({ applicationId }: Props) => {
135138
buildPath: data.gitlabBuildPath || "/",
136139
gitlabId: data.gitlabId || "",
137140
watchPaths: data.watchPaths || [],
141+
enableSubmodules: data.enableSubmodules ?? false,
138142
});
139143
}
140144
}, [form.reset, data, form]);
@@ -150,6 +154,7 @@ export const SaveGitlabProvider = ({ applicationId }: Props) => {
150154
gitlabProjectId: data.repository.id,
151155
gitlabPathNamespace: data.repository.gitlabPathNamespace,
152156
watchPaths: data.watchPaths || [],
157+
enableSubmodules: data.enableSubmodules,
153158
})
154159
.then(async () => {
155160
toast.success("Service Provided Saved");
@@ -483,6 +488,21 @@ export const SaveGitlabProvider = ({ applicationId }: Props) => {
483488
</FormItem>
484489
)}
485490
/>
491+
<FormField
492+
control={form.control}
493+
name="enableSubmodules"
494+
render={({ field }) => (
495+
<FormItem className="flex items-center space-x-2">
496+
<FormControl>
497+
<Switch
498+
checked={field.value}
499+
onCheckedChange={field.onChange}
500+
/>
501+
</FormControl>
502+
<FormLabel className="!mt-0">Enable Submodules</FormLabel>
503+
</FormItem>
504+
)}
505+
/>
486506
</div>
487507
<div className="flex w-full justify-end">
488508
<Button

apps/dokploy/components/dashboard/compose/general/generic/save-bitbucket-provider-compose.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import {
3131
SelectTrigger,
3232
SelectValue,
3333
} from "@/components/ui/select";
34+
import { Switch } from "@/components/ui/switch";
3435
import {
3536
Tooltip,
3637
TooltipContent,
@@ -58,6 +59,7 @@ const BitbucketProviderSchema = z.object({
5859
branch: z.string().min(1, "Branch is required"),
5960
bitbucketId: z.string().min(1, "Bitbucket Provider is required"),
6061
watchPaths: z.array(z.string()).optional(),
62+
enableSubmodules: z.boolean().default(false),
6163
});
6264

6365
type BitbucketProvider = z.infer<typeof BitbucketProviderSchema>;
@@ -84,6 +86,7 @@ export const SaveBitbucketProviderCompose = ({ composeId }: Props) => {
8486
bitbucketId: "",
8587
branch: "",
8688
watchPaths: [],
89+
enableSubmodules: false,
8790
},
8891
resolver: zodResolver(BitbucketProviderSchema),
8992
});
@@ -130,6 +133,7 @@ export const SaveBitbucketProviderCompose = ({ composeId }: Props) => {
130133
composePath: data.composePath,
131134
bitbucketId: data.bitbucketId || "",
132135
watchPaths: data.watchPaths || [],
136+
enableSubmodules: data.enableSubmodules ?? false,
133137
});
134138
}
135139
}, [form.reset, data, form]);
@@ -145,6 +149,7 @@ export const SaveBitbucketProviderCompose = ({ composeId }: Props) => {
145149
sourceType: "bitbucket",
146150
composeStatus: "idle",
147151
watchPaths: data.watchPaths,
152+
enableSubmodules: data.enableSubmodules,
148153
})
149154
.then(async () => {
150155
toast.success("Service Provided Saved");
@@ -469,6 +474,21 @@ export const SaveBitbucketProviderCompose = ({ composeId }: Props) => {
469474
</FormItem>
470475
)}
471476
/>
477+
<FormField
478+
control={form.control}
479+
name="enableSubmodules"
480+
render={({ field }) => (
481+
<FormItem className="flex items-center space-x-2">
482+
<FormControl>
483+
<Switch
484+
checked={field.value}
485+
onCheckedChange={field.onChange}
486+
/>
487+
</FormControl>
488+
<FormLabel className="!mt-0">Enable Submodules</FormLabel>
489+
</FormItem>
490+
)}
491+
/>
472492
</div>
473493
<div className="flex w-full justify-end">
474494
<Button

0 commit comments

Comments
 (0)