Documentation ¶
Index ¶
- Constants
- Variables
- func Checksum(content string) string
- func FileChecksum(filename string) (string, error)
- func IsTemplatedString(s string) bool
- func Merge(valuesFiles ...map[string]interface{}) (results map[string]interface{})
- func ReadFile(filename string, values *map[string]interface{}, encrypted bool) (err error)
- type Config
- func (config *Config) Display() error
- func (config *Config) EnsureLocalScm() error
- func (config *Config) GetChangelogTitle(ID string, fallback string) (title string)
- func (c *Config) IsManifestDifferentThanOnDisk() (bool, error)
- func (config *Config) Reset()
- func (c *Config) SaveOnDisk() error
- func (config *Config) Update(data interface{}) (err error)
- func (config *Config) Validate() error
- func (config *Config) ValidateManifestCompatibility() error
- type Option
- type Spec
- type Template
Constants ¶
const ( // LOCALSCMIDENTIFIER defines the scm id used to configure the local scm directory LOCALSCMIDENTIFIER string = "local" // DefaultConfigFilename defines the default updatecli configuration filename DefaultConfigFilename string = "updatecli.yaml" // DefaultConfigDirname defines the default updatecli manifest directory DefaultConfigDirname string = "updatecli.d" )
Variables ¶
var ( // ErrConfigFileTypeNotSupported is returned when updatecli try to read // an unsupported file type. ErrConfigFileTypeNotSupported = errors.New("file extension not supported") // ErrBadConfig is returned when updatecli try to read // a wrong configuration. ErrBadConfig = errors.New("wrong updatecli configuration") // ErrNoEnvironmentVariableSet is returned when during the templating process, // updatecli tries to access en environment variable not set. ErrNoEnvironmentVariableSet = errors.New("environment variable doesn't exist") // ErrNoKeyDefined is returned when during the templating process, updatecli tries to // retrieve a key value which is not defined in the configuration ErrNoKeyDefined = errors.New("key not defined in configuration") // ErrNotAllowedTemplatedKey is returned when // we are planning to template at runtime unauthorized keys such as map key ErrNotAllowedTemplatedKey = errors.New("not allowed templated key") )
var ( // Define indentation used to encode yaml data YAMLSetIdent int = 4 )
Functions ¶
func FileChecksum ¶ added in v0.27.0
FileChecksum returns sha256 checksum based on a file content.
func IsTemplatedString ¶
IsTemplatedString test if a string contains go template information
Types ¶
type Config ¶
type Config struct { // Spec describe an updatecli manifest Spec Spec // contains filtered or unexported fields }
Config contains cli configuration
func (*Config) EnsureLocalScm ¶ added in v0.28.0
EnsureLocalScm ensures the config receiver has a "local" SCM configuration if needed
func (*Config) GetChangelogTitle ¶ added in v0.10.0
GetChangelogTitle try to guess a specific target based on various information available for a specific job
func (*Config) IsManifestDifferentThanOnDisk ¶ added in v0.27.0
IsManifestDifferentThanOnDisk checks if an Updatecli manifest in memory is the same than the one on disk
func (*Config) SaveOnDisk ¶ added in v0.27.0
SaveOnDisk saves an updatecli manifest to disk
func (*Config) Update ¶
Update updates its own configuration file It's used when the configuration expected a value defined a runtime
func (*Config) Validate ¶
Validate run various validation test on the configuration and update fields if necessary
func (*Config) ValidateManifestCompatibility ¶ added in v0.27.0
type Option ¶ added in v0.27.0
type Option struct { // ManifestFile contains the updatecli manifest full file path ManifestFile string // ValuesFiles contains the list of updatecli values full file path ValuesFiles []string // SecretsFiles contains the list of updatecli sops secrets full file path SecretsFiles []string // DisableTemplating specify if needs to be done DisableTemplating bool }
Option contains configuration options such as filepath located on disk,etc.
type Spec ¶ added in v0.27.0
type Spec struct { // Name defines a pipeline name Name string `yaml:",omitempty" jsonschema:"required"` // PipelineID allows to identify a full pipeline run, this value is propagated into each target if not defined at that level PipelineID string `yaml:",omitempty"` // AutoDiscovery defines parameters to the autodiscover feature AutoDiscovery autodiscovery.Config `yaml:",omitempty"` // Title is used for the full pipeline Title string `yaml:",omitempty"` // PullRequests defines the list of Pull Request configuration which need to be managed PullRequests map[string]pullrequest.Config `yaml:",omitempty"` // SCMs defines the list of repository configuration used to fetch content from. SCMs map[string]scm.Config `yaml:"scms,omitempty"` // Sources defines the list of source configuration Sources map[string]source.Config `yaml:",omitempty"` // Conditions defines the list of condition configuration Conditions map[string]condition.Config `yaml:",omitempty"` // Targets defines the list of target configuration Targets map[string]target.Config `yaml:",omitempty"` // Version specifies the mininum updatecli version compatible with the manifest Version string `yaml:",omitempty"` }
Spec contains pipeline configuration
type Template ¶
type Template struct { CfgFile string // Specify updatecli configuration file ValuesFiles []string // Specify value filename SecretsFiles []string // Specify sops secrets filename Values map[string]interface{} `yaml:"-,inline"` // Contains key/value extracted from a yaml file Secrets map[string]interface{} `yaml:"-,inline"` // Contains mozilla/sops information using yaml format }
Template contains template information used to generate updatecli configuration struct