Documentation ¶
Index ¶
- Constants
- Variables
- func CheckIfRepoExists(repository string, artDetails auth.ArtifactoryDetails) error
- func ConvertResultItemArrayToDeleteItemArray(resultItems []servicesutils.ResultItem) []services.DeleteItem
- func CreateBuildInfoPropertiesFile(buildName, buildNumber string, config *viper.Viper, buildType BuildType) (string, error)
- func CreateBuildProperties(buildName, buildNumber string) (string, error)
- func CreateServiceManager(artDetails *config.ArtifactoryDetails, isDryRun bool) (*artifactory.ArtifactoryServicesManager, error)
- func DownloadFromBintrayIfNeeded(downloadPath, filename, targetPath string) error
- func GetBuildDir(buildName, buildNumber string) (string, error)
- func GetEncryptedPasswordFromArtifactory(artifactoryAuth auth.ArtifactoryDetails) (string, error)
- func GetGeneratedBuildsInfo(buildName, buildNumber string) ([]*buildinfo.BuildInfo, error)
- func GetJfrogSecurityDir() (string, error)
- func GetRegExp(regex string) (*regexp.Regexp, error)
- func GetRepositories(artDetails auth.ArtifactoryDetails, repoType ...RepoType) ([]string, error)
- func ReadBuildInfoGeneralDetails(buildName, buildNumber string) (*buildinfo.General, error)
- func ReadConfigFile(configPath string, configType ConfigType) (*viper.Viper, error)
- func ReadPartialBuildInfoFiles(buildName, buildNumber string) (buildinfo.Partials, error)
- func RemoveBuildDir(buildName, buildNumber string) error
- func RunCmd(config CmdConfig) error
- func RunCmdOutput(config CmdConfig) ([]byte, error)
- func RunCmdWithOutputParser(config CmdConfig, regExpStruct ...*CmdOutputPattern) error
- func SaveBuildGeneralDetails(buildName, buildNumber string) error
- func SaveBuildInfo(buildName, buildNumber string, buildInfo *buildinfo.BuildInfo) error
- func SavePartialBuildInfo(buildName, buildNumber string, ...) error
- type BuildConfigMapping
- type BuildConfiguration
- type BuildInfoConfiguration
- type BuildType
- type CmdConfig
- type CmdOutputPattern
- type ConfigType
- type RepoType
Constants ¶
const ARTIFACT_PATTERN = "artifactPattern"
const BUILD_NAME = "build.name"
For key/value binding
const BUILD_NUMBER = "build.number"
const BuildInfoDetails = "details"
const BuildTempPath = "jfrog/builds/"
const ClassworldsConf = `` /* 166-byte string literal not displayed */
const DEPLOYER_PREFIX = "deployer."
const GENERATED_BUILD_INFO = "buildInfo.generated"
const GENERATED_BUILD_INFO_TEMP_PREFIX = "generatedBuildInfo"
const GradleInitScript = `` /* 1344-byte string literal not displayed */
const IVY_DESCRIPTOR = "deployIvyDescriptors"
const IVY_PATTERN = "ivyPattern"
const MAVEN_DESCRIPTOR = "deployMavenDescriptors"
const PASSWORD = "password"
const PROPERTIES_TEMP_PATH = "jfrog/properties/"
const PROPERTIES_TEMP_PREFIX = "buildInfoProperties"
For path and temp files
const RELEASE_REPO = "releaseRepo"
const REPO = "repo"
const RESOLVER_PREFIX = "resolver."
const SERVER_ID = "serverId"
const SNAPSHOT_REPO = "snapshotRepo"
const URL = "url"
const USERNAME = "username"
Variables ¶
var BuildTypes = []string{
"maven",
"gradle",
}
var RepoTypes = []string{
"local",
"remote",
"virtual",
}
Functions ¶
func CheckIfRepoExists ¶
func CheckIfRepoExists(repository string, artDetails auth.ArtifactoryDetails) error
func ConvertResultItemArrayToDeleteItemArray ¶
func ConvertResultItemArrayToDeleteItemArray(resultItems []servicesutils.ResultItem) []services.DeleteItem
func CreateBuildProperties ¶
func CreateServiceManager ¶
func CreateServiceManager(artDetails *config.ArtifactoryDetails, isDryRun bool) (*artifactory.ArtifactoryServicesManager, error)
func DownloadFromBintrayIfNeeded ¶
Download file from Bintray. downloadPath: Bintray download path in the following format: subject/repo/path/version/filename. filename: the file full name. targetPath: local download target path.
func GetBuildDir ¶
func GetEncryptedPasswordFromArtifactory ¶
func GetEncryptedPasswordFromArtifactory(artifactoryAuth auth.ArtifactoryDetails) (string, error)
func GetGeneratedBuildsInfo ¶
func GetJfrogSecurityDir ¶
func GetRepositories ¶
func GetRepositories(artDetails auth.ArtifactoryDetails, repoType ...RepoType) ([]string, error)
func ReadConfigFile ¶
func ReadConfigFile(configPath string, configType ConfigType) (*viper.Viper, error)
func RemoveBuildDir ¶
func RunCmdOutput ¶
func RunCmdWithOutputParser ¶
func RunCmdWithOutputParser(config CmdConfig, regExpStruct ...*CmdOutputPattern) error
Executes the command and captures the output. Analyze each line to match the provided regex.
func SaveBuildGeneralDetails ¶
func SaveBuildInfo ¶
func SavePartialBuildInfo ¶
Types ¶
type BuildConfigMapping ¶
type BuildConfiguration ¶
type BuildInfoConfiguration ¶
type BuildInfoConfiguration struct { DryRun bool EnvInclude string EnvExclude string // contains filtered or unexported fields }
func (*BuildInfoConfiguration) GetArtifactoryDetails ¶
func (config *BuildInfoConfiguration) GetArtifactoryDetails() auth.ArtifactoryDetails
func (*BuildInfoConfiguration) IsDryRun ¶
func (config *BuildInfoConfiguration) IsDryRun() bool
func (*BuildInfoConfiguration) SetArtifactoryDetails ¶
func (config *BuildInfoConfiguration) SetArtifactoryDetails(art auth.ArtifactoryDetails)
type CmdConfig ¶
type CmdConfig interface { GetCmd() *exec.Cmd GetEnv() map[string]string GetStdWriter() io.WriteCloser GetErrWriter() io.WriteCloser }
type CmdOutputPattern ¶
type CmdOutputPattern struct { RegExp *regexp.Regexp ExecFunc func() (string, error) // contains filtered or unexported fields }
RegExp - The regexp that the line will be searched upon. matchedResult - The result string that was found by the regex line - The output line from the external process ExecFunc - The function to execute
func (*CmdOutputPattern) ErrorOnNotFound ¶
func (reg *CmdOutputPattern) ErrorOnNotFound() (string, error)
func (*CmdOutputPattern) MaskCredentials ¶
func (reg *CmdOutputPattern) MaskCredentials() (string, error)
Mask the credentials information from the line. The credentials are build as user:password For example: http://user:password@127.0.0.1:8081/artifactory/path/to/repo
type ConfigType ¶
type ConfigType string
const ( YAML ConfigType = "yaml" PROPERTIES ConfigType = "properties" )