コード例 #1
0
func searchInArtifactory(specFile string) (result []commands.SearchResult, err error) {
	searchFlags := new(commands.SearchFlags)
	searchFlags.ArtDetails = artifactoryDetails
	searchSpec, _ := utils.CreateSpecFromFile(specFile)
	result, err = commands.Search(searchSpec, searchFlags)
	return
}
コード例 #2
0
func getPathsToDelete(specFile string) []utils.AqlSearchResultItem {
	flags := new(commands.DeleteFlags)
	flags.ArtDetails = artifactoryDetails
	deleteSpec, _ := utils.CreateSpecFromFile(specFile)
	artifactsToDelete, _ := commands.GetPathsToDelete(deleteSpec, flags)
	return artifactsToDelete
}
コード例 #3
0
ファイル: cli.go プロジェクト: JFrogDev/jfrog-cli-go
func getSearchSpec(c *cli.Context) (searchSpec *utils.SpecFiles, err error) {
	searchSpec, err = utils.CreateSpecFromFile(c.String("spec"))
	if err != nil {
		return
	}
	//Override spec with CLI options
	for i := 0; i < len(searchSpec.Files); i++ {
		overrideStringIfSet(&searchSpec.Get(i).Props, c, "props")
		overrideStringIfSet(&searchSpec.Get(i).Recursive, c, "recursive")
	}
	return
}
コード例 #4
0
ファイル: cli.go プロジェクト: JFrogDev/jfrog-cli-go
func getDownloadSpec(c *cli.Context) (downloadSpec *utils.SpecFiles, err error) {
	downloadSpec, err = utils.CreateSpecFromFile(c.String("spec"))
	if err != nil {
		return
	}
	fixWinDownloadFilesPath(downloadSpec)
	//Override spec with CLI options
	for i := 0; i < len(downloadSpec.Files); i++ {
		downloadSpec.Get(i).Pattern = strings.TrimPrefix(downloadSpec.Get(i).Pattern, "/")
		overrideStringIfSet(&downloadSpec.Get(i).Props, c, "props")
		overrideStringIfSet(&downloadSpec.Get(i).Flat, c, "flat")
		overrideStringIfSet(&downloadSpec.Get(i).Recursive, c, "recursive")
	}
	return
}
コード例 #5
0
ファイル: cli.go プロジェクト: JFrogDev/jfrog-cli-go
func getUploadSpec(c *cli.Context) (uploadSpec *utils.SpecFiles, err error) {
	uploadSpec, err = utils.CreateSpecFromFile(c.String("spec"))
	if err != nil {
		return
	}
	fixWinUploadFilesPath(uploadSpec)
	//Override spec with CLI options
	for i := 0; i < len(uploadSpec.Files); i++ {
		uploadSpec.Get(i).Target = strings.TrimPrefix(uploadSpec.Get(i).Target, "/")
		overrideStringIfSet(&uploadSpec.Get(i).Props, c, "props")
		overrideStringIfSet(&uploadSpec.Get(i).Flat, c, "flat")
		overrideStringIfSet(&uploadSpec.Get(i).Recursive, c, "recursive")
		overrideStringIfSet(&uploadSpec.Get(i).Regexp, c, "regexp")
	}
	return
}
コード例 #6
0
func cleanArtifactory() {
	deleteFlags := new(commands.DeleteFlags)
	deleteFlags.ArtDetails = artifactoryDetails
	deleteSpec, _ := utils.CreateSpecFromFile(tests.GetFilePath(tests.DeleteSpec))
	commands.Delete(deleteSpec, deleteFlags)
}