commands

package
v0.85.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ErrStemcellOSInfoMustBeValid       = "stemcell os information is missing or invalid"
	ErrStemcellMajorVersionMustBeValid = "stemcell major Version is missing or invalid"
	TanzuNetRemotePath                 = "network.pivotal.io"
)

Variables

View Source
var StandardSSHKeys = []string{
	"id_rsa",
	"id_dsa",
	"id_ecdsa",
	"id_ed25519",
	"identity",
}

Functions

func ReleaseVersionFromBuildVersion

func ReleaseVersionFromBuildVersion(baseVersion *semver.Version, window string) (*releaseVersion, error)

func ReleaseVersionFromPublishedVersion

func ReleaseVersionFromPublishedVersion(versionString string) (*releaseVersion, error)

func VaultGetCred added in v0.78.0

func VaultGetCred(credential string) error

Types

type Bake

type Bake struct {
	Options struct {
		flags.Standard
		flags.FetchBakeOptions

		Metadata                 string   `short:"m"   long:"metadata"                   default:"base.yml"         description:"path to the metadata file"`
		ReleaseDirectories       []string `` /* 134-byte string literal not displayed */
		FormDirectories          []string `short:"f"   long:"forms-directory"            default:"forms"            description:"path to a directory containing forms"`
		IconPath                 string   `short:"i"   long:"icon"                       default:"icon.png"         description:"path to icon file"`
		InstanceGroupDirectories []string `` /* 133-byte string literal not displayed */
		JobDirectories           []string `short:"j"   long:"jobs-directory"             default:"jobs"             description:"path to a directory containing jobs"`
		MigrationDirectories     []string `` /* 128-byte string literal not displayed */
		PropertyDirectories      []string `` /* 137-byte string literal not displayed */
		RuntimeConfigDirectories []string `` /* 133-byte string literal not displayed */
		BOSHVariableDirectories  []string `` /* 132-byte string literal not displayed */
		StemcellTarball          string   `` /* 171-byte string literal not displayed */
		StemcellsDirectories     []string `` /* 193-byte string literal not displayed */
		EmbedPaths               []string `` /* 140-byte string literal not displayed */
		OutputFile               string   `short:"o"   long:"output-file"                                           description:"path to where the tile will be output"`
		MetadataOnly             bool     `` /* 136-byte string literal not displayed */
		Sha256                   bool     `` /* 134-byte string literal not displayed */
		StubReleases             bool     `` /* 133-byte string literal not displayed */
		Version                  string   `short:"v"   long:"version"                                               description:"version of the tile"`
		SkipFetchReleases        []string `` /* 130-byte string literal not displayed */
	}
	// contains filtered or unexported fields
}

func NewBake

func NewBake(fs billy.Filesystem, releasesService baking.ReleasesService, outLogger *log.Logger, errLogger *log.Logger, fetch fetch) Bake

func NewBakeWithInterfaces

func NewBakeWithInterfaces(interpolator interpolator, tileWriter tileWriter, outLogger *log.Logger, errLogger *log.Logger, templateVariablesService templateVariablesService, boshVariablesService metadataTemplatesParser, releasesService fromDirectories, stemcellService stemcellService, formsService metadataTemplatesParser, instanceGroupsService metadataTemplatesParser, jobsService metadataTemplatesParser, propertiesService metadataTemplatesParser, runtimeConfigsService metadataTemplatesParser, iconService iconService, metadataService metadataService, checksummer checksummer, fetcher jhanda.Command, fs FileSystem, homeDir flags.HomeDirFunc) Bake

func (Bake) Execute

func (b Bake) Execute(args []string) error

func (Bake) Usage

func (b Bake) Usage() jhanda.Usage

type CacheCompiledReleases

