Root dizin taraması yerine repo URL tabanlı otomatik kurulum sistemine geçiş yapıldı.
Deploy klasörü artık repo URL'sinden otomatik oluşturuluyor. Remote repo
üzerinden branch ve compose dosyası listelemesi eklendi.
- `deploymentsRoot` konfigürasyonu kaldırıldı
- `/deployments/scan` endpoint'i kaldırıldı
- `/deployments/compose-files` endpoint'i eklendi
- `repoUrl` alanı unique ve index olarak işaretlendi
- Proje oluştururken `rootPath` zorunluluğu kaldırıldı
- Deploy klasörü otomatik `deployments/{slug}` formatında oluşturuluyor
- Frontend'de root tarama UI'ı kaldırıldı, compose dosyası listeleme eklendi
BREAKING CHANGE: Root dizin tarama özelliği ve `rootPath` alanı kaldırıldı.
Artık deploymentlar sadece repo URL ile oluşturulabiliyor.
50 lines
1.6 KiB
TypeScript
50 lines
1.6 KiB
TypeScript
import mongoose, { Schema, Document } from "mongoose";
|
|
|
|
export type ComposeFile = "docker-compose.yml" | "docker-compose.dev.yml";
|
|
export type DeploymentStatus = "idle" | "running" | "success" | "failed";
|
|
export type DeploymentEnv = "dev" | "prod";
|
|
|
|
export interface DeploymentProjectDocument extends Document {
|
|
name: string;
|
|
rootPath: string;
|
|
repoUrl: string;
|
|
branch: string;
|
|
composeFile: ComposeFile;
|
|
webhookToken: string;
|
|
env: DeploymentEnv;
|
|
port?: number;
|
|
lastDeployAt?: Date;
|
|
lastStatus: DeploymentStatus;
|
|
lastMessage?: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
}
|
|
|
|
const DeploymentProjectSchema = new Schema<DeploymentProjectDocument>(
|
|
{
|
|
name: { type: String, required: true, trim: true },
|
|
rootPath: { type: String, required: true, trim: true },
|
|
repoUrl: { type: String, required: true, trim: true, unique: true, index: true },
|
|
branch: { type: String, required: true, trim: true },
|
|
composeFile: {
|
|
type: String,
|
|
required: true,
|
|
enum: ["docker-compose.yml", "docker-compose.dev.yml"]
|
|
},
|
|
webhookToken: { type: String, required: true, unique: true, index: true },
|
|
env: { type: String, required: true, enum: ["dev", "prod"] },
|
|
port: { type: Number },
|
|
lastDeployAt: { type: Date },
|
|
lastStatus: { type: String, enum: ["idle", "running", "success", "failed"], default: "idle" },
|
|
lastMessage: { type: String }
|
|
},
|
|
{ timestamps: true }
|
|
);
|
|
|
|
DeploymentProjectSchema.index({ rootPath: 1 });
|
|
|
|
export const DeploymentProject = mongoose.model<DeploymentProjectDocument>(
|
|
"DeploymentProject",
|
|
DeploymentProjectSchema
|
|
);
|