cargo

package
v0.93.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BOSHReleaseTarballSourceTypeBOSHIO is the value of the Type field on cargo.ReleaseSourceConfig
	// for fetching https://bosh.io releases.
	BOSHReleaseTarballSourceTypeBOSHIO = "bosh.io"

	// BOSHReleaseTarballSourceTypeS3 is the value for the Type field on cargo.ReleaseSourceConfig
	// for releases stored on
	BOSHReleaseTarballSourceTypeS3 = "s3"

	// BOSHReleaseTarballSourceTypeGithub is the value for the Type field on cargo.ReleaseSourceConfig
	// for releases stored on GitHub.
	BOSHReleaseTarballSourceTypeGithub = "github"

	// BOSHReleaseTarballSourceTypeArtifactory is the value for the Type field on cargo.ReleaseSourceConfig
	// for releases stored on Artifactory.
	BOSHReleaseTarballSourceTypeArtifactory = "artifactory"
)

Variables

This section is empty.

Functions

func BOSHReleaseTarballSourceID added in v0.86.0

func BOSHReleaseTarballSourceID(releaseConfig ReleaseSourceConfig) string

func ReadBOSHReleaseFromFS added in v0.86.0

func ReadBOSHReleaseFromFS(dir fs.FS, releaseName, releaseVersion string, releaseTarball io.Writer) (proofing.Release, error)

func ReadBOSHReleaseFromFile added in v0.86.0

func ReadBOSHReleaseFromFile(tilePath, releaseName, releaseVersion string, releaseTarball io.Writer) (proofing.Release, error)

func ReadBOSHReleaseFromZip added in v0.86.0

func ReadBOSHReleaseFromZip(ra io.ReaderAt, zipFileSize int64, releaseName, releaseVersion string, releaseTarball io.Writer) (proofing.Release, error)

func ReadKilnfileAndKilnfileLock added in v0.84.0

func ReadKilnfileAndKilnfileLock(path string) (Kilnfile, KilnfileLock, error)

func ResolveKilnfilePath added in v0.84.0

func ResolveKilnfilePath(path string) (string, error)

func Validate added in v0.77.1

func Validate(spec Kilnfile, lock KilnfileLock) []error

func WriteKilnfile added in v0.79.0

func WriteKilnfile(path string, kf Kilnfile) error

WriteKilnfile does not validate the Kilnfile nor does it validate the path. Use ResolveKilnfilePath and maybe Validate before calling this.

Types

type BOSHReleaseManifest added in v0.86.0

type BOSHReleaseManifest struct {
	Name               string `yaml:"name,omitempty"`
	Version            string `yaml:"version,omitempty"`
	CommitHash         string `yaml:"commit_hash,omitempty"`
	UncommittedChanges bool   `yaml:"uncommitted_changes"`

	CompiledPackages []CompiledBOSHReleasePackage `yaml:"compiled_packages"`
	Packages         []BOSHReleasePackage         `yaml:"packages"`
}

func ReadProductTemplatePartFromBOSHReleaseTarball added in v0.86.0

func ReadProductTemplatePartFromBOSHReleaseTarball(r io.Reader) (BOSHReleaseManifest, error)

func (BOSHReleaseManifest) Stemcell added in v0.86.0

func (mf BOSHReleaseManifest) Stemcell() (string, string, bool)

type BOSHReleasePackage added in v0.86.0

type BOSHReleasePackage struct {
	Name         string   `yaml:"name"`
	Version      string   `yaml:"version"`
	Fingerprint  string   `yaml:"fingerprint"`
	SHA1         string   `yaml:"sha1"`
	Dependencies []string `yaml:"dependencies"`
}

type BOSHReleaseTarball added in v0.86.0

type BOSHReleaseTarball struct {
	Manifest BOSHReleaseManifest

	SHA1     string
	FilePath string
}

func OpenBOSHReleaseManifestsFromTarballs added in v0.86.0

func OpenBOSHReleaseManifestsFromTarballs(tarballPaths ...string) ([]BOSHReleaseTarball, error)

func OpenBOSHReleaseTarball added in v0.86.0

func OpenBOSHReleaseTarball(tarballPath string) (BOSHReleaseTarball, error)

func ReadBOSHReleaseTarball added in v0.86.0

func ReadBOSHReleaseTarball(tarballPath string, r io.Reader) (BOSHReleaseTarball, error)

type BOSHReleaseTarballLock added in v0.86.0

type BOSHReleaseTarballLock struct {
	Name    string `yaml:"name"`
	SHA1    string `yaml:"sha1"`
	Version string `yaml:"version,omitempty"`

	StemcellOS      string `yaml:"-"`
	StemcellVersion string `yaml:"-"`

	RemoteSource string `yaml:"remote_source"`
	RemotePath   string `yaml:"remote_path"`
}

BOSHReleaseTarballLock represents an exact build of a bosh release It may identify the where the release is cached; it may identify the stemcell used to compile the release.

All fields must be comparable because this struct may be used as a key type in a map. Don't add array or map fields.

func (BOSHReleaseTarballLock) ParseVersion added in v0.86.0

