feat: Add Git workspace management for build profiles and implement workspace cleanup
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
-- Create enums for gateway profile tracking
|
||||
CREATE TYPE "GatewayProfileStatus" AS ENUM (
|
||||
'COMPLETED',
|
||||
'RESERVED',
|
||||
'RUNNING',
|
||||
'STOPPED',
|
||||
'DISABLED'
|
||||
);
|
||||
|
||||
CREATE TYPE "GatewayBuildStatus" AS ENUM (
|
||||
'IDLE',
|
||||
'QUEUED',
|
||||
'RUNNING',
|
||||
'FAILED',
|
||||
'SUCCEEDED'
|
||||
);
|
||||
|
||||
-- Create gateway profile table
|
||||
CREATE TABLE "gateway_profile" (
|
||||
"profile_name" TEXT NOT NULL,
|
||||
"profile" TEXT NOT NULL,
|
||||
"scenario" TEXT NOT NULL,
|
||||
"api_port" INTEGER NOT NULL,
|
||||
"status" "GatewayProfileStatus" NOT NULL,
|
||||
"build_status" "GatewayBuildStatus" NOT NULL DEFAULT 'IDLE',
|
||||
"build_commit_sha" TEXT,
|
||||
"build_workspace" TEXT,
|
||||
"build_last_used_at" TIMESTAMP(3),
|
||||
"scheduled_start_at" TIMESTAMP(3),
|
||||
"build_requested_at" TIMESTAMP(3),
|
||||
"build_started_at" TIMESTAMP(3),
|
||||
"build_completed_at" TIMESTAMP(3),
|
||||
"build_error" TEXT,
|
||||
"last_error" TEXT,
|
||||
"meta" JSONB NOT NULL DEFAULT '{}'::jsonb,
|
||||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
|
||||
CONSTRAINT "gateway_profile_pkey" PRIMARY KEY ("profile_name"),
|
||||
CONSTRAINT "gateway_profile_profile_scenario_key" UNIQUE ("profile", "scenario")
|
||||
);
|
||||
|
||||
@@ -69,6 +69,9 @@ model GatewayProfile {
|
||||
apiPort Int @map("api_port")
|
||||
status GatewayProfileStatus
|
||||
buildStatus GatewayBuildStatus @default(IDLE) @map("build_status")
|
||||
buildCommitSha String? @map("build_commit_sha")
|
||||
buildWorkspace String? @map("build_workspace")
|
||||
buildLastUsedAt DateTime? @map("build_last_used_at")
|
||||
scheduledStartAt DateTime? @map("scheduled_start_at")
|
||||
buildRequestedAt DateTime? @map("build_requested_at")
|
||||
buildStartedAt DateTime? @map("build_started_at")
|
||||
|
||||
Reference in New Issue
Block a user