svu

package
v0.8.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Current

func Current(ctx context.Context) error

Current runs svu current.

func Major

func Major(ctx context.Context) error

Major runs svu major.

func Minor

func Minor(ctx context.Context) error

Minor runs svu minor.

func Next

func Next(ctx context.Context) error

Next runs svu next.

func Patch

func Patch(ctx context.Context) error

Patch runs svu patch.

func SVUVersion

func SVUVersion(v string) daggers.Option[config]

SVUVersion specifies the version of svu to use. Defaults to v1.9.0. This should be one of the released image tags - see https://github.com/caarlos0/svu/pkgs/container/svu for available tags.

func SVUWithOptions

func SVUWithOptions(ctx context.Context, opts ...daggers.Option[config]) error

SVUWithOptions runs svu with specific options.

func WithBuild

func WithBuild(b bool) daggers.Option[config]

WithBuild controls whether to include build metadata in the version. Defaults to true.

func WithCommand

func WithCommand(cmd Command) daggers.Option[config]

WithCommand sets the svu sub-command to run. Defaults to "next".

func WithMetadata

func WithMetadata(b bool) daggers.Option[config]

WithMetadata controls whether to include pre-release and build metadata in the version. Defaults to true.

func WithPattern

func WithPattern(pattern string) daggers.Option[config]

WithPattern sets the pattern to use when searching for tags. Defaults to "*".

func WithPreRelease

func WithPreRelease(b bool) daggers.Option[config]

WithPreRelease controls whether to include pre-release metadata in the version. Defaults to true.

func WithPrefix

func WithPrefix(prefix string) daggers.Option[config]

WithPrefix sets the prefix to use when searching for tags. Defaults to "v".

func WithSuffix

func WithSuffix(suffix string) daggers.Option[config]

WithSuffix sets the suffix to use when searching for tags. Defaults to "".

func WithTagMode

func WithTagMode(tagMode TagMode) daggers.Option[config]

WithTagMode sets the tag mode to use when searching for tags. Defaults to TagModeAllBranches.

Types

type Command

type Command string

Command is represents the svu sub-command.

const (
	// CommandNext is the svu next sub-command.
	CommandNext Command = "next"
	// CommandMajor is the svu major sub-command.
	CommandMajor Command = "major"
	// CommandMinor is the svu minor sub-command.
	CommandMinor Command = "minor"
	// CommandPatch is the svu patch sub-command.
	CommandPatch Command = "patch"
	// CommandCurrent is the svu pre sub-command.
	CommandCurrent Command = "current"
)

type Output

type Output struct {
	// Version
	Version string
	// Version without the prefix
	VersionWithoutPrefix string
}

Output is svu command output.

func Run

func Run(ctx context.Context, runtime *daggers.Runtime, options ...daggers.Option[config]) (*Output, error)

Run runs the svu command with the given options.

type TagMode

type TagMode string

TagMode is a custom type representing the possible values for the --tag-mode flag.

const (
	// TagModeAllBranches is the value for the --tag-mode flag that will use all branches.
	TagModeAllBranches TagMode = "all-branches"
	// TagModeCurrentBranch is the value for the --tag-mode flag that will only use current branch tags.
	TagModeCurrentBranch TagMode = "current-branch"
)

Jump to

Keyboard shortcuts

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