type CacheCompiledReleases struct {
	Options struct {
		flags.Standard
		om.ClientConfiguration

		UploadTargetID string `` /* 139-byte string literal not displayed */
		ReleasesDir    string `short:"rd" long:"releases-directory" default:"releases" description:"path to a directory to download releases into"`
		Name           string `short:"n"  long:"name"               default:"cf"       description:"name of the tile"` // TODO: parse from base.yml
	}

	Logger *log.Logger
	FS     billy.Filesystem

	ReleaseSourceAndCache func(kilnfile cargo.Kilnfile, targetID string) (ReleaseStorage, error)
	OpsManager            func(om.ClientConfiguration) (OpsManagerReleaseCacheSource, error)
	Director              func(om.ClientConfiguration, om.GetBoshEnvironmentAndSecurityRootCACertificateProvider) (boshdir.Director, error)
}

func NewCacheCompiledReleases

func NewCacheCompiledReleases() *CacheCompiledReleases

func (*CacheCompiledReleases) Execute

func (cmd *CacheCompiledReleases) Execute(args []string) error

func (*CacheCompiledReleases) Usage

func (cmd *CacheCompiledReleases) Usage() jhanda.Usage

func (*CacheCompiledReleases) WithLogger

func (cmd *CacheCompiledReleases) WithLogger(logger *log.Logger) *CacheCompiledReleases

type ErrorLine added in v0.78.0

type ErrorLine struct {
	Error string `json:"error"`
}

type Fetch

type Fetch struct {
	Options FetchOptions
	// contains filtered or unexported fields
}

func NewFetch

func NewFetch(logger *log.Logger, multiReleaseSourceProvider MultiReleaseSourceProvider, localReleaseDirectory LocalReleaseDirectory) Fetch

func (Fetch) Execute

func (f Fetch) Execute(args []string) error

func (Fetch) Usage

func (f Fetch) Usage() jhanda.Usage

type FetchNotesData

type FetchNotesData func(ctx context.Context, repo *git.Repository, client *github.Client, tileRepoOwner, tileRepoName, kilnfilePath, initialRevision, finalRevision string, issuesQuery notes.IssuesQuery, trainstatClient notes.TrainstatNotesFetcher) (notes.Data, error)

type FetchOptions added in v0.78.0

type FetchOptions struct {
	flags.Standard
	flags.FetchBakeOptions
	FetchReleaseDir
}

type FetchReleaseDir added in v0.78.0

type FetchReleaseDir struct {
	ReleasesDir string `short:"rd" long:"releases-directory" default:"releases" description:"path to a directory to download releases into"`
}

type File added in v0.78.0

type File interface {
	io.ReadCloser
	billy.File
}

type FileInfo added in v0.78.0

type FileInfo interface {
	os.FileInfo
}

type FileSystem added in v0.78.0

type FileSystem interface {
	billy.Basic
	billy.Dir
}

type FindReleaseVersion

type FindReleaseVersion struct {
	Options struct {
		flags.Standard
		Release    string `short:"r" long:"release" description:"release name"`
		NoDownload bool   `long:"no-download" description:"do not download any files"`
	}
	// contains filtered or unexported fields
}

func NewFindReleaseVersion

func NewFindReleaseVersion(outLogger *log.Logger, multiReleaseSourceProvider MultiReleaseSourceProvider) *FindReleaseVersion

func (*FindReleaseVersion) Execute

func (cmd *FindReleaseVersion) Execute(args []string) error

func (*FindReleaseVersion) Usage

func (cmd *FindReleaseVersion) Usage() jhanda.Usage

type FindStemcellVersion

type FindStemcellVersion struct {
	Options struct {
		flags.Standard
	}

	FS billy.Filesystem
	// contains filtered or unexported fields
}

func NewFindStemcellVersion

func NewFindStemcellVersion(outLogger *log.Logger, pivnetService *pivnet.Service) FindStemcellVersion

func (FindStemcellVersion) Execute

func (cmd FindStemcellVersion) Execute(args []string) error

func (FindStemcellVersion) Usage

func (cmd FindStemcellVersion) Usage() jhanda.Usage

type Glaze added in v0.77.0

type Glaze struct {
	Options struct {
		Kilnfile string `short:"kf" long:"kilnfile" default:"Kilnfile"  description:"path to Kilnfile"`
	}
}

func (*Glaze) Execute added in v0.77.0

func (cmd *Glaze) Execute(args []string) error

