cargo

package
v0.77.3 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

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

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

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

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

Variables

This section is empty.

Functions

func ErrorSpecNotFound

func ErrorSpecNotFound(name string) error

func ReleaseSourceID added in v0.77.0

func ReleaseSourceID(releaseConfig ReleaseSourceConfig) string

func Validate added in v0.77.1

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

Types

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 []ComponentLock) []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 ComponentLock) Bump

type ComponentLock

type ComponentLock 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"`
}

ComponentLock 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 (ComponentLock) ParseVersion

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

func (ComponentLock) ReleaseSlug

func (lock ComponentLock) ReleaseSlug() boshdir.ReleaseSlug

func (ComponentLock) Spec

func (lock ComponentLock) Spec() ComponentSpec

func (ComponentLock) StemcellSlug

func (lock ComponentLock) StemcellSlug() boshdir.OSVersionSlug

func (ComponentLock) String

func (lock ComponentLock) String() string

func (ComponentLock) UnsetStemcell

func (lock ComponentLock) UnsetStemcell() ComponentLock

func (ComponentLock) WithRemote

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

func (ComponentLock) WithSHA1

func (lock ComponentLock) WithSHA1(sum string) ComponentLock

type ComponentSpec

type ComponentSpec 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"`
}

func (ComponentSpec) Lock

func (spec ComponentSpec) Lock() ComponentLock

func (ComponentSpec) OSVersionSlug

func (spec ComponentSpec) OSVersionSlug() boshdir.OSVersionSlug

func (ComponentSpec) ReleaseSlug

func (spec ComponentSpec) ReleaseSlug() boshdir.ReleaseSlug

func (ComponentSpec) UnsetStemcell

func (spec ComponentSpec) UnsetStemcell() ComponentSpec

func (ComponentSpec) VersionConstraints

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

type ConfigFileError

type ConfigFileError struct {
	HumanReadableConfigFileName string
	// contains filtered or unexported fields
}

func (ConfigFileError) Error

func (err ConfigFileError) Error() string

func (ConfigFileError) Unwrap

func (err ConfigFileError) Unwrap() 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        []ComponentSpec       `yaml:"releases,omitempty"`
	TileNames       []string              `yaml:"tile_names,omitempty"`
	Stemcell        Stemcell              `yaml:"stemcell_criteria,omitempty"`
}

func InterpolateAndParseKilnfile

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

func (Kilnfile) ComponentSpec

func (kf Kilnfile) ComponentSpec(name string) (ComponentSpec, bool)

type KilnfileLoader

type KilnfileLoader struct{}

func (KilnfileLoader) LoadKilnfiles

func (k KilnfileLoader) LoadKilnfiles(fs billy.Filesystem, kilnfilePath string, variablesFiles, variables []string) (Kilnfile, KilnfileLock, error)

func (KilnfileLoader) SaveKilnfileLock

func (KilnfileLoader) SaveKilnfileLock(fs billy.Filesystem, kilnfilePath string, updatedKilnfileLock KilnfileLock) error

type KilnfileLock

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

func (KilnfileLock) FindReleaseWithName

func (k KilnfileLock) FindReleaseWithName(name string) (ComponentLock, error)

func (KilnfileLock) UpdateReleaseLockWithName

func (k KilnfileLock) UpdateReleaseLockWithName(name string, lock ComponentLock) 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"`
	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"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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