Documentation ¶
Index ¶
- func CreateConfigDoc(pathToBB, pathToValues, pathToBestPractices string) ([]byte, error)
- func CreateJobEnvironment(bbProjectID int, bbVersion string, environment string, ...) ([]byte, error)
- func CreateJobTemplate(bbProjectID int, bbVersion string) ([]byte, error)
- func CreateValueFiles(pathToHelmfile, pathToValues string)
- func GenerateK3sYaml(versions []string, defaultVersion string) []byte
- func GenerateReadme(bbName string, k8sVersions []string, docsPage string, ...) ([]byte, error)
- func GenerateUpstreamComponentsTables(pathToHelmfile string, pathToImagesTxt string) ([]byte, error)
- func GetDefault(pathToK8sVersions string) string
- func GetK3sDefaultImage(k8sVersions []string, defaultVersion string) string
- func GetK3sImages(k8sVersions []string) []string
- func GetLocalReleases(pathToHelmfile string) []string
- func GetReleases(pathToHelmfile string) []string
- func GetTags(pID int) (s []string)
- func GetUpstreamComponentsJson(pathToHelmfile string, pathToImagesTxt string) ([]byte, error)
- func GetVersions(pathToK8sVersions string) []string
- func RenderHelmfile(path string) []byte
- func SortTags(versions []string) v.Collection
- func UpdateScript(versionFrom, versionTo string, p *RepoRef) ([]byte, error)
- type BuildingBlock
- type DockerImages
- type HelmChart
- type HelmDefaults
- type HelmfileConfig
- type Hook
- type K3sJson
- type K3sVersions
- type K3sYaml
- type K8sVersionsConfig
- type Matrix
- type Parallel
- type Release
- type RepoRef
- type Repository
- type UpstreamComponents
- type Variables
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateConfigDoc ¶ added in v0.17.0
func CreateJobEnvironment ¶ added in v0.18.0
func CreateJobEnvironment(bbProjectID int, bbVersion string, environment string, ciTemplatesVersion string) ([]byte, error)
CreateJobEnvironment will generate the job template for the given building block defined by the arguments, fully extended for the specified environment Output: JobEnvironment
func CreateJobTemplate ¶ added in v0.18.0
CreateJobTemplate will generate the job template for the given building block defined by the arguments Output: JobTemplate
func CreateValueFiles ¶ added in v0.17.0
func CreateValueFiles(pathToHelmfile, pathToValues string)
CreateValueFiles requires helmfile's path as input It parses the helmfiles and creates a directory with all the value files from the upstream helm charts
func GenerateK3sYaml ¶ added in v0.19.0
GenerateK3sYaml creates the k3s.yaml references for gitlab-ci-templates including the k3s versions matrix and the default k3s version
func GenerateReadme ¶ added in v0.19.0
func GenerateReadme(bbName string, k8sVersions []string, docsPage string, upstreamComponents string, customNotes string, helmChartConfig string) ([]byte, error)
This functions generates a BB's readme
func GenerateUpstreamComponentsTables ¶ added in v0.20.0
func GenerateUpstreamComponentsTables(pathToHelmfile string, pathToImagesTxt string) ([]byte, error)
GenerateUpstreamComponentsTables generates a markdown file for a building block that includes a table for each upstream component used by it with their versions: helm charts and docker images
func GetDefault ¶ added in v0.19.0
GetDefault returns the default K8s version defined in k8sVersions.json If the default version doesn't follow the K8s schema (x.yz), the function will fail with the relevant error message Also, the default version needs to be one of the supported versions of the config otherwise the function will fail with the relevant error message
func GetK3sDefaultImage ¶ added in v0.19.0
GetK3sDefaultImage returns the corresponding k3s image of the given default k8s version
func GetK3sImages ¶ added in v0.19.0
GetK3sImages returns the corresponding k3s images to the given k8s versions If there are multiple patch images for one k8s version, the latest patch is chosen If there is no corresponding k3s image for a given k8s version, the function will fail with the relevant message
func GetLocalReleases ¶ added in v0.20.0
GetLocalReleases returns the list of local helmfile's releases in the order they appear in helmfile
func GetReleases ¶ added in v0.17.0
GetReleases returns the list of helmfile's releases in the order they appear in helmfile
func GetUpstreamComponentsJson ¶ added in v0.20.0
GetUpstreamComponentsJson generates a json file for a building block that includes all the upstream components used by it with their versions: helm charts and docker images
func GetVersions ¶ added in v0.19.0
GetVersions returns the list of k8sVersions.json versions in the order they appear in the file If a version of the config doesn't follow the K8s schema (x.yz), the function will fail with the relevant error message
func RenderHelmfile ¶ added in v0.17.0
renderHelmfile requires helmfile's path as input its content is treated as a gotemplate, which is executed and the result returned
func SortTags ¶ added in v0.15.3
func SortTags(versions []string) v.Collection
sorts a list of semantic versions, ascending.
func UpdateScript ¶ added in v0.15.0
UpdateScript will generate a script containing a series of update scripts if there are any for the update of one version (versionFrom) to another (versionTo) of the given building block project ref.
Types ¶
type BuildingBlock ¶ added in v0.18.0
type DockerImages ¶ added in v0.20.0
Docker Images struct
type HelmChart ¶ added in v0.20.0
type HelmChart struct { RepoUrl string `json:"repo-url"` Name string `json:"name"` Version string `json:"version"` }
Helm Chart struct
type HelmDefaults ¶ added in v0.17.0
Helmfile HelmDefaults element
type HelmfileConfig ¶ added in v0.17.0
type HelmfileConfig struct { Repositories []Repository `yaml:"repositories"` HelmDefaults HelmDefaults `yaml:"helmDefaults"` Releases []Release `yaml:"releases"` }
Helmfile top level elements.
type Hook ¶ added in v0.17.0
type Hook struct { Command string `yaml:"command"` Args []string `yaml:"args"` Events []string `yaml:"events"` }
Helmfile Hook element
type K3sJson ¶ added in v0.19.0
type K3sJson []struct { Name string `json:"name"` }
k3s container registry json
type K3sVersions ¶ added in v0.19.0
type K3sVersions struct {
Matrix []Matrix `yaml:"matrix"`
}
K3sVersions element
type K3sYaml ¶ added in v0.19.0
type K3sYaml struct { Variables Variables `yaml:".variables"` Parallel Parallel `yaml:".parallel"` }
k3s.yaml into struct k3s top level elements.
type K8sVersionsConfig ¶ added in v0.19.0
type K8sVersionsConfig struct { K8sVersions []string `json:"K8sVersions"` Default string `json:"Default"` }
k8sVersions.json into struct
type Matrix ¶ added in v0.19.0
type Matrix struct {
K3sVersion []string `yaml:"K3S_VERSION"`
}
Matrix element
type Parallel ¶ added in v0.19.0
type Parallel struct {
K3sVersions K3sVersions `yaml:"k3s_versions"`
}
Parallel element (Helm Charts)
type Release ¶ added in v0.17.0
type Release struct { Name string `yaml:"name"` Namespace string `yaml:"namespace"` Chart string `yaml:"chart"` Version string `yaml:"version"` DisableValidation bool `yaml:"disableValidation"` MissingFileHandler string `yaml:"missingFileHandler"` Values []string `yaml:"values"` Hooks []Hook `yaml:"hooks"` Needs []string `yaml:"needs"` }
Helmfile Release element (Helm Charts)
type Repository ¶ added in v0.17.0
Helmfile Repository element
type UpstreamComponents ¶ added in v0.20.0
type UpstreamComponents struct { HelmChart []HelmChart `json:"helm-charts"` DockerImages []DockerImages `json:"docker-images"` }
Upstream components struct