cargo

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 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 ReadKilnfileAndKilnfileLock added in v0.84.0

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

func ReleaseSourceID added in v0.77.0

func ReleaseSourceID(releaseConfig ReleaseSourceConfig) string

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 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) StemcellSlug

func (lock ComponentLock) StemcellSlug() boshdir.OSVersionSlug

func (ComponentLock) String

func (lock ComponentLock) String() string

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) VersionConstraints

func (spec ComponentSpec) VersionConstraints() (*semver.Constraints, 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 ReadKilnfile added in v0.84.0

func ReadKilnfile(path string) (Kilnfile, error)

func (Kilnfile) ComponentSpec

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

type KilnfileLock

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

func ReadKilnfileLock added in v0.84.0

func ReadKilnfileLock(path string) (KilnfileLock, error)

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