func (*Glaze) Usage added in v0.77.0

func (cmd *Glaze) Usage() jhanda.Usage

type Help

type Help struct {
	// contains filtered or unexported fields
}

func NewHelp

func NewHelp(output io.Writer, flags string, commands jhanda.CommandSet) Help

func (Help) Execute

func (h Help) Execute(args []string) error

func (Help) Usage

func (h Help) Usage() jhanda.Usage

type Key added in v0.78.0

type Key struct {
	KeyPath   string
	Encrypted bool
}

type LocalReleaseDirectory

type LocalReleaseDirectory interface {
	GetLocalReleases(releasesDir string) ([]component.Local, error)
	DeleteExtraReleases(extraReleases []component.Local, noConfirm bool) error
}

type MultiReleaseSourceProvider

type MultiReleaseSourceProvider func(cargo.Kilnfile, bool) component.MultiReleaseSource

type OSM added in v0.79.0

type OSM struct {
	component.ReleaseSource

	Options struct {
		flags.Standard
		NoDownload  bool   `short:"nd" long:"no-download" default:"false" description:"Do not download & zip the packages"`
		GithubToken string `short:"g" long:"github-token" description:"Auth token for fetching specified Github packages" env:"GITHUB_TOKEN"`
		Only        string `` /* 142-byte string literal not displayed */
		Url         string `short:"u" long:"url" default:"" description:"Github URL for package specified by --only"`
	}
	// contains filtered or unexported fields
}

func NewOSM added in v0.79.0

func NewOSM(outLogger *log.Logger, rs component.ReleaseSource) *OSM

func NewOSMWithGHClient added in v0.79.0

func NewOSMWithGHClient(outLogger *log.Logger, rs component.ReleaseSource, githubClient *github.Client) *OSM

func (*OSM) Execute added in v0.79.0

func (cmd *OSM) Execute(args []string) error

func (*OSM) Usage added in v0.79.0

func (cmd *OSM) Usage() jhanda.Usage

type OpsManagerReleaseCacheSource

type OpsManagerReleaseCacheSource interface {
	om.GetBoshEnvironmentAndSecurityRootCACertificateProvider
	GetStagedProductManifest(guid string) (string, error)
	GetStagedProductByName(productName string) (api.StagedProductsFindOutput, error)
}

type PivnetProductFilesService

type PivnetProductFilesService interface {
	List(productSlug string) ([]pivnet.ProductFile, error)
	AddToRelease(productSlug string, releaseID int, productFileID int) error
}

type PivnetReleaseDependenciesService

type PivnetReleaseDependenciesService interface {
	List(productSlug string, releaseID int) ([]pivnet.ReleaseDependency, error)
}

type PivnetReleaseUpgradePathsService

type PivnetReleaseUpgradePathsService interface {
	Get(productSlug string, releaseID int) ([]pivnet.ReleaseUpgradePath, error)
}

type PivnetReleasesService

type PivnetReleasesService interface {
	List(productSlug string) ([]pivnet.Release, error)
	Update(productSlug string, release pivnet.Release) (pivnet.Release, error)
}

type PivnetUserGroupsService

type PivnetUserGroupsService interface {
	List() ([]pivnet.UserGroup, error)
	AddToRelease(productSlug string, releaseID int, userGroupID int) error
}

type Publish

type Publish struct {
	Options struct {
		Kilnfile            string `short:"kf" long:"kilnfile" default:"Kilnfile" description:"path to Kilnfile"`
		Version             string `short:"v" long:"version-file" default:"version" description:"path to version file"`
		PivnetToken         string `short:"t" long:"pivnet-token" description:"pivnet refresh token" required:"true"`
		PivnetHost          string `long:"pivnet-host" default:"https://network.pivotal.io" description:"pivnet host"`
		IncludesSecurityFix bool   `long:"security-fix" description:"the release includes security fixes"`
		Window              string `long:"window" required:"true"`
	}

	PivnetReleaseService             PivnetReleasesService
	PivnetProductFilesService        PivnetProductFilesService
	PivnetUserGroupsService          PivnetUserGroupsService
	PivnetReleaseUpgradePathsService PivnetReleaseUpgradePathsService
	PivnetReleaseDependenciesService PivnetReleaseDependenciesService

	FS  billy.Filesystem
	Now func() time.Time

	OutLogger, ErrLogger *log.Logger
}

