metadata

package
v0.66.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Bitbucket = "bitbucket"
	Jenkins   = "jenkins"
	Gitlab    = "gitlab"
	Codebuild = "codebuild"
	Azure     = "azure"
	Github    = "github"
)

Variables

View Source
var (
	// SHARegexp is used to split an image digest value to a registry prefix,
	// repository name, and the SHA256 hash.
	SHARegexp = regexp.MustCompile(`^(?:([^/]+)/)([^@]+)(@sha256:[0-9a-f]+)$`)

	// SplitImageNameRegexp is used to split a fully qualified image name to a
	// registry prefix, repository name and image tag.
	SplitImageNameRegexp = regexp.MustCompile(`^(?:([^/]+)/)?([^:]+)(?::(.*))?$`)
	// PortRegexp is used to check whether a string ends with a port suffix
	// (e.g. :8080)
	PortRegexp = regexp.MustCompile(`:\d+$`)
)

Functions

func GetBaseRef added in v0.24.0

func GetBaseRef() (r string)

func GetBuildInfo added in v0.34.0

func GetBuildInfo(buildSystem string) (run string, buildID string)

GetBuildInfo the vendor build run number and id

func GetBuildSystem

func GetBuildSystem() string

func GetCommitID

func GetCommitID(scanPath string) (commitId string)

GetCommitID gets the current CommitID of the repository

func GetGitUser

func GetGitUser(scanPath string) (gitUser string)

GetGitUser attempts to get the user who performed the most recent commit

func GetImageDetails added in v0.21.0

func GetImageDetails(imageName string) (prefix, repo, tag string)

GetImageDetails gets the full name of an image (e.g. "repo/test:master", or even "docker.io/repo/test:master") and splits it into the registry prefix, repository name and the image tag (e.g. "docker.io", "repo/test" and "master" in the previous example).

func GetRepositoryDetails

func GetRepositoryDetails(scanPath string, cmd string) (repoName, branch string, err error)

GetRepositoryDetails gets the repository name and branch multiple env vars will be checked first before falling back to the folder name

func GetRepositoryUrl added in v0.21.0

func GetRepositoryUrl(prefix, repo string) string

func GetScmID

func GetScmID(scanPath string) string

GetScmID extracts the git path from the config file

Types

This section is empty.

Jump to

Keyboard shortcuts

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