Add Gitea, Cloudflare DNS, and Kubernetes deployer adapters following hexagonal architecture. These enable automated project provisioning: - Git repository creation/management via Gitea - DNS record management via Cloudflare - Container deployment to Kubernetes Includes domain models, ports, handlers, and Woodpecker CI webhook integration for automated deployments on push. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
34 lines
1.2 KiB
Go
34 lines
1.2 KiB
Go
// Package port defines interfaces (ports) for external dependencies.
|
|
package port
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/orchard9/rdev/internal/domain"
|
|
)
|
|
|
|
// Deployer manages application deployments to Kubernetes.
|
|
type Deployer interface {
|
|
// Deploy creates or updates a deployment for a project.
|
|
// This includes creating/updating Deployment, Service, and Ingress resources.
|
|
Deploy(ctx context.Context, spec domain.DeploySpec) error
|
|
|
|
// Undeploy removes all deployment resources for a project.
|
|
Undeploy(ctx context.Context, projectName string) error
|
|
|
|
// GetStatus returns the current deployment status for a project.
|
|
// Returns nil if no deployment exists.
|
|
GetStatus(ctx context.Context, projectName string) (*domain.DeployStatus, error)
|
|
|
|
// Restart triggers a rolling restart of the deployment.
|
|
// This is useful for picking up new images with the same tag.
|
|
Restart(ctx context.Context, projectName string) error
|
|
|
|
// Scale adjusts the replica count for a deployment.
|
|
Scale(ctx context.Context, projectName string, replicas int) error
|
|
|
|
// GetLogs returns recent logs from the deployment pods.
|
|
// tailLines specifies how many recent lines to return.
|
|
GetLogs(ctx context.Context, projectName string, tailLines int) (string, error)
|
|
}
|