configuration

package
v0.11.5 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// DefaultConfigFile is the name of the default configuration file
	DefaultConfigFile = "./stevedore"
	// DefaultConfigFileExtention is the default configuration file extention
	DefaultConfigFileExtention = "yaml"
	// DefaultConfigFolder is the default configuration folder
	DefaultConfigFolder = "."

	// DefaultBuildersPath is the default builders path
	DefaultBuildersPath = "stevedore.yaml"
	// DefaultCredentialsFormat is the default credentials format
	DefaultCredentialsFormat = credentials.JSONFormat
	// DefaultCredentialsLocalStoragePath is the default credentials local storage path
	DefaultCredentialsLocalStoragePath = "credentials"
	// DefaultCredentialsStorage is the default credentials storage
	DefaultCredentialsStorage = credentials.LocalStore
	// DefaultCredentialsEncryptionKey is an empty string
	DefaultCredentialsEncryptionKey = ""
	// DefaultEnableSemanticVersionTags is the default enable semantic version tags
	DefaultEnableSemanticVersionTags = false
	// DefaultImagesPath is the default images path
	DefaultImagesPath = "stevedore.yaml"
	// DefaultLogPathFile is the default log path file
	DefaultLogPathFile = ""
	// DefaultPushImages by default images won't be pushed
	DefaultPushImages = false
	// DefaultSemanticVersionTagsTemplates is the default semantic version tags templates
	DefaultSemanticVersionTagsTemplates = "{{ .Major }}.{{ .Minor }}.{{ .Patch }}"
	// DEPRECATEDDefaultBuilderPath is the default builder path
	DEPRECATEDDefaultBuilderPath = "stevedore.yaml"
	// DEPRECATEDDefaultBuildOnCascade
	DEPRECATEDDefaultBuildOnCascade = false
	// DEPRECATEDDefaultDockerCredentialsDir
	DEPRECATEDDefaultDockerCredentialsDir = "credentials"
	// DEPRECATEDDefaultNumWorker
	DEPRECATEDDefaultNumWorker = 4
	// DEPRECATEDDefaultTreePathFile
	DEPRECATEDDefaultTreePathFile = "stevedore.yaml"

	// BuildersPathKey is the key for the builders path
	BuildersPathKey = "builders_path"
	// ConcurrencyKey is the key for the concurrency value
	ConcurrencyKey = "concurrency"
	// CredentialsFormatKey is the key for the credentials format
	CredentialsFormatKey = "format"
	// CredentialsKey is the key for the credentials block
	CredentialsKey = "credentials"
	// CredentialsLocalStoragePathKey is the key for the credentials local storage path
	CredentialsLocalStoragePathKey = "local_storage_path"
	// CredentialsEncryptionKeyKey is the key for the credentials encryption token
	CredentialsEncryptionKeyKey = "encryption_key"
	// CredentialsStorageTypeKey is the key for the credentials storage type
	CredentialsStorageTypeKey = "storage_type"
	// DEPRECATEDBuilderPathKey is the key for the deprecated builder path
	DEPRECATEDBuilderPathKey = "builder_path"
	// DEPRECATEDBuildOnCascadeKey is the key for the deprecated build on cascade value
	DEPRECATEDBuildOnCascadeKey = "build_on_cascade"
	// DEPRECATEDDockerCredentialsDirKey is the key for the deprecated docker credentials dir
	DEPRECATEDDockerCredentialsDirKey = "docker_registry_credentials_dir"
	// DEPRECATEDNumWorkerKey is the key for the deprecated number of workers
	DEPRECATEDNumWorkerKey = "num_workers"
	// DEPRECATEDTreePathFileKey is the key for the deprecated tree path file
	DEPRECATEDTreePathFileKey = "tree_path"
	// EnableSemanticVersionTagsKey is the key for the enable semantic version tags value
	EnableSemanticVersionTagsKey = "semantic_version_tags_enabled"
	// ImagesPathKey is the key for the images path
	ImagesPathKey = "images_path"
	// LogPathFileKey is the key for the log path file
	LogPathFileKey = "log_path"
	// PushImagesKey is the key for the push images value
	PushImagesKey = "push_images"
	// SemanticVersionTagsTemplatesKey is the key for the semantic version tags templates
	SemanticVersionTagsTemplatesKey = "semantic_version_tags_templates"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Compatibilitier

