versioning

package
v1.84.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2020 License: Apache-2.0 Imports: 18 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// SchemeMajorVersion is the versioning scheme based on the major version only
	SchemeMajorVersion = `{{(split "." (split "-" .Version)._0)._0}}`
	// SchemeMajorMinorVersion is the versioning scheme based on the major version only
	SchemeMajorMinorVersion = `{{(split "." (split "-" .Version)._0)._0}}.{{(split "." (split "-" .Version)._0)._1}}`
	// SchemeSemanticVersion is the versioning scheme based on the major.minor.micro version
	SchemeSemanticVersion = `{{(split "-" .Version)._0}}`
	// SchemeFullVersion is the versioning scheme based on the full version
	SchemeFullVersion = "{{.Version}}"
)
View Source
const (
	// NameRegex is used to match the pip descriptor artifact name
	NameRegex = "(?s)(.*)name=['\"](.*?)['\"](.*)"
	// VersionRegex is used to match the pip descriptor artifact version
	VersionRegex = "(?s)(.*)version=['\"](.*?)['\"](.*)"
)

Variables

This section is empty.

Functions

func DetermineProjectCoordinates added in v1.38.0

func DetermineProjectCoordinates(nameTemplate, versionScheme string, gav Coordinates) (string, string)

DetermineProjectCoordinates resolve the coordinates of the project for use in 3rd party scan tools

Types

type Artifact

type Artifact interface {
	VersioningScheme() string
	GetVersion() (string, error)
	SetVersion(string) error
	GetCoordinates() (Coordinates, error)
}

Artifact defines the versioning operations for various build tools

func GetArtifact

func GetArtifact(buildTool, buildDescriptorFilePath string, opts *Options, execRunner mavenExecRunner) (Artifact, error)

GetArtifact returns the build tool specific implementation for retrieving version, etc. of an artifact

type Coordinates added in v1.38.0

type Coordinates interface{}

Coordinates to address the artifact

type Docker added in v1.23.0

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

Docker defines an artifact based on a Dockerfile

func (*Docker) GetCoordinates added in v1.38.0

func (d *Docker) GetCoordinates() (Coordinates, error)

GetCoordinates returns the coordinates

func (*Docker) GetVersion added in v1.23.0

func (d *Docker) GetVersion() (string, error)

GetVersion returns the current version of the artifact

func (*Docker) SetVersion added in v1.23.0

func (d *Docker) SetVersion(version string) error

SetVersion updates the version of the artifact

func (*Docker) VersioningScheme added in v1.23.0

func (d *Docker) VersioningScheme() string

VersioningScheme returns the relevant versioning scheme

type GoMod added in v1.51.0

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

GoMod utility to interact with Go Modules specific versioning

func (*GoMod) GetCoordinates added in v1.51.0

func (m *GoMod) GetCoordinates() (Coordinates, error)

GetCoordinates returns the go.mod build descriptor coordinates

func (*GoMod) GetVersion added in v1.51.0

func (m *GoMod) GetVersion() (string, error)

GetVersion returns the go.mod descriptor version property

func (*GoMod) SetVersion added in v1.51.0

func (m *GoMod) SetVersion(v string) error

SetVersion sets the go.mod descriptor version property

func (*GoMod) VersioningScheme added in v1.51.0

func (m *GoMod) VersioningScheme() string

VersioningScheme returns the relevant versioning scheme

type GoModDescriptor added in v1.51.0

type GoModDescriptor struct {
	GroupID    string
	ArtifactID string
	Version    string
	Packaging  string
}

GoModDescriptor holds the unique identifier combination for Go modules

type Gradle added in v1.51.0

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

Gradle defines a maven artifact used for versioning

func (*Gradle) GetArtifactID added in v1.51.0

func (g *Gradle) GetArtifactID() (string, error)

GetArtifactID returns the current ID of the artifact

func (*Gradle) GetCoordinates added in v1.51.0

func (g *Gradle) GetCoordinates() (Coordinates, error)

GetCoordinates reads the coordinates from the maven pom.xml descriptor file

func (*Gradle) GetVersion added in v1.51.0

func (g *Gradle) GetVersion() (string, error)

GetVersion returns the current version of the artifact

func (*Gradle) SetVersion added in v1.51.0

func (g *Gradle) SetVersion(version string) error

SetVersion updates the version of the artifact

func (*Gradle) VersioningScheme added in v1.51.0

func (g *Gradle) VersioningScheme() string

VersioningScheme returns the relevant versioning scheme

type GradleDescriptor added in v1.51.0

type GradleDescriptor struct {
	GroupID    string
	ArtifactID string
	Version    string
	Packaging  string
}

GradleDescriptor holds the unique identifier combination for Gradle built Java artifacts

type INIfile added in v1.23.0

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

INIfile defines an artifact using a json file for versioning

func (*INIfile) GetCoordinates added in v1.38.0

func (i *INIfile) GetCoordinates() (Coordinates, error)

GetCoordinates returns the coordinates

func (*INIfile) GetVersion added in v1.23.0

func (i *INIfile) GetVersion() (string, error)

GetVersion returns the current version of the artifact with a ini-file-based build descriptor

func (*INIfile) SetVersion added in v1.23.0

func (i *INIfile) SetVersion(version string) error

SetVersion updates the version of the artifact with a ini-file-based build descriptor

func (*INIfile) VersioningScheme added in v1.23.0

func (i *INIfile) VersioningScheme() string

VersioningScheme returns the relevant versioning scheme

type JSONDescriptor added in v1.51.0

