appconfig

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultWorkflowConfig

func DefaultWorkflowConfig(defaultBranch string) *orderedmap.OrderedMap[string, WorkflowConfig]

func LoadPlan

func LoadPlan(projectDirectory string, file string) (plangenerate.Plan, error)

func PersistPlan

func PersistPlan(plan plangenerate.Plan, file string) error

PersistPlan saves the workflow plan to a file in the specified project directory.

func WorkflowStateJSON

func WorkflowStateJSON(state *WorkflowState) (string, error)

func WriteWorkflowState

func WriteWorkflowState(state *WorkflowState, file string) error

Types

type ChangeEntry

type ChangeEntry struct {
	Workflow string
	Scope    string
	Message  string
}

type Config

type Config struct {
	Version          string   `json:"version" env:"CLI_VERSION" validate:"required"`         // Version of this project
	JobTimeout       int      `json:"job_timeout" env:"JOB_TIMEOUT" validate:"required"`     // Timeout for the job in minutes
	JobRetries       int      `json:"job_retries" env:"JOB_RETRIES" validate:"required"`     // Number of retries for the job
	RunnerTags       []string `json:"runner_tags" env:"RUNNER_TAGS" validate:"required"`     // Tags for the runner jobs (e.g. "docker", "podman", ...)
	EgressPolicy     string   `json:"egress_policy" env:"EGRESS_POLICY" validate:"required"` // Egress policy for network traffic (block, audit, ...)
	ContainerRuntime string   `json:"container_runtime" env:"CONTAINER_RUNTIME" validate:"required,oneof=podman docker"`

	Workflows *orderedmap.OrderedMap[string, WorkflowConfig] `json:"workflows"`
}

type RenderWorkflowResult

type RenderWorkflowResult struct {
	Plan            plangenerate.Plan
	WorkflowContent string
}

type WorkflowConfig

type WorkflowConfig struct {
	Type                string   `json:"type"` // e.g. "cron", "dispatch", "manual"
	TriggerManual       bool     `json:"trigger_manual,omitempty"`
	TriggerSchedule     bool     `json:"trigger_cron,omitempty"`
	TriggerScheduleCron string   `json:"trigger_cron_schedule,omitempty"`
	TriggerPush         bool     `json:"trigger_push,omitempty"`
	TriggerPushBranches []string `json:"trigger_push_branches,omitempty"`
	TriggerPushTags     []string `json:"trigger_push_tags,omitempty"`
	TriggerPullRequest  bool     `json:"trigger_pull_request,omitempty"`
	EnvironmentPattern  string   `json:"environment_pattern,omitempty"` // EnvironmentPattern can be a regex or glob pattern to match which environments should be deployed from this workflow
}

func PreProcessWorkflowConfig

func PreProcessWorkflowConfig(wfConfig WorkflowConfig, repo api.Repository) WorkflowConfig

type WorkflowData

type WorkflowData struct {
	Version                      string                           `json:"version"`
	Name                         string                           `json:"name"`
	NameSlug                     string                           `json:"name_slug"`
	JobTimeout                   int                              `json:"job_timeout"`
	DefaultBranch                string                           `json:"default_branch"`
	ContainerRuntime             string                           `json:"container_runtime"`
	WorkflowKey                  string                           `json:"workflow_key"`
	WorkflowConfig               WorkflowConfig                   `json:"workflow_config"`
	Plan                         plangenerate.Plan                `json:"plan"`
	WorkflowDependency           map[string]dependency.Dependency `json:"-"`
	ReferencedWorkflowDependency map[string]dependency.Dependency `json:"workflow_dependency"`
	IgnoreFiles                  []string                         `json:"ignore_files"`
}

func GenerateWorkflowData

func GenerateWorkflowData(cidContext *context.CIDContext, taskContext taskcommon.TaskContext, conf Config, wfName string, wfConfig WorkflowConfig, vars []api.CIVariable, environments map[string]appcommon.VCSEnvironment, wfDependencies map[string]dependency.Dependency, networkAllowGlobal []catalog.ActionAccessNetwork) (WorkflowData, error)

GenerateWorkflowData generates the workflow template data

func (*WorkflowData) GetDependency

func (t *WorkflowData) GetDependency(key string) dependency.Dependency

func (*WorkflowData) GetDependencyReference

func (t *WorkflowData) GetDependencyReference(key string) string

type WorkflowState

type WorkflowState struct {
	Workflows *orderedmap.OrderedMap[string, *WorkflowData] `json:"workflows"`
}

func NewWorkflowState

func NewWorkflowState() *WorkflowState

func ReadWorkflowState

func ReadWorkflowState(file string) (WorkflowState, error)

func (*WorkflowState) CompareTo

func (w *WorkflowState) CompareTo(other *WorkflowState) []ChangeEntry

func (*WorkflowState) Hash

func (w *WorkflowState) Hash() (string, error)

Jump to

Keyboard shortcuts

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