promobot

package
v4.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateManifest

func GenerateManifest(_ context.Context, options GenerateManifestOptions) (*api.Manifest, error)

GenerateManifest generates a manifest containing the files in options.BaseDir

func ReadManifest

func ReadManifest(options PromoteFilesOptions) (*api.Manifest, error)

ReadManifest reads a manifest.

func ReadManifests

func ReadManifests(options PromoteFilesOptions) ([]*api.Manifest, error)

ReadManifests reads a set of manifests.

func RunPromoteFiles

func RunPromoteFiles(ctx context.Context, options PromoteFilesOptions) error

RunPromoteFiles executes a file promotion command

Types

type GenerateManifestOptions

type GenerateManifestOptions struct {
	// BaseDir is the directory containing the files to hash
	BaseDir string

	// Prefix exports only files matching the specified prefix.
	//
	// If we were instead to change BaseDir, we would also
	// restrict the files, but the relative paths would also
	// change.
	Prefix string
}

GenerateManifestOptions holds the parameters for a hash-files operation.

func (*GenerateManifestOptions) PopulateDefaults

func (o *GenerateManifestOptions) PopulateDefaults()

PopulateDefaults sets the default values for GenerateManifestOptions.

type PromoteFilesOptions

type PromoteFilesOptions struct {
	// FilestoresPath is the path to the manifest file containing the filestores section
	FilestoresPath string

	// FilesPath specifies a path to manifest files containing the files section.
	FilesPath string

	// ManifestsPath specifies a path containing filestores and files for
	// multiple projects.
	//
	// Example layout:
	//
	// ├── filestores
	// │   ├── project1
	// │   │   └── filepromoter-manifest.yaml
	// │   └── project2
	// │       └── filepromoter-manifest.yaml
	// └── manifests
	//     ├── project1
	//     │   ├── blue.yaml
	//     │   ├── green.yaml
	//     │   └── red.yaml
	//     └── project2
	//         ├── blue.yaml
	//         ├── green.yaml
	//         └── red.yaml
	ManifestsPath string

	// Confirm, if set, will trigger a PRODUCTION artifact promotion.
	Confirm bool

	// UseServiceAccount must be true, for service accounts to be used
	// This gives some protection against a hostile manifest.
	UseServiceAccount bool

	// Out is the destination for "normal" output (such as dry-run)
	Out io.Writer
}

PromoteFilesOptions holds the flag-values for a file promotion

func (*PromoteFilesOptions) PopulateDefaults

func (o *PromoteFilesOptions) PopulateDefaults()

PopulateDefaults sets the default values for PromoteFilesOptions

Jump to

Keyboard shortcuts

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