func NewPublish

func NewPublish(outLogger, errLogger *log.Logger, fs billy.Filesystem) Publish

func (Publish) Execute

func (p Publish) Execute(args []string) error

func (Publish) Usage

func (p Publish) Usage() jhanda.Usage

Usage writes helpful information.

type ReleaseNotes

type ReleaseNotes struct {
	Options struct {
		ReleaseDate  string `long:"release-date" short:"d" description:"release date of the tile"`
		TemplateName string `long:"template"     short:"t" description:"path to template"`
		GithubToken  string `long:"github-token" short:"g" description:"auth token for fetching issues merged between releases" env:"GITHUB_TOKEN"`
		Kilnfile     string `long:"kilnfile"     short:"k" description:"path to Kilnfile"`
		DocsFile     string `long:"update-docs"  short:"u" description:"path to docs file to update"`
		notes.IssuesQuery
		notes.TrainstatQuery
	}

	io.Writer
	// contains filtered or unexported fields
}

func NewReleaseNotesCommand

func NewReleaseNotesCommand() (ReleaseNotes, error)

func (ReleaseNotes) Execute

func (r ReleaseNotes) Execute(args []string) error

func (ReleaseNotes) Usage

func (r ReleaseNotes) Usage() jhanda.Usage

type ReleaseStorage

type ReleaseStorage interface {
	component.ReleaseSource
	UploadRelease(spec component.Spec, file io.Reader) (component.Lock, error)
}

type ReleaseUploaderFinder

type ReleaseUploaderFinder func(cargo.Kilnfile, string) (component.ReleaseUploader, error)

type RemotePatherFinder

type RemotePatherFinder func(cargo.Kilnfile, string) (component.RemotePather, error)

type SSHClientCreator added in v0.78.0

type SSHClientCreator struct{}

func (SSHClientCreator) NewClient added in v0.78.0

func (s SSHClientCreator) NewClient(rw io.ReadWriter) SshAgent

type SshAgent added in v0.78.0

type SshAgent interface {
	Add(key sshagent.AddedKey) error
	List() ([]*sshagent.Key, error)
}

type SshClientCreator added in v0.78.0

type SshClientCreator interface {
	NewClient(rw io.ReadWriter) SshAgent
}

type SshProvider added in v0.78.0

type SshProvider interface {
	NeedsKeys() (bool, error)
	GetKeys(optionalKeyPaths ...string) (key Key, err error)
	AddKey(key Key, passphrase []byte) error
}

func NewSshProvider added in v0.78.0

func NewSshProvider(creator SshClientCreator) (SshProvider, error)

type SshThing added in v0.78.0

type SshThing struct {
	// contains filtered or unexported fields
}

func (SshThing) AddKey added in v0.78.0

func (st SshThing) AddKey(key Key, passphrase []byte) error

func (SshThing) GetKeys added in v0.78.0

func (st SshThing) GetKeys(optionalKeyPaths ...string) (key Key, err error)

func (SshThing) NeedsKeys added in v0.78.0

func (st SshThing) NeedsKeys() (bool, error)

type SyncWithLocal

type SyncWithLocal struct {
	Options struct {
		flags.Standard

		ReleasesDir     string `short:"rd" long:"releases-directory"  default:"releases" description:"path to a directory to download releases into"`
		ReleaseSourceID string `           long:"assume-release-source"  required:"true" description:"the release source to put in updated records"`
		SkipSameVersion bool   `` /* 138-byte string literal not displayed */
	}
	// contains filtered or unexported fields
}

func NewSyncWithLocal

func NewSyncWithLocal(fs billy.Filesystem, localReleaseDirectory LocalReleaseDirectory, remotePatherFinder RemotePatherFinder, logger *log.Logger) SyncWithLocal

func (SyncWithLocal) Execute

