Documentation ¶
Index ¶
Constants ¶
const DevBranchPrefix = "dev-v"
DevBranchPrefix is the official prefix for the development branch
const ProductionBranchPrefix = "prod-v"
ProductionBranchPrefix is the official prefix for the production branch
Variables ¶
This section is empty.
Functions ¶
func ExtractBranchVersion ¶ added in v0.8.1
ExtractBranchVersion will extract the branch version from the branch name
Types ¶
type Asset ¶
type Asset struct {
// contains filtered or unexported fields
}
Asset represents an asset with its version and path in the repository
type CheckIfGitIsCleanFunc ¶
CheckIfGitIsCleanFunc is a function type that will be used to check if the git tree is clean
type Dependencies ¶
type Dependencies struct { VR *VersionRules // contains filtered or unexported fields }
Dependencies holds the necessary filesystem, assets versions map, version rules and methods to apply the lifecycle rules in the target branch
func InitDependencies ¶
func InitDependencies(rootFs billy.Filesystem, branchVersion string, currentChart string, debug bool) (*Dependencies, error)
InitDependencies will check the filesystem, branch version, git status, initialize the Dependencies struct and populate it. If anything fails the operation will be aborted.
func (*Dependencies) ApplyRules ¶
func (ld *Dependencies) ApplyRules(currentChart string, debug bool) error
ApplyRules will populate all assets versions and paths, sort the versions, and execute make remove for each chart and version. After each chart removal, it will commit the changes in a single commit for all versions of that chart.
func (*Dependencies) CheckLifecycleStatusAndSave ¶ added in v0.9.0
func (ld *Dependencies) CheckLifecycleStatusAndSave(chart string) error
CheckLifecycleStatusAndSave checks the lifecycle status of the assets at 3 different levels prints to the console and saves to log files at 'logs/' folder.
type Git ¶ added in v0.9.0
type Git struct {
Dir string
}
Git struct holds necessary data to work with the current git repository
type GitAddAndCommitFunc ¶
GitAddAndCommitFunc is a function type that will be used to add and commit changes in the git tree
type MakeRemoveFunc ¶
MakeRemoveFunc is a function type that will be used to execute make remove
type Status ¶ added in v0.9.0
type Status struct {
// contains filtered or unexported fields
}
Status struct hold the results of the assets versions comparison, this data will all be logged and saves into log files for further analysis
type VersionRules ¶
type VersionRules struct {
// contains filtered or unexported fields
}
VersionRules will hold all the necessary information to check which assets versions are allowed to be in the repository
func GetVersionRules ¶
func GetVersionRules(branchVersion string, debug bool) (*VersionRules, error)
GetVersionRules will check and convert the provided branch version, create the hard-coded rules for the charts repository and calculate the minimum and maximum versions according to the branch version.
func (*VersionRules) CheckChartVersionForLifecycle ¶ added in v0.8.1
func (vr *VersionRules) CheckChartVersionForLifecycle(chartVersion string) bool
CheckChartVersionForLifecycle will Check if the chart version is within the range of the current version:
If the chart version is within the range, return true, otherwise return false
func (*VersionRules) CheckChartVersionToRelease ¶ added in v0.9.0
func (vr *VersionRules) CheckChartVersionToRelease(chartVersion string) (bool, error)
CheckChartVersionToRelease will return if the current versyion being analyzed is the one to be released or not
type WalkDirFunc ¶
type WalkDirFunc func(fs billy.Filesystem, dirPath string, doFunc filesystem.RelativePathFunc) error
WalkDirFunc is a function type that will be used to walk through the filesystem