Documentation ¶
Index ¶
- Constants
- Variables
- func AqlResultToSearchResult(readers []*content.ContentReader) (*content.ContentReader, error)
- func CheckIfRepoExists(repository string, artDetails auth.ServiceDetails) error
- func ConfirmDelete(pathsToDeleteReader *content.ContentReader) (bool, error)
- func CreateBuildInfoPropertiesFile(buildName, buildNumber string, config *viper.Viper, projectType ProjectType) (string, error)
- func CreateBuildProperties(buildName, buildNumber string) (string, error)
- func CreateDeleteServiceManager(artDetails *config.ArtifactoryDetails, threads int, dryRun bool) (artifactory.ArtifactoryServicesManager, error)
- func CreateDistributionServiceManager(artDetails *config.ArtifactoryDetails, isDryRun bool) (*distribution.DistributionServicesManager, error)
- func CreateDownloadServiceManager(artDetails *config.ArtifactoryDetails, threads int, dryRun bool, ...) (artifactory.ArtifactoryServicesManager, error)
- func CreateServiceManager(artDetails *config.ArtifactoryDetails, isDryRun bool) (artifactory.ArtifactoryServicesManager, error)
- func CreateServiceManagerWithProgressBar(artDetails *config.ArtifactoryDetails, threads int, dryRun bool, ...) (artifactory.ArtifactoryServicesManager, error)
- func CreateServiceManagerWithThreads(artDetails *config.ArtifactoryDetails, isDryRun bool, threads int) (artifactory.ArtifactoryServicesManager, error)
- func CreateUploadServiceManager(artDetails *config.ArtifactoryDetails, threads int, dryRun bool, ...) (artifactory.ArtifactoryServicesManager, error)
- func DownloadExtractorIfNeeded(downloadPath, targetPath string) error
- func ExtractInsecureTlsFromArgs(args []string) (cleanArgs []string, insecureTls bool, err error)
- func FindBooleanFlag(flagName string, args []string) (flagIndex int, flagValue bool, err error)
- func FindFlag(flagName string, args []string) (flagIndex, flagValueIndex int, flagValue string, err error)
- func FindFlagFirstMatch(flags, args []string) (flagIndex, flagValueIndex int, flagValue string, err error)
- func GetBuildDir(buildName, buildNumber string) (string, error)
- func GetBuildNameAndNumber(buildName, buildNumber string) (string, string)
- func GetBuildScanError() error
- func GetEncryptedPasswordFromArtifactory(artifactoryAuth auth.ServiceDetails, insecureTls bool) (string, error)
- func GetGeneratedBuildsInfo(buildName, buildNumber string) ([]*buildinfo.BuildInfo, error)
- func GetJcenterRemoteDetails(downloadPath string) (artDetails *config.ArtifactoryDetails, remotePath string, err error)
- func GetProjectConfFilePath(projectType ProjectType) (confFilePath string, exists bool, err error)
- func GetProjectDir(global bool) (string, error)
- func GetRepoNameForDependenciesSearch(repoName string, serviceManager artifactory.ArtifactoryServicesManager) (string, error)
- func GetRepositories(artDetails auth.ServiceDetails, repoType ...RepoType) ([]string, error)
- func GetRtDetails(vConfig *viper.Viper) (*config.ArtifactoryDetails, error)
- func GetSearchParams(f *spec.File) (searchParams services.SearchParams, err error)
- func ParseArgs(args []string) ([]string, error)
- func PrintSearchResults(reader *content.ContentReader) error
- func ReadAllContent(cr *content.ContentReader, pointer interface{}) 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 RemoveFlagFromCommand(args *[]string, flagIndex, flagValueIndex int)
- func SaveBuildGeneralDetails(buildName, buildNumber string) error
- func SaveBuildInfo(buildName, buildNumber string, buildInfo *buildinfo.BuildInfo) error
- func SavePartialBuildInfo(buildName, buildNumber string, ...) error
- func SearchResultNoDate(reader *content.ContentReader) (*content.ContentReader, error)
- func ValidateBuildAndModuleParams(buildConfig *BuildConfiguration) error
- type BuildConfigMapping
- type BuildConfiguration
- type BuildInfoConfiguration
- type ConfigType
- type DownloadConfiguration
- type ProjectType
- type RepoType
- type Repository
- type RepositoryConfig
- func (repo *RepositoryConfig) IsRtDetailsEmpty() bool
- func (repo *RepositoryConfig) RtDetails() (*config.ArtifactoryDetails, error)
- func (repo *RepositoryConfig) SetRtDetails(rtDetails *config.ArtifactoryDetails) *RepositoryConfig
- func (repo *RepositoryConfig) SetTargetRepo(targetRepo string) *RepositoryConfig
- func (repo *RepositoryConfig) TargetRepo() string
- type SearchResult
- type UploadConfiguration
Constants ¶
const ( // This env var should be used for downloading the extractor jars through an Artifactory remote // repository, instead of downloading directly from jcenter. The remote repository should be // configured to proxy jcenter. // The env var should store a server ID configured by JFrog CLI. JCenterRemoteServerEnv = "JFROG_CLI_JCENTER_REMOTE_SERVER" // If the JCenterRemoteServerEnv env var is used, a maven remote repository named jcenter is assumed. // This env var can be used to use a different remote repository name. JCenterRemoteRepoEnv = "JFROG_CLI_JCENTER_REMOTE_REPO" )
const ( ProjectConfigResolverPrefix = "resolver" ProjectConfigDeployerPrefix = "deployer" ProjectConfigRepo = "repo" ProjectConfigServerId = "serverId" )
const ARTIFACT_PATTERN = "artifactPattern"
const BUILD_NAME = "build.name"
For key/value binding
const BUILD_NUMBER = "build.number"
const BUILD_TIMESTAMP = "build.timestamp"
const BuildInfoDetails = "details"
const BuildTempPath = "jfrog/builds/"
const ClassworldsConf = `` /* 166-byte string literal not displayed */
const DEPLOYER_PREFIX = "deployer."
const DEPLOY_ARTIFACTS = "artifacts"
const FORK_COUNT = "forkCount"
const GENERATED_BUILD_INFO = "buildInfo.generated"
const GENERATED_BUILD_INFO_TEMP_PREFIX = "generatedBuildInfo"
const GradleInitScript = `` /* 1384-byte string literal not displayed */
const HOST = "host"
const (
HttpProxy = "HTTP_PROXY"
)
const INSECURE_TLS = "insecureTls"
const IVY_DESCRIPTOR = "deployIvyDescriptors"
const IVY_PATTERN = "ivyPattern"
const MAVEN_DESCRIPTOR = "deployMavenDescriptors"
const PASSWORD = "password"
const PORT = "port"
const PROPERTIES_TEMP_PATH = "jfrog/properties/"
const PROPERTIES_TEMP_PREFIX = "buildInfoProperties"
For path and temp files
const PROXY = "proxy."
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"
const USE_GRADLE_PLUGIN = "usePlugin"
const USE_GRADLE_WRAPPER = "useWrapper"
Variables ¶
var ProjectTypes = []string{
"go",
"pip",
"npm",
"nuget",
"maven",
"gradle",
"dotnet",
}
var RepoTypes = []string{
"local",
"remote",
"virtual",
}
Functions ¶
func AqlResultToSearchResult ¶
func AqlResultToSearchResult(readers []*content.ContentReader) (*content.ContentReader, error)
func CheckIfRepoExists ¶
func CheckIfRepoExists(repository string, artDetails auth.ServiceDetails) error
func ConfirmDelete ¶
func ConfirmDelete(pathsToDeleteReader *content.ContentReader) (bool, error)
func CreateBuildProperties ¶
func CreateDeleteServiceManager ¶
func CreateDeleteServiceManager(artDetails *config.ArtifactoryDetails, threads int, dryRun bool) (artifactory.ArtifactoryServicesManager, error)
func CreateDistributionServiceManager ¶
func CreateDistributionServiceManager(artDetails *config.ArtifactoryDetails, isDryRun bool) (*distribution.DistributionServicesManager, error)
func CreateDownloadServiceManager ¶
func CreateDownloadServiceManager(artDetails *config.ArtifactoryDetails, threads int, dryRun bool, progressBar io.Progress) (artifactory.ArtifactoryServicesManager, error)
func CreateServiceManager ¶
func CreateServiceManager(artDetails *config.ArtifactoryDetails, isDryRun bool) (artifactory.ArtifactoryServicesManager, error)
func CreateServiceManagerWithProgressBar ¶
func CreateServiceManagerWithProgressBar(artDetails *config.ArtifactoryDetails, threads int, dryRun bool, progressBar io.Progress) (artifactory.ArtifactoryServicesManager, error)
func CreateServiceManagerWithThreads ¶
func CreateServiceManagerWithThreads(artDetails *config.ArtifactoryDetails, isDryRun bool, threads int) (artifactory.ArtifactoryServicesManager, error)
func CreateUploadServiceManager ¶
func CreateUploadServiceManager(artDetails *config.ArtifactoryDetails, threads int, dryRun bool, progressBar io.Progress) (artifactory.ArtifactoryServicesManager, error)
func DownloadExtractorIfNeeded ¶
Download the relevant build-info-extractor jar, if it does not already exist locally. By default, the jar is downloaded directly from jcenter. If the JCenterRemoteServerEnv environment variable is configured, the jar will be downloaded from a remote Artifactory repository which proxies jcenter.
downloadPath: The Bintray or Artifactory download path. filename: The local file name. targetPath: The local download path (without the file name).
func FindBooleanFlag ¶
Boolean flag can be provided in one of the following forms: 1. --flag=value, where value can be true/false 2. --flag, here the value is true Return values: flagIndex - index of flagName in args. flagValue - value of flagName. err - error if flag exists, but we failed to extract its value. If flag does not exist flagIndex = -1 with false value and nil error.
func FindFlag ¶
func FindFlag(flagName string, args []string) (flagIndex, flagValueIndex int, flagValue string, err error)
Find value of required CLI flag in Command. If flag does not exist, the returned index is -1 and nil is returned as the error. Return values: err - error if flag exists but failed to extract its value. flagIndex - index of flagName in Command. flagValueIndex - index in Command in which the value of the flag exists. flagValue - value of flagName.
func FindFlagFirstMatch ¶
func FindFlagFirstMatch(flags, args []string) (flagIndex, flagValueIndex int, flagValue string, err error)
Find the first match of any of the provided flags in args. Return same values as FindFlag.
func GetBuildDir ¶
func GetBuildNameAndNumber ¶
Get build name and number from env, only if both missing
func GetBuildScanError ¶
func GetBuildScanError() error
func GetEncryptedPasswordFromArtifactory ¶
func GetEncryptedPasswordFromArtifactory(artifactoryAuth auth.ServiceDetails, insecureTls bool) (string, error)
func GetGeneratedBuildsInfo ¶
func GetJcenterRemoteDetails ¶
func GetJcenterRemoteDetails(downloadPath string) (artDetails *config.ArtifactoryDetails, remotePath string, err error)
func GetProjectConfFilePath ¶
func GetProjectConfFilePath(projectType ProjectType) (confFilePath string, exists bool, err error)
If configuration file exists in the working dir or in one of its parent dirs return its path, otherwise return the global configuration file path
func GetProjectDir ¶
func GetRepoNameForDependenciesSearch ¶
func GetRepoNameForDependenciesSearch(repoName string, serviceManager artifactory.ArtifactoryServicesManager) (string, error)
Since we can't search dependencies in a remote repository, we will turn the search to the repository's cache. Local/Virtual repository name will be returned as is.
func GetRepositories ¶
func GetRepositories(artDetails auth.ServiceDetails, repoType ...RepoType) ([]string, error)
func GetRtDetails ¶
func GetRtDetails(vConfig *viper.Viper) (*config.ArtifactoryDetails, error)
Returns the Artifactory details Checks first for the deployer information if exists and if not, checks for the resolver information.
func GetSearchParams ¶
func GetSearchParams(f *spec.File) (searchParams services.SearchParams, err error)
func ParseArgs ¶
Iterate over each argument, if env variable is found (e.g $HOME) replace it with env value.
func PrintSearchResults ¶
func PrintSearchResults(reader *content.ContentReader) error
func ReadAllContent ¶ added in v1.1.0
func ReadAllContent(cr *content.ContentReader, pointer interface{}) error
ReadAllContent stores the entire content of the given contentReader in the value pointed by the given pointer.
func ReadConfigFile ¶
func ReadConfigFile(configPath string, configType ConfigType) (*viper.Viper, error)
func RemoveBuildDir ¶
func RemoveFlagFromCommand ¶
Removes the provided flag and value from the command arguments
func SaveBuildGeneralDetails ¶
func SaveBuildInfo ¶
func SavePartialBuildInfo ¶
func SearchResultNoDate ¶
func SearchResultNoDate(reader *content.ContentReader) (*content.ContentReader, error)
func ValidateBuildAndModuleParams ¶
func ValidateBuildAndModuleParams(buildConfig *BuildConfiguration) error
Types ¶
type BuildConfigMapping ¶
type BuildConfigMapping map[ProjectType][]*map[string]string
type BuildConfiguration ¶
func ExtractBuildDetailsFromArgs ¶
func ExtractBuildDetailsFromArgs(args []string) (cleanArgs []string, buildConfig *BuildConfiguration, err error)
type BuildInfoConfiguration ¶
type BuildInfoConfiguration struct { DryRun bool EnvInclude string EnvExclude string // contains filtered or unexported fields }
func (*BuildInfoConfiguration) GetArtifactoryDetails ¶
func (config *BuildInfoConfiguration) GetArtifactoryDetails() auth.ServiceDetails
func (*BuildInfoConfiguration) IsDryRun ¶
func (config *BuildInfoConfiguration) IsDryRun() bool
func (*BuildInfoConfiguration) SetArtifactoryDetails ¶
func (config *BuildInfoConfiguration) SetArtifactoryDetails(art auth.ServiceDetails)
type ConfigType ¶
type ConfigType string
const ( YAML ConfigType = "yaml" PROPERTIES ConfigType = "properties" )
type DownloadConfiguration ¶
type ProjectType ¶
type ProjectType int
const ( Go ProjectType = iota Pip Npm Nuget Maven Gradle Dotnet )
func (ProjectType) String ¶
func (projectType ProjectType) String() string
type Repository ¶
type Repository struct { Repo string `yaml:"repo,omitempty"` ServerId string `yaml:"serverId,omitempty"` SnapshotRepo string `yaml:"snapshotRepo,omitempty"` ReleaseRepo string `yaml:"releaseRepo,omitempty"` DeployMavenDesc bool `yaml:"deployMavenDescriptors,omitempty"` DeployIvyDesc bool `yaml:"deployIvyDescriptors,omitempty"` IvyPattern string `yaml:"ivyPattern,omitempty"` ArtifactsPattern string `yaml:"artifactPattern,omitempty"` }
type RepositoryConfig ¶
type RepositoryConfig struct {
// contains filtered or unexported fields
}
func GetRepoConfigByPrefix ¶
func GetRepoConfigByPrefix(configFilePath, prefix string, vConfig *viper.Viper) (*RepositoryConfig, error)
func GetResolutionOnlyConfiguration ¶
func GetResolutionOnlyConfiguration(projectType ProjectType) (*RepositoryConfig, error)
func ReadResolutionOnlyConfiguration ¶
func ReadResolutionOnlyConfiguration(confFilePath string) (*RepositoryConfig, error)
func (*RepositoryConfig) IsRtDetailsEmpty ¶
func (repo *RepositoryConfig) IsRtDetailsEmpty() bool
func (*RepositoryConfig) RtDetails ¶
func (repo *RepositoryConfig) RtDetails() (*config.ArtifactoryDetails, error)
func (*RepositoryConfig) SetRtDetails ¶
func (repo *RepositoryConfig) SetRtDetails(rtDetails *config.ArtifactoryDetails) *RepositoryConfig
func (*RepositoryConfig) SetTargetRepo ¶
func (repo *RepositoryConfig) SetTargetRepo(targetRepo string) *RepositoryConfig
func (*RepositoryConfig) TargetRepo ¶
func (repo *RepositoryConfig) TargetRepo() string
type SearchResult ¶
type SearchResult struct { Path string `json:"path,omitempty"` Type string `json:"type,omitempty"` Size int64 `json:"size,omitempty"` Created string `json:"created,omitempty"` Modified string `json:"modified,omitempty"` Sha1 string `json:"sha1,omitempty"` Md5 string `json:"md5,omitempty"` Props map[string][]string `json:"props,omitempty"` }