type Compatibilitier interface {
	AddDeprecated(deprecated ...string)
	AddRemoved(removed ...string)
	AddChanged(changed ...string)
}

Compatibilitier is the interface for the compatibility checker

type Configuration

type Configuration struct {
	// BuildersPath is the path where the builders are stored
	BuildersPath string
	// Concurrency is the number of concurrent builds
	Concurrency int
	// Credentials is the credentials configuration block
	Credentials *CredentialsConfiguration
	// DEPRECATEDBuilderPath is the path where the builders are stored
	DEPRECATEDBuilderPath string
	// DEPRECATEDBuildOnCascade is the flag to build on cascade
	DEPRECATEDBuildOnCascade bool
	// DEPRECATEDDockerCredentialsDir is the path to the docker credentials directory
	DEPRECATEDDockerCredentialsDir string
	// DEPRECATEDNumWorkers is the number of concurrent workers
	DEPRECATEDNumWorkers int
	// DEPRECATEDTreePathFile is the path to the tree path file
	DEPRECATEDTreePathFile string
	// EnableSemanticVersionTags is the flag to enable semantic version tags
	EnableSemanticVersionTags bool
	// ImagesPath is the path where the images are stored
	ImagesPath string
	// LogPathFile is the path to the log file
	LogPathFile string
	// LogWriter is the writer to the log file
	LogWriter io.Writer
	// PushImages is the flag to push images automatically after build
	PushImages bool
	// SemanticVersionTagsTemplates is the list of semantic version tags templates
	SemanticVersionTagsTemplates []string
	// contains filtered or unexported fields
}

func DefaultConfig

func DefaultConfig() *Configuration

func LoadFromFile

func LoadFromFile(fs afero.Fs, loader ConfigurationLoader, file string, compatibility Compatibilitier) (*Configuration, error)

LoadFromFile method returns a configuration object loaded from a file

func New

func New(fs afero.Fs, loader ConfigurationLoader, compatibility Compatibilitier) (*Configuration, error)

New method create a new configuration object

func (*Configuration) CheckCompatibility

func (c *Configuration) CheckCompatibility() error

CheckCompatibility

func (*Configuration) ConfigFileUsed

func (c *Configuration) ConfigFileUsed() string

ConfigFileUsed return which is the config file used to load the configuration

func (*Configuration) ReloadConfigurationFromFile

func (c *Configuration) ReloadConfigurationFromFile(file string) error

ReloadConfigurationFromFile

func (*Configuration) ValidateConfiguration

func (c *Configuration) ValidateConfiguration() error

ValidateConfiguration method validates the configuration

type ConfigurationLoader

type ConfigurationLoader interface {
	AddConfigPath(in string)
	AutomaticEnv()
	GetBool(key string) bool
	GetInt(key string) int
	GetString(key string) string
	GetStringSlice(key string) []string
	ReadInConfig() error
	SetConfigFile(in string)
	SetConfigName(in string)
	SetConfigType(in string)
	SetDefault(key string, value interface{})
	SetEnvPrefix(in string)
	SetFs(fs afero.Fs)
	ConfigFileUsed() string
	SetEnvKeyReplacer(*strings.Replacer)
}

ConfigurationLoader is the interface for the configuration loader

type ConfigurationWriter

type ConfigurationWriter interface {
	Write(config *Configuration) error
}

type CredentialsConfiguration

type CredentialsConfiguration struct {
	// StorageType is the backend used to store credentials
	StorageType string
	// LocalStoragePath is the local storage path where credentials are stored
	LocalStoragePath string
	// Format defines the format to store credentials, in case a format is required
	Format string
	// EncryptionKey is the key used to encrypt credentials
	EncryptionKey string
}

Directories

Path Synopsis
output

Jump to

Keyboard shortcuts

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