type JSONDescriptor struct {
	GroupID    string
	ArtifactID string
	Version    string
	Packaging  string
}

JSONDescriptor holds the unique identifier combination for json artifacts

type JSONfile added in v1.23.0

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

JSONfile defines an artifact using a json file for versioning

func (*JSONfile) GetCoordinates added in v1.38.0

func (j *JSONfile) GetCoordinates() (Coordinates, error)

GetCoordinates returns the coordinates

func (*JSONfile) GetVersion added in v1.23.0

func (j *JSONfile) GetVersion() (string, error)

GetVersion returns the current version of the artifact with a JSON-based build descriptor

func (*JSONfile) SetVersion added in v1.23.0

func (j *JSONfile) SetVersion(version string) error

SetVersion updates the version of the artifact with a JSON-based build descriptor

func (*JSONfile) VersioningScheme added in v1.23.0

func (j *JSONfile) VersioningScheme() string

VersioningScheme returns the relevant versioning scheme

type Maven

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

Maven defines a maven artifact used for versioning

func (*Maven) GetArtifactID added in v1.38.0

func (m *Maven) GetArtifactID() (string, error)

GetArtifactID returns the current ID of the artifact

func (*Maven) GetCoordinates added in v1.38.0

func (m *Maven) GetCoordinates() (Coordinates, error)

GetCoordinates reads the coordinates from the maven pom.xml descriptor file

func (*Maven) GetGroupID added in v1.38.0

func (m *Maven) GetGroupID() (string, error)

GetGroupID returns the current ID of the Group

func (*Maven) GetPackaging added in v1.38.0

func (m *Maven) GetPackaging() (string, error)

GetPackaging returns the current ID of the Group

func (*Maven) GetVersion

func (m *Maven) GetVersion() (string, error)

GetVersion returns the current version of the artifact

func (*Maven) SetVersion

func (m *Maven) SetVersion(version string) error

SetVersion updates the version of the artifact

func (*Maven) VersioningScheme

func (m *Maven) VersioningScheme() string

VersioningScheme returns the relevant versioning scheme

type MavenDescriptor added in v1.38.0

type MavenDescriptor struct {
	GroupID    string
	ArtifactID string
	Version    string
	Packaging  string
}

MavenDescriptor holds the unique identifier combination for Maven built Java artifacts

type Options

type Options struct {
	ProjectSettingsFile string
	GlobalSettingsFile  string
	M2Path              string
	VersionSource       string
	VersionSection      string
	VersionField        string
	VersioningScheme    string
}

Options define build tool specific settings in order to properly retrieve e.g. the version of an artifact

type Pip added in v1.38.0

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

Pip utility to interact with Python specific versioning

func (*Pip) GetCoordinates added in v1.38.0

func (p *Pip) GetCoordinates() (Coordinates, error)

GetCoordinates returns the pip build descriptor coordinates

func (*Pip) GetVersion added in v1.38.0

func (p *Pip) GetVersion() (string, error)

GetVersion returns the Pip descriptor version property

func (*Pip) SetVersion added in v1.38.0

func (p *Pip) SetVersion(v string) error

SetVersion sets the Pip descriptor version property

func (*Pip) VersioningScheme added in v1.38.0

func (p *Pip) VersioningScheme() string

VersioningScheme returns the relevant versioning scheme

type PipDescriptor added in v1.38.0

type PipDescriptor struct {
	GroupID    string
	ArtifactID string
	Version    string
	Packaging  string
}

PipDescriptor holds the unique identifier combination for pip built Python artifacts

type Versionfile added in v1.23.0

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

Versionfile defines an artifact containing the version in a file, e.g. VERSION

func (*Versionfile) GetCoordinates added in v1.38.0

func (v *Versionfile) GetCoordinates() (Coordinates, error)

GetCoordinates returns the coordinates

func (*Versionfile) GetVersion added in v1.23.0

func (v *Versionfile) GetVersion() (string, error)

GetVersion returns the current version of the artifact

func (*Versionfile) SetVersion added in v1.23.0

func (v *Versionfile) SetVersion(version string) error

SetVersion updates the version of the artifact

func (*Versionfile) VersioningScheme added in v1.23.0

func (v *Versionfile) VersioningScheme() string

VersioningScheme returns the relevant versioning scheme

type YAMLDescriptor added in v1.38.0

type YAMLDescriptor struct {
	ArtifactID string
	Version    string
}

YAMLDescriptor holds the unique identifier combination for an artifact

type YAMLfile added in v1.23.0

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

YAMLfile defines an artifact using a yaml file for versioning

func (*YAMLfile) GetArtifactID added in v1.38.0

func (y *YAMLfile) GetArtifactID() (string, error)

GetArtifactID returns the current ID of the artifact

func (*YAMLfile) GetCoordinates added in v1.38.0

func (y *YAMLfile) GetCoordinates() (Coordinates, error)

GetCoordinates returns the coordinates

func (*YAMLfile) GetVersion added in v1.23.0

func (y *YAMLfile) GetVersion() (string, error)

GetVersion returns the current version of the artifact with a YAML-based build descriptor

func (*YAMLfile) SetVersion added in v1.23.0

func (y *YAMLfile) SetVersion(version string) error

SetVersion updates the version of the artifact with a YAML-based build descriptor

func (*YAMLfile) VersioningScheme added in v1.23.0

func (y *YAMLfile) VersioningScheme() string

VersioningScheme returns the relevant versioning scheme

Jump to

Keyboard shortcuts

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