cicd

package
v0.0.0-...-dca53db Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2025 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationInfo

type ApplicationInfo struct {
	Name        string            `json:"name"`
	Namespace   string            `json:"namespace"`
	Image       string            `json:"image"`
	Replicas    string            `json:"replicas"`
	Status      string            `json:"status"`
	ServiceName string            `json:"service_name,omitempty"`
	Port        int32             `json:"port,omitempty"`
	IngressURL  string            `json:"ingress_url,omitempty"`
	CreatedAt   time.Time         `json:"created_at"`
	Labels      map[string]string `json:"labels"`
}

type BuildConfig

type BuildConfig struct {
	Name          string
	Namespace     string
	SourceRepo    string
	SourceBranch  string
	Dockerfile    string
	ContextPath   string
	ImageName     string
	ImageTag      string
	BuildArgs     map[string]string
	Labels        map[string]string
	BuildStrategy string // "docker" or "openshift"
}

type BuildResult

type BuildResult struct {
	ImageName     string
	ImageTag      string
	FullImageName string
	BuildTime     time.Duration
	BuildLogs     string
	Success       bool
	Error         error
}

type CommitCallback

type CommitCallback func(event CommitEvent) error

type CommitEvent

type CommitEvent struct {
	RepoURL    string
	Branch     string
	CommitHash string
	Message    string
	Author     string
	Timestamp  time.Time
	Files      []string
}

type DeploymentAutomation

type DeploymentAutomation struct {
	// contains filtered or unexported fields
}

func NewDeploymentAutomation

func NewDeploymentAutomation(kubeConfig *rest.Config) (*DeploymentAutomation, error)

func (*DeploymentAutomation) DeleteApplication

func (da *DeploymentAutomation) DeleteApplication(ctx context.Context, namespace, name string) error

func (*DeploymentAutomation) DeployApplication

func (da *DeploymentAutomation) DeployApplication(ctx context.Context, config DeploymentConfig) (*DeploymentResult, error)

func (*DeploymentAutomation) ListApplications

func (da *DeploymentAutomation) ListApplications(ctx context.Context, namespace string) ([]ApplicationInfo, error)

type DeploymentConfig

type DeploymentConfig struct {
	Name          string
	Namespace     string
	Image         string
	Tag           string
	Replicas      int32
	Port          int32
	ServiceType   string
	Labels        map[string]string
	Annotations   map[string]string
	EnvVars       map[string]string
	Resources     *ResourceRequirements
	Strategy      string // "recreate", "rolling", "blue-green"
	ExposeIngress bool
	IngressDomain string
}

type DeploymentResult

type DeploymentResult struct {
	Name        string
	Namespace   string
	Image       string
	Status      string
	Replicas    string
	ServiceName string
	IngressURL  string
	DeployTime  time.Duration
	Success     bool
	Error       error
	Logs        []string
}

type DeploymentTemplate

type DeploymentTemplate struct {
	DefaultReplicas  int32
	DefaultPort      int32
	DefaultResources *ResourceRequirements
	DefaultLabels    map[string]string
	DefaultEnvVars   map[string]string
}

type GitWatcher

type GitWatcher struct {
	// contains filtered or unexported fields
}

func NewGitWatcher

func NewGitWatcher(pollInterval time.Duration) *GitWatcher

func (*GitWatcher) AddCommitCallback

func (gw *GitWatcher) AddCommitCallback(callback CommitCallback)

func (*GitWatcher) AddRepository

func (gw *GitWatcher) AddRepository(url, branch string, credentials *http.BasicAuth) error

func (*GitWatcher) AddWebhook

func (gw *GitWatcher) AddWebhook(repoURL string, config *WebhookConfig)

func (*GitWatcher) GetRepositories

func (gw *GitWatcher) GetRepositories() map[string]*Repository

func (*GitWatcher) HandleWebhook

func (gw *GitWatcher) HandleWebhook(repoURL string, payload []byte) error

func (*GitWatcher) RemoveRepository

func (gw *GitWatcher) RemoveRepository(url, branch string)

func (*GitWatcher) StartPolling

func (gw *GitWatcher) StartPolling(ctx context.Context)

type ImageBuilder

type ImageBuilder struct {
	// contains filtered or unexported fields
}

func NewImageBuilder

func NewImageBuilder(kubeConfig *rest.Config, defaultNamespace string) (*ImageBuilder, error)

func (*ImageBuilder) BuildImage

func (ib *ImageBuilder) BuildImage(ctx context.Context, config BuildConfig) (*BuildResult, error)

func (*ImageBuilder) DeleteImage

func (ib *ImageBuilder) DeleteImage(ctx context.Context, imageName string, namespace string) error

func (*ImageBuilder) ListImages

func (ib *ImageBuilder) ListImages(ctx context.Context, namespace string) ([]string, error)

type ImageInfo

type ImageInfo struct {
	Repository string            `json:"repository"`
	Tag        string            `json:"tag"`
	Registry   string            `json:"registry"`
	Digest     string            `json:"digest"`
	Size       int64             `json:"size"`
	CreatedAt  time.Time         `json:"created_at"`
	Labels     map[string]string `json:"labels"`
}

type PushConfig

type PushConfig struct {
	SourceImage  string
	TargetImage  string
	TargetTag    string
	Registry     string
	Namespace    string
	RegistryAuth *RegistryConfig
	Labels       map[string]string
	Annotations  map[string]string
}

type PushResult

type PushResult struct {
	SourceImage   string
	TargetImage   string
	FullImageName string
	PushTime      time.Duration
	PushLogs      string
	Success       bool
	Error         error
	Digest        string
}

type RegistryConfig

type RegistryConfig struct {
	URL      string
	Username string
	Password string
	Email    string
	Secure   bool
}

type RegistryPusher

type RegistryPusher struct {
	// contains filtered or unexported fields
}

func NewRegistryPusher

func NewRegistryPusher(kubeConfig *rest.Config) (*RegistryPusher, error)

func (*RegistryPusher) AddRegistry

func (rp *RegistryPusher) AddRegistry(name string, config *RegistryConfig)

func (*RegistryPusher) DeleteImage

func (rp *RegistryPusher) DeleteImage(ctx context.Context, registryName, repository, tag string) error

func (*RegistryPusher) GetImageInfo

func (rp *RegistryPusher) GetImageInfo(ctx context.Context, registryName, repository, tag string) (*ImageInfo, error)

func (*RegistryPusher) GetRegistries

func (rp *RegistryPusher) GetRegistries() map[string]*RegistryConfig

func (*RegistryPusher) ListRepositories

func (rp *RegistryPusher) ListRepositories(ctx context.Context, registryName string) ([]string, error)

func (*RegistryPusher) ListTags

func (rp *RegistryPusher) ListTags(ctx context.Context, registryName, repository string) ([]string, error)

func (*RegistryPusher) PushImage

func (rp *RegistryPusher) PushImage(ctx context.Context, config PushConfig) (*PushResult, error)

func (*RegistryPusher) RemoveRegistry

func (rp *RegistryPusher) RemoveRegistry(name string)

func (*RegistryPusher) ValidateRegistryAccess

func (rp *RegistryPusher) ValidateRegistryAccess(ctx context.Context, registryName string) error

type Repository

type Repository struct {
	URL         string
	Branch      string
	LastCommit  string
	Credentials *http.BasicAuth
	LocalPath   string
}

type ResourceRequirements

type ResourceRequirements struct {
	Requests map[string]string
	Limits   map[string]string
}

type WebhookConfig

type WebhookConfig struct {
	Secret   string
	Events   []string
	Endpoint string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL