build

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2022 License: Apache-2.0 Imports: 15 Imported by: 9

Documentation

Index

Constants

View Source
const (
	GradleExtractorFileName = "build-info-extractor-gradle-%s-uber.jar"

	GradleExtractorRemotePath        = "org/jfrog/buildinfo/build-info-extractor-gradle/%s"
	GradleExtractorDependencyVersion = "4.26.0"
)
View Source
const (
	MavenHome = "M2_HOME"

	MavenExtractorFileName = "build-info-extractor-maven3-%s-uber.jar"

	PropertiesTempfolderName = "properties"

	GeneratedBuildInfoTempPrefix    = "generatedBuildInfo"
	MavenExtractorDependencyVersion = "2.33.0"

	ClassworldsConf = `` /* 171-byte string literal not displayed */

)
View Source
const BuildInfoDetails = "details"
View Source
const BuildsTempPath = "jfrog/builds/"
View Source
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 NewBuild

func NewBuild(buildName, buildNumber, projectKey, tempDirPath string, logger utils.Log) *Build

func (*Build) AddGoModule

func (b *Build) AddGoModule(srcPath string) (*GoModule, error)

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

func (b *Build) AddNpmModule(srcPath string) (*NpmModule, error)

func (*Build) Clean

func (b *Build) Clean() error

func (*Build) CollectEnv

func (b *Build) CollectEnv() error

func (*Build) SaveBuildInfo

func (b *Build) SaveBuildInfo(buildInfo *entities.BuildInfo) (err error)

func (*Build) SavePartialBuildInfo

func (b *Build) SavePartialBuildInfo(partial *entities.Partial) (err error)

SavePartialBuildInfo saves the given partial in the builds directory. The partial's Timestamp field is set inside this function.

func (*Build) SetAgentName

func (b *Build) SetAgentName(agentName string)

This field is not saved in local cache. It is used only when creating a build-info using the ToBuildInfo() function.

func (*Build) SetAgentVersion

func (b *Build) SetAgentVersion(agentVersion string)

This field is not saved in local cache. It is used only when creating a build-info using the ToBuildInfo() function.

func (*Build) SetBuildAgentVersion

func (b *Build) SetBuildAgentVersion(buildAgentVersion string)

This field is not saved in local cache. It is used only when creating a build-info using the ToBuildInfo() function.

func (*Build) SetBuildUrl

func (b *Build) SetBuildUrl(buildUrl string)

This field is not saved in local cache. It is used only when creating a build-info using the ToBuildInfo() function.

func (*Build) SetPrincipal

func (b *Build) SetPrincipal(principal string)

This field is not saved in local cache. It is used only when creating a build-info using the ToBuildInfo() function.

func (*Build) ToBuildInfo

func (b *Build) ToBuildInfo() (*entities.BuildInfo, error)

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 GoModule

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

func (*GoModule) AddArtifacts

func (gm *GoModule) AddArtifacts(artifacts ...entities.Artifact) error

func (*GoModule) CalcDependencies

func (gm *GoModule) CalcDependencies() error

func (*GoModule) SetName

func (gm *GoModule) SetName(name string)

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 (nm *NpmModule) AddArtifacts(artifacts ...entities.Artifact) error

func (*NpmModule) CalcDependencies added in v1.0.0

func (nm *NpmModule) CalcDependencies() error

func (*NpmModule) SetName added in v1.0.0

func (nm *NpmModule) SetName(name string)

func (*NpmModule) SetNpmArgs added in v1.0.0

func (nm *NpmModule) SetNpmArgs(npmArgs []string)

func (*NpmModule) SetThreads added in v1.0.0

func (nm *NpmModule) SetThreads(threads int)

func (*NpmModule) SetTraverseDependenciesFunc added in v1.0.0

func (nm *NpmModule) SetTraverseDependenciesFunc(traverseDependenciesFunc func(dependency *entities.Dependency) (bool, error))

SetTraverseDependenciesFunc gets a function to execute on all dependencies after their collection in CalcDependencies(), 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 CalcDependencies().

func (*NpmModule) SetTypeRestriction added in v1.0.0

func (nm *NpmModule) SetTypeRestriction(typeRestriction utils.TypeRestriction)

Jump to

Keyboard shortcuts

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