Documentation
¶
Index ¶
- type CacheManager
- func (cm *CacheManager) GenerateCacheKey(serviceName string, service *config.ServiceConfig) (string, error)
- func (cm *CacheManager) GetBuildCommand(imageName, buildContext string, service *config.ServiceConfig) string
- func (cm *CacheManager) GetBuildKitFlags(serviceName string, service *config.ServiceConfig) []string
- func (cm *CacheManager) GetLocalCachePath(serviceName string) string
- func (cm *CacheManager) IsCached(serviceName string) bool
- func (cm *CacheManager) OptimizeBuildContext(buildPath string) ([]string, error)
- func (cm *CacheManager) SaveImageToCache(imageName, serviceName string) error
- type CacheStats
- type Deployer
- func (d *Deployer) BuildImage(serviceName string, service *config.ServiceConfig) (string, error)
- func (d *Deployer) CheckPortAvailability(port int) (*PortInfo, error)
- func (d *Deployer) DeployServiceSwarm(serviceName string, service *config.ServiceConfig, fullImageName string) error
- func (d *Deployer) ResolvePortConflict(portInfo *PortInfo, serviceName string, autoKill bool) error
- func (d *Deployer) RollbackToState(serviceName string, serviceState *state.ServiceState) error
- func (d *Deployer) SetupSwarmCluster() error
- func (d *Deployer) VerifyNetworkSetup() error
- type EnhancedBuildResult
- type HealthChecker
- type IgnoreParser
- type PortInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheManager ¶
type CacheManager struct {
// contains filtered or unexported fields
}
CacheManager handles build caching using Docker BuildKit
func NewCacheManager ¶
func NewCacheManager(projectName, environment string, verbose bool) *CacheManager
NewCacheManager creates a new cache manager
func (*CacheManager) GenerateCacheKey ¶
func (cm *CacheManager) GenerateCacheKey(serviceName string, service *config.ServiceConfig) (string, error)
GenerateCacheKey generates a cache key for a service based on its build context
func (*CacheManager) GetBuildCommand ¶
func (cm *CacheManager) GetBuildCommand(imageName, buildContext string, service *config.ServiceConfig) string
GetBuildCommand returns the enhanced build command with caching
func (*CacheManager) GetBuildKitFlags ¶
func (cm *CacheManager) GetBuildKitFlags(serviceName string, service *config.ServiceConfig) []string
GetBuildKitFlags returns Docker BuildKit flags for caching
func (*CacheManager) GetLocalCachePath ¶
func (cm *CacheManager) GetLocalCachePath(serviceName string) string
GetLocalCachePath returns the local cache path for a service
func (*CacheManager) IsCached ¶
func (cm *CacheManager) IsCached(serviceName string) bool
IsCached checks if a cached image exists locally
func (*CacheManager) OptimizeBuildContext ¶
func (cm *CacheManager) OptimizeBuildContext(buildPath string) ([]string, error)
OptimizeBuildContext creates an optimized build context by excluding unnecessary files
func (*CacheManager) SaveImageToCache ¶
func (cm *CacheManager) SaveImageToCache(imageName, serviceName string) error
SaveImageToCache saves a Docker image to local cache
type CacheStats ¶
CacheStats tracks cache hit/miss statistics
func (*CacheStats) GetHitRate ¶
func (cs *CacheStats) GetHitRate() float64
GetHitRate returns the cache hit rate as a percentage
type Deployer ¶
type Deployer struct {
// contains filtered or unexported fields
}
Deployer handles deployment operations
func NewDeployer ¶
func NewDeployer(client *ssh.Client, cfg *config.Config, environment string, verbose bool) *Deployer
NewDeployer creates a new deployer
func NewDeployerWithPool ¶
func NewDeployerWithPool(client *ssh.Client, cfg *config.Config, environment string, sshPool *ssh.Pool, verbose bool) *Deployer
NewDeployerWithPool creates a deployer with SSH pool for multi-server support
func (*Deployer) BuildImage ¶
BuildImage builds a Docker image for a service without deploying it This is used for Swarm mode where we need to build first, then deploy with docker service create
func (*Deployer) CheckPortAvailability ¶
CheckPortAvailability checks if a port is available on the server
func (*Deployer) DeployServiceSwarm ¶
func (d *Deployer) DeployServiceSwarm(serviceName string, service *config.ServiceConfig, fullImageName string) error
DeployServiceSwarm deploys a service to Docker Swarm
func (*Deployer) ResolvePortConflict ¶
ResolvePortConflict attempts to resolve a port conflict
func (*Deployer) RollbackToState ¶
func (d *Deployer) RollbackToState(serviceName string, serviceState *state.ServiceState) error
RollbackToState rolls back a Swarm service to a specific deployment state
func (*Deployer) SetupSwarmCluster ¶
SetupSwarmCluster initializes the Docker Swarm cluster
func (*Deployer) VerifyNetworkSetup ¶
VerifyNetworkSetup verifies that Traefik is connected to all project networks
type EnhancedBuildResult ¶
type EnhancedBuildResult struct {
ServiceName string
ImageName string
Duration time.Duration
CacheHit bool
Error error
}
EnhancedBuildResult contains build result with cache information
func (*EnhancedBuildResult) String ¶
func (r *EnhancedBuildResult) String() string
String returns a string representation of the result
type HealthChecker ¶
type HealthChecker struct {
// contains filtered or unexported fields
}
HealthChecker handles container health verification
func NewHealthChecker ¶
func NewHealthChecker(client *ssh.Client, verbose bool) *HealthChecker
NewHealthChecker creates a new health checker
func (*HealthChecker) VerifyDatabaseConnectivity ¶
func (hc *HealthChecker) VerifyDatabaseConnectivity(containerName string, service *config.ServiceConfig) error
VerifyDatabaseConnectivity verifies that a service can reach its database
func (*HealthChecker) WaitForHealthy ¶
func (hc *HealthChecker) WaitForHealthy(containerName string, retries int) error
WaitForHealthy waits for a container to become healthy
type IgnoreParser ¶
type IgnoreParser struct {
// contains filtered or unexported fields
}
IgnoreParser handles parsing of .gitignore and .dockerignore files
func NewIgnoreParser ¶
func NewIgnoreParser() *IgnoreParser
NewIgnoreParser creates a new ignore parser
func (*IgnoreParser) AddDefaultExclusions ¶
func (ip *IgnoreParser) AddDefaultExclusions()
AddDefaultExclusions adds commonly excluded patterns
func (*IgnoreParser) GetExcludedPatterns ¶
func (ip *IgnoreParser) GetExcludedPatterns() []string
GetExcludedPatterns returns all exclusion patterns
func (*IgnoreParser) LoadIgnoreFile ¶
func (ip *IgnoreParser) LoadIgnoreFile(filePath string) error
LoadIgnoreFile loads patterns from a .gitignore or .dockerignore file
func (*IgnoreParser) ShouldIgnore ¶
func (ip *IgnoreParser) ShouldIgnore(relPath string) bool
ShouldIgnore checks if a file path should be ignored