func (lock BOSHReleaseTarballLock) ParseVersion() (*semver.Version, error)

func (BOSHReleaseTarballLock) ReleaseSlug added in v0.86.0

func (lock BOSHReleaseTarballLock) ReleaseSlug() boshdir.ReleaseSlug

func (BOSHReleaseTarballLock) StemcellSlug added in v0.86.0

func (lock BOSHReleaseTarballLock) StemcellSlug() boshdir.OSVersionSlug

func (BOSHReleaseTarballLock) String added in v0.86.0

func (lock BOSHReleaseTarballLock) String() string

func (BOSHReleaseTarballLock) WithRemote added in v0.86.0

func (lock BOSHReleaseTarballLock) WithRemote(source, path string) BOSHReleaseTarballLock

func (BOSHReleaseTarballLock) WithSHA1 added in v0.86.0

type BOSHReleaseTarballSpecification added in v0.86.0

type BOSHReleaseTarballSpecification struct {
	// Name is a required field and must be set with the bosh release name
	Name string `yaml:"name"`

	// Version if not set, it will default to ">0".
	// See https://github.com/Masterminds/semver for syntax
	Version string `yaml:"version,omitempty"`

	// StemcellOS may be set when a specifying a component
	// compiled with a particular stemcell. Usually you should
	// also set StemcellVersion when setting this field.
	StemcellOS string `yaml:"os,omitempty"`

	// StemcellVersion may be set when a specifying a component
	// compiled with a particular stemcell. Usually you should
	// also set StemcellOS when setting this field.
	StemcellVersion string `yaml:"stemcell_version,omitempty"`

	// GitHubRepository are where the BOSH release source code is
	GitHubRepository string `yaml:"github_repository,omitempty"`

	// DeGlazeBehavior changes how version filed changes when de-glaze is run.
	DeGlazeBehavior DeGlazeBehavior `yaml:"maintenance_version_bump_policy"`

	// FloatAlways when does not override version constraint.
	// It skips locking it during Kilnfile.Glaze.
	FloatAlways bool `yaml:"float_always,omitempty"`

	// TeamSlackChannel slack channel for team that maintains this bosh release
	TeamSlackChannel string `yaml:"slack,omitempty"`
}

func (BOSHReleaseTarballSpecification) Lock added in v0.86.0

func (BOSHReleaseTarballSpecification) OSVersionSlug added in v0.86.0

func (BOSHReleaseTarballSpecification) ReleaseSlug added in v0.86.0

func (BOSHReleaseTarballSpecification) VersionConstraints added in v0.86.0

func (spec BOSHReleaseTarballSpecification) VersionConstraints() (*semver.Constraints, error)

type BakeConfiguration added in v0.90.0

type BakeConfiguration struct {
	TileName                 string   `yaml:"tile_name,omitempty"                          json:"tile_name,omitempty"`
	Metadata                 string   `yaml:"metadata_filepath,omitempty"                  json:"metadata_filepath,omitempty"`
	FormDirectories          []string `yaml:"forms_directories,omitempty"                  json:"forms_directories,omitempty"`
	IconPath                 string   `yaml:"icon_filepath,omitempty"                      json:"icon_filepath,omitempty"`
	InstanceGroupDirectories []string `yaml:"instance_groups_directories,omitempty"        json:"instance_groups_directories,omitempty"`
	JobDirectories           []string `yaml:"jobs_directories,omitempty"                   json:"jobs_directories,omitempty"`
	MigrationDirectories     []string `yaml:"migrations_directories,omitempty"             json:"migrations_directories,omitempty"`
	PropertyDirectories      []string `yaml:"properties_directories,omitempty"             json:"properties_directories,omitempty"`
	RuntimeConfigDirectories []string `yaml:"runtime_configurations_directories,omitempty" json:"runtime_configurations_directories,omitempty"`
	BOSHVariableDirectories  []string `yaml:"bosh_variables_directories,omitempty"         json:"bosh_variables_directories,omitempty"`
	EmbedPaths               []string `yaml:"embed_paths,omitempty"                        json:"embed_paths,omitempty"`
	VariableFiles            []string `yaml:"variable_files,omitempty"                     json:"variable_files,omitempty"`
}

type Bump added in v0.77.1

type Bump struct {
	Name, FromVersion, ToVersion string

	Releases []*github.RepositoryRelease
}

func CalculateBumps added in v0.77.1

func CalculateBumps(current, previous []BOSHReleaseTarballLock) []Bump

func WinfsVersionBump added in v0.89.0

func WinfsVersionBump(bumped bool, version string, bumps []Bump) []Bump

func (Bump) ReleaseNotes added in v0.77.1

func (bump Bump) ReleaseNotes() string

type BumpList added in v0.77.1

type BumpList []Bump

func ReleaseNotes added in v0.77.1

func ReleaseNotes(ctx context.Context, repoService RepositoryReleaseLister, kf Kilnfile, list BumpList) (BumpList, error)

func (BumpList) ForLock added in v0.77.1

func (list BumpList) ForLock(lock BOSHReleaseTarballLock) Bump

