Skip to content

Commit 7ecd162

Browse files
authored
Merge pull request #845 from Dokploy/canary
v0.14.0
2 parents 572579a + 96fbfa7 commit 7ecd162

File tree

107 files changed

+16704
-366
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+16704
-366
lines changed

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,14 @@ workflows:
9999
only:
100100
- main
101101
- canary
102-
- fix/build-i18n
102+
- 379-preview-deployment
103103
- build-arm64:
104104
filters:
105105
branches:
106106
only:
107107
- main
108108
- canary
109-
- fix/build-i18n
109+
- 379-preview-deployment
110110
- combine-manifests:
111111
requires:
112112
- build-amd64
@@ -116,4 +116,4 @@ workflows:
116116
only:
117117
- main
118118
- canary
119-
- fix/build-i18n
119+
- 379-preview-deployment

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ export function generate(schema: Schema): Template {
241241

242242
- Use the same name of the folder as the id of the template.
243243
- The logo should be in the public folder.
244-
- If you want to show a domain in the UI, please add the prefix \_HOST at the end of the variable name.
244+
- If you want to show a domain in the UI, please add the `_HOST` suffix at the end of the variable name.
245245
- Test first on a vps or a server to make sure the template works.
246246

247247
## Docs & Website

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ RUN apt-get update && apt-get install -y curl unzip apache2-utils && rm -rf /var
3535
COPY --from=build /prod/dokploy/.next ./.next
3636
COPY --from=build /prod/dokploy/dist ./dist
3737
COPY --from=build /prod/dokploy/next.config.mjs ./next.config.mjs
38-
COPY --from=build /prod/dokploy/next-i18next.config.cjs ./next-i18next.config.cjs
3938
COPY --from=build /prod/dokploy/public ./public
4039
COPY --from=build /prod/dokploy/package.json ./package.json
4140
COPY --from=build /prod/dokploy/drizzle ./drizzle

Dockerfile.cloud

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ RUN apt-get update && apt-get install -y curl unzip apache2-utils && rm -rf /var
4444
COPY --from=build /prod/dokploy/.next ./.next
4545
COPY --from=build /prod/dokploy/dist ./dist
4646
COPY --from=build /prod/dokploy/next.config.mjs ./next.config.mjs
47-
COPY --from=build /prod/dokploy/next-i18next.config.cjs ./next-i18next.config.cjs
4847
COPY --from=build /prod/dokploy/public ./public
4948
COPY --from=build /prod/dokploy/package.json ./package.json
5049
COPY --from=build /prod/dokploy/drizzle ./drizzle

LICENSE.MD

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ See the License for the specific language governing permissions and limitations
1717

1818
## Additional Terms for Specific Features
1919

20-
The following additional terms apply to the multi-node support, Docker Compose file and Multi Server features of Dokploy. In the event of a conflict, these provisions shall take precedence over those in the Apache License:
20+
The following additional terms apply to the multi-node support, Docker Compose file, Preview Deployments and Multi Server features of Dokploy. In the event of a conflict, these provisions shall take precedence over those in the Apache License:
2121

22-
- **Self-Hosted Version Free**: All features of Dokploy, including multi-node support, Docker Compose file support and Multi Server, will always be free to use in the self-hosted version.
23-
- **Restriction on Resale**: The multi-node support, Docker Compose file support and Multi Server features cannot be sold or offered as a service by any party other than the copyright holder without prior written consent.
24-
- **Modification Distribution**: Any modifications to the multi-node support, Docker Compose file support and Multi Server features must be distributed freely and cannot be sold or offered as a service.
22+
- **Self-Hosted Version Free**: All features of Dokploy, including multi-node support, Docker Compose file support, Preview Deployments and Multi Server, will always be free to use in the self-hosted version.
23+
- **Restriction on Resale**: The multi-node support, Docker Compose file support, Preview Deployments and Multi Server features cannot be sold or offered as a service by any party other than the copyright holder without prior written consent.
24+
- **Modification Distribution**: Any modifications to the multi-node support, Docker Compose file support, Preview Deployments and Multi Server features must be distributed freely and cannot be sold or offered as a service.
2525

2626
For further inquiries or permissions, please contact us directly.

apps/api/src/schema.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ export const deployJobSchema = z.discriminatedUnion("applicationType", [
1919
applicationType: z.literal("compose"),
2020
serverId: z.string().min(1),
2121
}),
22+
z.object({
23+
applicationId: z.string(),
24+
previewDeploymentId: z.string(),
25+
titleLog: z.string(),
26+
descriptionLog: z.string(),
27+
server: z.boolean().optional(),
28+
type: z.enum(["deploy"]),
29+
applicationType: z.literal("application-preview"),
30+
serverId: z.string().min(1),
31+
}),
2232
]);
2333

