Documentation ¶
Index ¶
- Constants
- type Build
- func (b *Build) AddDotnetModules(srcPath string) (*DotnetModule, error)
- func (b *Build) AddGoModule(srcPath string) (*GoModule, error)
- func (b *Build) AddGradleModule(srcPath string) (*GradleModule, error)
- func (b *Build) AddMavenModule(srcPath string) (*MavenModule, error)
- func (b *Build) AddNpmModule(srcPath string) (*NpmModule, error)
- func (b *Build) AddNugetModules(srcPath string) (*DotnetModule, error)
- func (b *Build) AddPythonModule(srcPath string, tool pythonutils.PythonTool) (*PythonModule, error)
- func (b *Build) AddYarnModule(srcPath string) (*YarnModule, error)
- func (b *Build) Clean() error
- func (b *Build) CollectEnv() error
- func (b *Build) SaveBuildInfo(buildInfo *entities.BuildInfo) (err error)
- func (b *Build) SavePartialBuildInfo(partial *entities.Partial) (err error)
- func (b *Build) SetAgentName(agentName string)
- func (b *Build) SetAgentVersion(agentVersion string)
- func (b *Build) SetBuildAgentVersion(buildAgentVersion string)
- func (b *Build) SetBuildUrl(buildUrl string)
- func (b *Build) SetPrincipal(principal string)
- func (b *Build) ToBuildInfo() (*entities.BuildInfo, error)
- type BuildInfoService
- func (bis *BuildInfoService) GetOrCreateBuild(buildName, buildNumber string) (*Build, error)
- func (bis *BuildInfoService) GetOrCreateBuildWithProject(buildName, buildNumber, projectKey string) (*Build, error)
- func (bis *BuildInfoService) SetLogger(logger utils.Log)
- func (bis *BuildInfoService) SetTempDirPath(tempDirPath string)
- type DotnetModule
- func (dm *DotnetModule) CalcDependencies() error
- func (dm *DotnetModule) GetArgAndFlags() []string
- func (dm *DotnetModule) GetName() string
- func (dm *DotnetModule) GetSolutionPath() string
- func (dm *DotnetModule) GetSubcommand() string
- func (dm *DotnetModule) GetToolchainType() dotnet.ToolchainType
- func (dm *DotnetModule) SetArgAndFlags(argAndFlags []string)
- func (dm *DotnetModule) SetName(name string)
- func (dm *DotnetModule) SetSolutionPath(solutionPath string)
- func (dm *DotnetModule) SetSubcommand(subCommand string)
- func (dm *DotnetModule) SetToolchainType(toolchainType dotnet.ToolchainType)
- type GoModule
- type GradleModule
- type MavenModule
- type NpmModule
- type PythonModule
- func (pm *PythonModule) InstallWithLogParsing(commandArgs []string) (map[string]entities.Dependency, error)
- func (pm *PythonModule) RunInstallAndCollectDependencies(commandArgs []string) error
- func (pm *PythonModule) SetLocalDependenciesPath(localDependenciesPath string)
- func (pm *PythonModule) SetName(name string)
- func (pm *PythonModule) SetUpdateDepsChecksumInfoFunc(...)
- type YarnModule
- func (ym *YarnModule) AddArtifacts(artifacts ...entities.Artifact) error
- func (ym *YarnModule) Build() error
- func (ym *YarnModule) SetArgs(yarnArgs []string)
- func (ym *YarnModule) SetName(name string)
- func (ym *YarnModule) SetThreads(threads int)
- func (ym *YarnModule) SetTraverseDependenciesFunc(traverseDependenciesFunc func(dependency *entities.Dependency) (bool, error))
Constants ¶
const ( GradleExtractorFileName = "build-info-extractor-gradle-%s-uber.jar" GradleExtractorRemotePath = "org/jfrog/buildinfo/build-info-extractor-gradle/%s" GradleExtractorDependencyVersion = "4.29.2" )
const ( MavenHome = "M2_HOME" MavenExtractorFileName = "build-info-extractor-maven3-%s-uber.jar" PropertiesTempfolderName = "properties" GeneratedBuildInfoTempPrefix = "generatedBuildInfo" MavenExtractorDependencyVersion = "2.37.2" ClassworldsConf = `` /* 171-byte string literal not displayed */ )
const (
// BuildInfo details dir name
BuildInfoDetails = "details"
)
const BuildsTempPath = "jfrog/builds/"
const GradleInitScript = `` /* 1384-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Build ¶
type Build struct {
// contains filtered or unexported fields
}
func (*Build) AddDotnetModules ¶ added in v1.3.0
func (b *Build) AddDotnetModules(srcPath string) (*DotnetModule, error)
AddDotnetModules adds a Dotnet module to this Build. Pass srcPath as an empty string if the root of the Dotnet project is the working directory.
func (*Build) AddGoModule ¶
AddGoModule adds a Go module to this Build. Pass srcPath as an empty string if the root of the Go project is the working directory.
func (*Build) AddGradleModule ¶
func (b *Build) AddGradleModule(srcPath string) (*GradleModule, error)
AddGradleModule adds a Gradle module to this Build. Pass srcPath as an empty string if the root of the Gradle project is the working directory.
func (*Build) AddMavenModule ¶
func (b *Build) AddMavenModule(srcPath string) (*MavenModule, error)
AddMavenModule adds a Maven module to this Build. Pass srcPath as an empty string if the root of the Maven project is the working directory.
func (*Build) AddNpmModule ¶ added in v1.0.0
AddNpmModule adds a Npm module to this Build. Pass srcPath as an empty string if the root of the Npm project is the working directory.
func (*Build) AddNugetModules ¶ added in v1.3.0
func (b *Build) AddNugetModules(srcPath string) (*DotnetModule, error)
AddNugetModules adds a Nuget module to this Build. Pass srcPath as an empty string if the root of the Nuget project is the working directory.
func (*Build) AddPythonModule ¶ added in v1.2.3
func (b *Build) AddPythonModule(srcPath string, tool pythonutils.PythonTool) (*PythonModule, error)
AddPythonModule adds a Python module to this Build. Pass srcPath as an empty string if the root of the python project is the working directory.
func (*Build) AddYarnModule ¶ added in v1.1.0
func (b *Build) AddYarnModule(srcPath string) (*YarnModule, error)
AddYarnModule adds a Yarn module to this Build. Pass srcPath as an empty string if the root of the Yarn project is the working directory.
func (*Build) CollectEnv ¶
func (*Build) SaveBuildInfo ¶
func (*Build) SavePartialBuildInfo ¶
SavePartialBuildInfo saves the given partial in the builds directory. The partial's Timestamp field is set inside this function.
func (*Build) SetAgentName ¶
This field is not saved in local cache. It is used only when creating a build-info using the ToBuildInfo() function.
func (*Build) SetAgentVersion ¶
This field is not saved in local cache. It is used only when creating a build-info using the ToBuildInfo() function.
func (*Build) SetBuildAgentVersion ¶
This field is not saved in local cache. It is used only when creating a build-info using the ToBuildInfo() function.
func (*Build) SetBuildUrl ¶
This field is not saved in local cache. It is used only when creating a build-info using the ToBuildInfo() function.
func (*Build) SetPrincipal ¶
This field is not saved in local cache. It is used only when creating a build-info using the ToBuildInfo() function.
type BuildInfoService ¶
type BuildInfoService struct {
// contains filtered or unexported fields
}
func NewBuildInfoService ¶
func NewBuildInfoService() *BuildInfoService
func (*BuildInfoService) GetOrCreateBuild ¶
func (bis *BuildInfoService) GetOrCreateBuild(buildName, buildNumber string) (*Build, error)
GetOrCreateBuild gets a build from cache, or creates a new one if it doesn't exist. It's important to invoke this function at the very beginning of the build, so that the start time property in the build-info will be accurate.
func (*BuildInfoService) GetOrCreateBuildWithProject ¶
func (bis *BuildInfoService) GetOrCreateBuildWithProject(buildName, buildNumber, projectKey string) (*Build, error)
GetOrCreateBuildWithProject gets a build from cache, or creates a new one if it doesn't exist. It's important to invoke this function at the very beginning of the build, so that the start time property in the build-info will be accurate.
func (*BuildInfoService) SetLogger ¶
func (bis *BuildInfoService) SetLogger(logger utils.Log)
func (*BuildInfoService) SetTempDirPath ¶
func (bis *BuildInfoService) SetTempDirPath(tempDirPath string)
type DotnetModule ¶ added in v1.3.0
type DotnetModule struct {
// contains filtered or unexported fields
}
func (*DotnetModule) CalcDependencies ¶ added in v1.3.0
func (dm *DotnetModule) CalcDependencies() error
CalcDependencies exec all type of dotnet commands - install, update, add, restore. Collects the dotnet project's dependencies and saves them in the build-info module.
func (*DotnetModule) GetArgAndFlags ¶ added in v1.5.2
func (dm *DotnetModule) GetArgAndFlags() []string
func (*DotnetModule) GetName ¶ added in v1.5.2
func (dm *DotnetModule) GetName() string
func (*DotnetModule) GetSolutionPath ¶ added in v1.5.2
func (dm *DotnetModule) GetSolutionPath() string
func (*DotnetModule) GetSubcommand ¶ added in v1.5.2
func (dm *DotnetModule) GetSubcommand() string
func (*DotnetModule) GetToolchainType ¶ added in v1.5.2
func (dm *DotnetModule) GetToolchainType() dotnet.ToolchainType
func (*DotnetModule) SetArgAndFlags ¶ added in v1.3.0
func (dm *DotnetModule) SetArgAndFlags(argAndFlags []string)
func (*DotnetModule) SetName ¶ added in v1.3.0
func (dm *DotnetModule) SetName(name string)
func (*DotnetModule) SetSolutionPath ¶ added in v1.3.0
func (dm *DotnetModule) SetSolutionPath(solutionPath string)
func (*DotnetModule) SetSubcommand ¶ added in v1.3.0
func (dm *DotnetModule) SetSubcommand(subCommand string)
func (*DotnetModule) SetToolchainType ¶ added in v1.3.0
func (dm *DotnetModule) SetToolchainType(toolchainType dotnet.ToolchainType)
type GoModule ¶
type GoModule struct {
// contains filtered or unexported fields
}
func (*GoModule) AddArtifacts ¶
func (*GoModule) CalcDependencies ¶
type GradleModule ¶
type GradleModule struct {
// contains filtered or unexported fields
}
func (*GradleModule) CalcDependencies ¶
func (gm *GradleModule) CalcDependencies() (err error)
Generates Gradle build-info.
func (*GradleModule) SetExtractorDetails ¶
func (gm *GradleModule) SetExtractorDetails(localExtractorPath, extractorPropsDir string, tasks []string, useWrapper, usePlugin bool, downloadExtractorFunc func(downloadTo, downloadFrom string) error, props map[string]string) *GradleModule
type MavenModule ¶
type MavenModule struct {
// contains filtered or unexported fields
}
func (*MavenModule) CalcDependencies ¶
func (mm *MavenModule) CalcDependencies() error
Generates Maven build-info.
func (*MavenModule) SetExtractorDetails ¶
func (mm *MavenModule) SetExtractorDetails(localdExtractorPath, extractorPropsdir string, goals []string, downloadExtractorFunc func(downloadTo, downloadFrom string) error, configProps map[string]string) *MavenModule
func (*MavenModule) SetMavenGoals ¶ added in v1.0.0
func (mm *MavenModule) SetMavenGoals(goals ...string)
func (*MavenModule) SetMavenOpts ¶
func (mm *MavenModule) SetMavenOpts(mavenOpts ...string)
type NpmModule ¶ added in v1.0.0
type NpmModule struct {
// contains filtered or unexported fields
}
func (*NpmModule) AddArtifacts ¶ added in v1.0.0
func (*NpmModule) CalcDependencies ¶ added in v1.0.0
func (*NpmModule) SetNpmArgs ¶ added in v1.0.0
type PythonModule ¶ added in v1.2.3
type PythonModule struct {
// contains filtered or unexported fields
}
func (*PythonModule) InstallWithLogParsing ¶ added in v1.2.3
func (pm *PythonModule) InstallWithLogParsing(commandArgs []string) (map[string]entities.Dependency, error)
Run install command while parsing the logs for downloaded packages. Populates 'downloadedDependencies' with downloaded package-name and its actual downloaded file (wheel/egg/zip...).
func (*PythonModule) RunInstallAndCollectDependencies ¶ added in v1.2.3
func (pm *PythonModule) RunInstallAndCollectDependencies(commandArgs []string) error
func (*PythonModule) SetLocalDependenciesPath ¶ added in v1.2.3
func (pm *PythonModule) SetLocalDependenciesPath(localDependenciesPath string)
func (*PythonModule) SetName ¶ added in v1.2.3
func (pm *PythonModule) SetName(name string)
func (*PythonModule) SetUpdateDepsChecksumInfoFunc ¶ added in v1.2.3
func (pm *PythonModule) SetUpdateDepsChecksumInfoFunc(updateDepsChecksumInfoFunc func(dependenciesMap map[string]entities.Dependency, srcPath string) error)
type YarnModule ¶ added in v1.1.0
type YarnModule struct {
// contains filtered or unexported fields
}
func (*YarnModule) AddArtifacts ¶ added in v1.1.0
func (ym *YarnModule) AddArtifacts(artifacts ...entities.Artifact) error
func (*YarnModule) Build ¶ added in v1.1.0
func (ym *YarnModule) Build() error
Build builds the project, collects its dependencies and saves them in the build-info module.
func (*YarnModule) SetArgs ¶ added in v1.1.0
func (ym *YarnModule) SetArgs(yarnArgs []string)
func (*YarnModule) SetName ¶ added in v1.1.0
func (ym *YarnModule) SetName(name string)
func (*YarnModule) SetThreads ¶ added in v1.1.0
func (ym *YarnModule) SetThreads(threads int)
func (*YarnModule) SetTraverseDependenciesFunc ¶ added in v1.1.0
func (ym *YarnModule) SetTraverseDependenciesFunc(traverseDependenciesFunc func(dependency *entities.Dependency) (bool, error))
SetTraverseDependenciesFunc gets a function to execute on all dependencies after their collection in Build(), before they're saved. This function needs to return a boolean value indicating whether to save this dependency in the build-info or not. This function might run asynchronously with different dependencies (if the threads amount setting is bigger than 1). If more than one error are returned from this function in different threads, only the first of them will be returned from Build().