type CompiledBOSHReleasePackage added in v0.86.0

type CompiledBOSHReleasePackage struct {
	Name         string   `yaml:"name"`
	Version      string   `yaml:"version"`
	Fingerprint  string   `yaml:"fingerprint"`
	SHA1         string   `yaml:"sha1"`
	Dependencies []string `yaml:"dependencies"`

	Stemcell string `yaml:"stemcell"`
}

type DeGlazeBehavior added in v0.86.0

type DeGlazeBehavior int
const (
	LockNone  DeGlazeBehavior = iota - 1
	LockMajor                 // default value
	LockMinor
	LockPatch
)

func (DeGlazeBehavior) MarshalText added in v0.86.0

func (dgb DeGlazeBehavior) MarshalText() (text []byte, err error)

func (DeGlazeBehavior) MarshalYAML added in v0.86.0

func (dgb DeGlazeBehavior) MarshalYAML() (any, error)

func (DeGlazeBehavior) String added in v0.86.0

func (dgb DeGlazeBehavior) String() string

func (*DeGlazeBehavior) UnmarshalText added in v0.86.0

func (dgb *DeGlazeBehavior) UnmarshalText(text []byte) error

func (*DeGlazeBehavior) UnmarshalYAML added in v0.86.0

func (dgb *DeGlazeBehavior) UnmarshalYAML(node *yaml.Node) error

type Kilnfile

type Kilnfile struct {
	ReleaseSources     []ReleaseSourceConfig             `yaml:"release_sources,omitempty"`
	Slug               string                            `yaml:"slug,omitempty"`
	PreGaUserGroups    []string                          `yaml:"pre_ga_user_groups,omitempty"`
	Releases           []BOSHReleaseTarballSpecification `yaml:"releases,omitempty"`
	TileNames          []string                          `yaml:"tile_names,omitempty"`
	Stemcell           Stemcell                          `yaml:"stemcell_criteria,omitempty"`
	BakeConfigurations []BakeConfiguration               `yaml:"bake_configurations"`
}

func InterpolateAndParseKilnfile

func InterpolateAndParseKilnfile(in io.Reader, templateVariables map[string]any) (Kilnfile, error)

func ReadKilnfile added in v0.84.0

func ReadKilnfile(path string) (Kilnfile, error)

func (*Kilnfile) BOSHReleaseTarballSpecification added in v0.86.0

func (kf *Kilnfile) BOSHReleaseTarballSpecification(name string) (BOSHReleaseTarballSpecification, error)

func (*Kilnfile) DeGlaze added in v0.86.0

func (kf *Kilnfile) DeGlaze(kl KilnfileLock) error

func (*Kilnfile) Glaze added in v0.86.0

func (kf *Kilnfile) Glaze(kl KilnfileLock) error

type KilnfileLock

type KilnfileLock struct {
	Releases []BOSHReleaseTarballLock `yaml:"releases"`
	Stemcell Stemcell                 `yaml:"stemcell_criteria"`
}

func ReadKilnfileLock added in v0.84.0

func ReadKilnfileLock(path string) (KilnfileLock, error)

func (KilnfileLock) FindBOSHReleaseWithName added in v0.86.0

func (k KilnfileLock) FindBOSHReleaseWithName(name string) (BOSHReleaseTarballLock, error)

func (KilnfileLock) UpdateBOSHReleaseTarballLockWithName added in v0.86.0

func (k KilnfileLock) UpdateBOSHReleaseTarballLockWithName(name string, lock BOSHReleaseTarballLock) error

type ReleaseSourceConfig

type ReleaseSourceConfig struct {
	Type            string `yaml:"type,omitempty"`
	ID              string `yaml:"id,omitempty"`
	Publishable     bool   `yaml:"publishable,omitempty"`
	Bucket          string `yaml:"bucket,omitempty"`
	Region          string `yaml:"region,omitempty"`
	AccessKeyId     string `yaml:"access_key_id,omitempty"`
	SecretAccessKey string `yaml:"secret_access_key,omitempty"`
	RoleARN         string `yaml:"role_arn,omitempty"`
	PathTemplate    string `yaml:"path_template,omitempty"`
	Endpoint        string `yaml:"endpoint,omitempty"`
	Org             string `yaml:"org,omitempty"`
	GithubToken     string `yaml:"github_token,omitempty"`
	Repo            string `yaml:"repo,omitempty"`
	ArtifactoryHost string `yaml:"artifactory_host,omitempty"`
	Username        string `yaml:"username,omitempty"`
	Password        string `yaml:"password,omitempty"`
}

type RepositoryReleaseLister added in v0.77.1

type RepositoryReleaseLister = repositoryReleaseLister

type Stemcell

type Stemcell struct {
	Alias        string `yaml:"alias,omitempty"`
	OS           string `yaml:"os"`
	Version      string `yaml:"version"`
	TanzuNetSlug string `yaml:"slug,omitempty"`
}

func (Stemcell) ProductSlug added in v0.86.0

func (stemcell Stemcell) ProductSlug() (string, error)

Jump to

Keyboard shortcuts

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