Documentation ¶
Index ¶
- Constants
- Variables
- func GetBaseRef(envconfig *models.Configuration) (r string)
- func GetBuildSystem() string
- func GetCommitID(scanPath string) (commitId string)
- func GetFullBranchName(branchName string) string
- func GetImageDetails(imageName string) (prefix, repo, tag string)
- func GetRepositoryDetails(scanPath string, cmd string) (repoName, branch string, err error)
- func GetRepositoryUrl(prefix, repo string) string
- func GetScmID(scanPath string) string
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(envconfig *models.Configuration) (r string)
func GetBuildSystem ¶
func GetBuildSystem() string
func GetCommitID ¶
GetCommitID gets the current CommitID of the repository
func GetFullBranchName ¶ added in v0.69.0
func GetImageDetails ¶ added in v0.21.0
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 ¶
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
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.