func (command SyncWithLocal) Execute(args []string) error

func (SyncWithLocal) Usage

func (command SyncWithLocal) Usage() jhanda.Usage

type TemplateContext

type TemplateContext struct {
	Title         string
	Description   string
	Usage         string
	GlobalFlags   []string
	ArgumentsName string
	Arguments     []string
}

type TileTest added in v0.85.0

type TileTest struct {
	Options struct {
		TilePath            string `` /* 154-byte string literal not displayed */
		GingkoManifestFlags string `` /* 147-byte string literal not displayed */
		Verbose             bool   `` /* 151-byte string literal not displayed */
		ManifestOnly        bool   `             long:"manifest-only"            default:"false"                         description:"Run only Manifest tests."`
		MigrationsOnly      bool   `             long:"migrations-only"          default:"false"                         description:"Run only Migration tests."`
	}
	// contains filtered or unexported fields
}

func NewTileTest added in v0.85.0

func NewTileTest(logger *log.Logger, ctx context.Context, mobi mobyClient, sshThing SshProvider) TileTest

func (TileTest) Execute added in v0.85.0

func (u TileTest) Execute(args []string) error

func (TileTest) Usage added in v0.85.0

func (u TileTest) Usage() jhanda.Usage

type UpdateRelease

type UpdateRelease struct {
	Options struct {
		flags.Standard

		Name                         string `short:"n" long:"name" required:"true" description:"name of release to update"`
		Version                      string `short:"v" long:"version" required:"true" description:"desired version of release"`
		ReleasesDir                  string `short:"rd" long:"releases-directory" default:"releases" description:"path to a directory to download releases into"`
		AllowOnlyPublishableReleases bool   `` /* 130-byte string literal not displayed */
		WithoutDownload              bool   `long:"without-download" description:"updates releases without downloading them"`
	}
	// contains filtered or unexported fields
}

func NewUpdateRelease

func NewUpdateRelease(logger *log.Logger, filesystem billy.Filesystem, multiReleaseSourceProvider MultiReleaseSourceProvider) UpdateRelease

func (UpdateRelease) Execute

func (u UpdateRelease) Execute(args []string) error

func (UpdateRelease) Usage

func (u UpdateRelease) Usage() jhanda.Usage

type UpdateStemcell

type UpdateStemcell struct {
	Options struct {
		flags.Standard

		Version     string `short:"v"  long:"version"            required:"true"    description:"desired version of stemcell"`
		ReleasesDir string `short:"rd" long:"releases-directory" default:"releases" description:"path to a directory to download releases into"`
	}
	FS                         billy.Filesystem
	MultiReleaseSourceProvider MultiReleaseSourceProvider
	Logger                     *log.Logger
}

func (UpdateStemcell) Execute

func (update UpdateStemcell) Execute(args []string) error

func (UpdateStemcell) Usage

func (update UpdateStemcell) Usage() jhanda.Usage

type UploadRelease

type UploadRelease struct {
	FS                    billy.Filesystem
	ReleaseUploaderFinder ReleaseUploaderFinder
	Logger                *log.Logger

	Options struct {
		flags.Standard

		UploadTargetID string `` /* 134-byte string literal not displayed */
		LocalPath      string `short:"lp" long:"local-path"       required:"true" description:"path to BOSH release tarball"`
	}
}

func (UploadRelease) Execute

func (command UploadRelease) Execute(args []string) error

func (UploadRelease) Usage

func (command UploadRelease) Usage() jhanda.Usage

type Validate

type Validate struct {
	Options struct {
		flags.Standard
	}

	FS billy.Filesystem
}

func NewValidate

func NewValidate(fs billy.Filesystem) Validate

func (Validate) Execute

func (v Validate) Execute(args []string) error

func (Validate) Usage

func (v Validate) Usage() jhanda.Usage

type Version

type Version struct {
	// contains filtered or unexported fields
}

func NewVersion

func NewVersion(logger *log.Logger, version string) Version

func (Version) Execute

func (v Version) Execute([]string) error

func (Version) Usage

func (v Version) Usage() jhanda.Usage

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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