2434
export type DeployJob = z.infer<typeof deployJobSchema>;

apps/api/src/utils.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import {
22
deployRemoteApplication,
33
deployRemoteCompose,
4+
deployRemotePreviewApplication,
45
rebuildRemoteApplication,
56
rebuildRemoteCompose,
67
updateApplicationStatus,
78
updateCompose,
9+
updatePreviewDeployment,
810
} from "@dokploy/server";
911
import type { DeployJob } from "./schema";
1012

@@ -47,6 +49,20 @@ export const deploy = async (job: DeployJob) => {
4749
});
4850
}
4951
}
52+
} else if (job.applicationType === "application-preview") {
53+
await updatePreviewDeployment(job.previewDeploymentId, {
54+
previewStatus: "running",
55+
});
56+
if (job.server) {
57+
if (job.type === "deploy") {
58+
await deployRemotePreviewApplication({
59+
applicationId: job.applicationId,
60+
titleLog: job.titleLog,
61+
descriptionLog: job.descriptionLog,
62+
previewDeploymentId: job.previewDeploymentId,
63+
});
64+
}
65+
}
5066
}
5167
} catch (error) {
5268
if (job.applicationType === "application") {
@@ -55,6 +71,10 @@ export const deploy = async (job: DeployJob) => {
5571
await updateCompose(job.composeId, {
5672
composeStatus: "error",
5773
});
74+
} else if (job.applicationType === "application-preview") {
75+
await updatePreviewDeployment(job.previewDeploymentId, {
76+
previewStatus: "error",
77+
});
5878
}
5979
}
6080

apps/dokploy/LICENSE.MD

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ See the License for the specific language governing permissions and limitations
1717

1818
## Additional Terms for Specific Features
1919

20-
The following additional terms apply to the multi-node support, Docker Compose file and Multi Server features of Dokploy. In the event of a conflict, these provisions shall take precedence over those in the Apache License:
20+
The following additional terms apply to the multi-node support, Docker Compose file, Preview Deployments and Multi Server features of Dokploy. In the event of a conflict, these provisions shall take precedence over those in the Apache License:
2121

22-
- **Self-Hosted Version Free**: All features of Dokploy, including multi-node support, Docker Compose file support and Multi Server, will always be free to use in the self-hosted version.
23-
- **Restriction on Resale**: The multi-node support, Docker Compose file support and Multi Server features cannot be sold or offered as a service by any party other than the copyright holder without prior written consent.
24-
- **Modification Distribution**: Any modifications to the multi-node support, Docker Compose file support and Multi Server features must be distributed freely and cannot be sold or offered as a service.
22+
- **Self-Hosted Version Free**: All features of Dokploy, including multi-node support, Docker Compose file support, Preview Deployments and Multi Server, will always be free to use in the self-hosted version.
23+
- **Restriction on Resale**: The multi-node support, Docker Compose file support, Preview Deployments and Multi Server features cannot be sold or offered as a service by any party other than the copyright holder without prior written consent.
24+
- **Modification Distribution**: Any modifications to the multi-node support, Docker Compose file support, Preview Deployments and Multi Server features must be distributed freely and cannot be sold or offered as a service.
2525

2626
For further inquiries or permissions, please contact us directly.

apps/dokploy/__test__/compose/domain/labels.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ describe("createDomainLabels", () => {
1717
domainId: "",
1818
path: "/",
1919
createdAt: "",
20+
previewDeploymentId: "",
2021
};
2122

2223
it("should create basic labels for web entrypoint", async () => {

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,23 @@ if (typeof window === "undefined") {
2626

2727
const baseApp: ApplicationNested = {
2828
applicationId: "",
29+
herokuVersion: "",
2930
applicationStatus: "done",
3031
appName: "",
3132
autoDeploy: true,
3233
serverId: "",
3334
registryUrl: "",
3435
branch: null,
3536
dockerBuildStage: "",
37+
isPreviewDeploymentsActive: false,
38+
previewBuildArgs: null,
39+
previewCertificateType: "none",
40+
previewEnv: null,
41+
previewHttps: false,
42+
previewPath: "/",
43+
previewPort: 3000,
44+
previewLimit: 0,
45+
previewWildcard: "",
3646
project: {
3747
env: "",
3848
adminId: "",

0 commit comments

Comments
 (0)