mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
feat(applications): add watch paths for selective deployments
- Implement watch paths feature for GitHub and GitLab applications and compose services - Add ability to specify paths that trigger deployments when changed - Update database schemas to support watch paths - Integrate micromatch for flexible path matching - Enhance deployment triggers with granular file change detection
This commit is contained in:
@@ -116,6 +116,7 @@ export const applications = pgTable("application", {
|
||||
description: text("description"),
|
||||
env: text("env"),
|
||||
previewEnv: text("previewEnv"),
|
||||
watchPaths: text("watchPaths").array(),
|
||||
previewBuildArgs: text("previewBuildArgs"),
|
||||
previewWildcard: text("previewWildcard"),
|
||||
previewPort: integer("previewPort").default(3000),
|
||||
@@ -406,6 +407,7 @@ const createSchema = createInsertSchema(applications, {
|
||||
previewHttps: z.boolean().optional(),
|
||||
previewPath: z.string().optional(),
|
||||
previewCertificateType: z.enum(["letsencrypt", "none", "custom"]).optional(),
|
||||
watchPaths: z.array(z.string()).optional(),
|
||||
});
|
||||
|
||||
export const apiCreateApplication = createSchema.pick({
|
||||
@@ -449,6 +451,7 @@ export const apiSaveGithubProvider = createSchema
|
||||
owner: true,
|
||||
buildPath: true,
|
||||
githubId: true,
|
||||
watchPaths: true,
|
||||
})
|
||||
.required();
|
||||
|
||||
@@ -462,6 +465,7 @@ export const apiSaveGitlabProvider = createSchema
|
||||
gitlabId: true,
|
||||
gitlabProjectId: true,
|
||||
gitlabPathNamespace: true,
|
||||
watchPaths: true,
|
||||
})
|
||||
.required();
|
||||
|
||||
@@ -473,6 +477,7 @@ export const apiSaveBitbucketProvider = createSchema
|
||||
bitbucketRepository: true,
|
||||
bitbucketId: true,
|
||||
applicationId: true,
|
||||
watchPaths: true,
|
||||
})
|
||||
.required();
|
||||
|
||||
@@ -492,6 +497,7 @@ export const apiSaveGitProvider = createSchema
|
||||
applicationId: true,
|
||||
customGitBuildPath: true,
|
||||
customGitUrl: true,
|
||||
watchPaths: true,
|
||||
})
|
||||
.required()
|
||||
.merge(
|
||||
|
||||
@@ -77,7 +77,7 @@ export const compose = pgTable("compose", {
|
||||
createdAt: text("createdAt")
|
||||
.notNull()
|
||||
.$defaultFn(() => new Date().toISOString()),
|
||||
|
||||
watchPaths: text("watchPaths").array(),
|
||||
githubId: text("githubId").references(() => github.githubId, {
|
||||
onDelete: "set null",
|
||||
}),
|
||||
@@ -132,6 +132,7 @@ const createSchema = createInsertSchema(compose, {
|
||||
command: z.string().optional(),
|
||||
composePath: z.string().min(1),
|
||||
composeType: z.enum(["docker-compose", "stack"]).optional(),
|
||||
watchPaths: z.array(z.string()).optional(),
|
||||
});
|
||||
|
||||
export const apiCreateCompose = createSchema.pick({
|
||||
|
||||
Reference in New Issue
Block a user