Documentation
¶
Index ¶
Constants ¶
View Source
const ( ConfigFileName = "pctl.yml" DefaultComposeFile = "docker-compose.yml" // Build mode constants BuildModeRemoteBuild = "remote-build" BuildModeLoad = "load" // Build parallel constants BuildParallelAuto = "auto" // Default build configuration values DefaultBuildMode = BuildModeRemoteBuild DefaultBuildParallel = BuildParallelAuto DefaultBuildTagFormat = "pctl-{{stack}}-{{service}}:{{hash}}" DefaultBuildWarnThresholdMB = 50 )
Variables ¶
This section is empty.
Functions ¶
func GetDefaultComposeFile ¶
func GetDefaultComposeFile() string
GetDefaultComposeFile returns the default compose file path
func GetDefaultSkipTLSVerify ¶
func GetDefaultSkipTLSVerify() bool
GetDefaultSkipTLSVerify returns the default value for skip_tls_verify
func GetDefaultStackName ¶
func GetDefaultStackName() string
GetDefaultStackName generates a default stack name based on the current directory
Types ¶
type BuildConfig ¶
type BuildConfig struct {
Mode string `yaml:"mode"` // remote-build | load
Parallel string `yaml:"parallel"` // auto | number
TagFormat string `yaml:"tag_format"` // template with {{stack}}, {{service}}, {{hash}}, {{timestamp}}
Platforms []string `yaml:"platforms"` // used for load mode local builds
ExtraBuildArgs map[string]string `yaml:"extra_build_args"` // optional global overrides
ForceBuild bool `yaml:"force_build"` // force rebuild even if unchanged
WarnThresholdMB int `yaml:"warn_threshold_mb"` // WARN if tar/image stream exceeds this size
}
BuildConfig represents the build configuration
func (*BuildConfig) Validate ¶
func (bc *BuildConfig) Validate() error
ValidateBuildConfig validates the build configuration
type Config ¶
type Config struct {
PortainerURL string `yaml:"portainer_url"`
APIToken string `yaml:"api_token"`
EnvironmentID int `yaml:"environment_id"`
StackName string `yaml:"stack_name"`
ComposeFile string `yaml:"compose_file"`
SkipTLSVerify bool `yaml:"skip_tls_verify"`
Build *BuildConfig `yaml:"build,omitempty"`
}
Config represents the pctl configuration structure
func (*Config) GetBuildConfig ¶
func (c *Config) GetBuildConfig() *BuildConfig
GetBuildConfig returns the build configuration with defaults applied
Click to show internal directories.
Click to hide internal directories.