Giter Club home page Giter Club logo

jfrog-cli's Introduction

JFrog CLI

JFrog CLI

Scanned by Frogbot Go Report Card license Go version

Tests status
V2 DEV
artifactory Artifactory
xray Xray
distribution Distribution
access Access
maven Maven
gradle Gradle
npm npm
docker Docker
podman Podman
nuget NuGet
python Python
go Go
๐Ÿ“ƒ Scripts
๐Ÿ“Š Code Analysis
๐Ÿ”Œ Plugins
โ˜๏ธ Transfer To Cloud

Table of Contents

Overview

JFrog CLI is a compact and smart client that provides a simple interface that automates access to Artifactory and Mission Control through their respective REST APIs. By using the JFrog CLI, you can greatly simplify your automation scripts making them more readable and easier to maintain. Several features of the JFrog CLI makes your scripts more efficient and reliable:

  • Multithreaded upload and download of artifacts make builds run faster
  • Checksum optimization reduces redundant file transfers
  • Wildcards and regular expressions give you an easy way to collect all the artifacts you wish to upload or download.
  • "Dry run" gives you a preview of file transfer operations before you actually run them

Download and Installation

You can either install JFrog CLI using one of the supported installers or download its executable directly. Visit the Install JFrog CLI Page for details.

Code Contributions

We welcome pull requests from the community. To help us improve this project, please read our contribution guide.

Using JFrog CLI

JFrog CLI can be used for a variety of functions with Artifactory, Xray and Mission Control, and has a dedicated set of commands for each product. To learn how to use JFrog CLI, please visit the JFrog CLI User Guide.

JFrog CLI Plugins

JFrog CLI Plugins support enhancing the functionality of JFrog CLI to meet the specific user and organization needs. The source code of a plugin is maintained as an open source Go project on GitHub. All public plugins are registered in JFrog CLI's Plugins Registry, which is hosted in the jfrog-cli-plugins-reg GitHub repository. We encourage you, as developers, to create plugins and share them publicly with the rest of the community. Read more about this in the JFrog CLI Plugin Developer Guide.

Release Notes

The release notes are available here.

jfrog-cli's People

Contributors

alexeivainshtein avatar asaf-federman avatar asafambar avatar asafgabai avatar attiasas avatar barbelity avatar dependabot[bot] avatar dimanevelev avatar eranturgeman avatar eyalb4doc avatar eyalbe4 avatar eyaldelarea avatar freddy33 avatar gailazar300 avatar galusben avatar github-actions[bot] avatar jfrog-ecosystem avatar liron-shalom avatar michaelbe-jfrog avatar omerzi avatar or-geva avatar orto17 avatar rjsh1 avatar robinino avatar sarao1310 avatar sverdlov93 avatar talarian1 avatar tamirhadad avatar yahavi avatar yoav avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jfrog-cli's Issues

Explode uploaded archive

It'd be great to use this tool to upload a zip to be exploded in a sub-path of a repo, rather than using Curl or using the UI Deploy to a dummy repo then moving the content to the real sub-path location (since the UI doesn't take a sub-path argument when deploying from an archive).

CLI Artifactory command should allow to provide Principal field to build info

In Artifactory CLI there is a command for publishing build info to Artifactory. It is Build Integration - Publish Build (build-publish). Currently, it does not allow to provide build principal - the person who run the build. As a result of this user who is used by CLI to authenticate to artifactory is used to populate build info information - fields Principal and Artifactory Principal.

can't `go get` the bintray cli

$ go get github.com/JFrogDev/jfrog-cli-go
package github.com/JFrogDev/jfrog-cli-go: no buildable Go source files in /home/siddharthist/go/src/github.com/JFrogDev/jfrog-cli-go

$ go get github.com/JFrogDev/jfrog-cli-go/bintray
can't load package: package github.com/JFrogDev/jfrog-cli-go/bintray: case-insensitive import collision: "github.com/JFrogDev/jfrog-cli-go/vendor/github.com/codegangsta/cli" and "github.com/jfrogdev/jfrog-cli-go/vendor/github.com/codegangsta/cli"

Authorization check before upload

When uploading a very large file, would it be possible to check if the user has write permissions before the file is fully uploaded? Can be a very long delay waiting for the upload just to get a 401.

Further improve build info integration (Artifactory)

Hi,

I am testing the JFrog CLI v1.5.1 within an Bamboo CI and Artifactory environment. Due to some restrictions with the Artifactory Bamboo plugin (beyond scope), I'd prefer interacting with Artifactoy via a CLI tool on the respective build agents.

Right now I am missing (at least) the following members when publishing the JSON build-info (taken from the example):

"url" : "http://my-ci-server/jenkins/job/My-project-name/28/", // CI server URL
"vcsRevision" : "e4ab2e493afd369ae7bdc90d69c912e8346a3463", // VCS revision
"vcsUrl" : "https://github.com/github-user/my-project.git", // VCS URL

Would it be possible to extend the respective build-publish command to accept these as additional arguments? Or am I overlooking something and there is (already) another way to achieve this with the CLI? Skimmed the code, but didn't find anything ...

Thanks a lot.
Cheers!

Artifactory response: 403 Forbidden

Hello,
I started Artifactory via

docker run --name artifactory -d -v `pwd`/artifactory:/var/opt/jfrog/artifactory -p 8081:8081 -e START_TMO=240 docker.bintray.io/jfrog/artifactory-oss:latest

went to localhost:8081 and changed the admin password. Now when I try using JFrog CLI to upload (or delete) artifacts with
./jfrog rt u --url=http://localhost:8081 --user=admin --password=bla Downloads/maven-source-plugin-3.0.1.jar http://localhost:8081
I receive the following error:

[Info] [Thread 2] Uploading artifact: Downloads/maven-source-plugin-3.0.1.jar
[Error] [Thread 2] Artifactory response: 403 Forbidden

HTTP Status 403 -

type Status report

message

description Access to the specified resource has been forbidden.


Apache Tomcat/8.0.41

[Error] [Thread 2] Artifactory response: 403 Forbidden

HTTP Status 403 -

type Status report

message

description Access to the specified resource has been forbidden.


Apache Tomcat/8.0.41

[Info] Uploaded 0 artifacts. [Error] Failed uploading 1 artifacts.

Uploading via the web interface does work but is not what I am currently needing.
Any ideas?

P.s.: Also, running /jfrog rt c results in:

Artifactory URL: http://localhost:8081
Artifactory server ID: test
API key (leave empty for basic authentication):
User: admin
Password: [Info] Encrypting password...
[Error]
Artifactory response: 404 Not Found

https with self signed cert

Hi,
if I specify an https url which uses a self signed certificate, the utility crashes badly :)

./jfrog rt u apache-tomcat-8.0.32-5.noarch.rpm hass_rpms --user=mauro --password=xxxxxx --url=https://libraries.dev2.cloud.local/artifactory/
[Thread 0] Uploading artifact: https://libraries.dev2.cloud.local/artifactory/hass_rpms/apache-tomcat-8.0.32-5.noarch.rpm
panic: Put https://libraries.dev2.cloud.local/artifactory/hass_rpms/apache-tomcat-8.0.32-5.noarch.rpm: x509: certificate signed by unknown authority

goroutine 5 [running]:
github.com/jfrogdev/jfrog-cli-go/cliutils.CheckError(0x7fa8be161428, 0xc82042a810)
/home/travis/gopath/src/github.com/JFrogDev/jfrog-cli-go/Godeps/_workspace/src/github.com/jfrogdev/jfrog-cli-go/cliutils/utils.go:26 +0x4b
github.com/jfrogdev/jfrog-cli-go/cliutils.Send(0x8860d0, 0x3, 0xc82001c360, 0x5a, 0x0, 0x0, 0x0, 0xc82004bc70, 0xc82003bd01, 0xc820013500, ...)
/home/travis/gopath/src/github.com/JFrogDev/jfrog-cli-go/Godeps/_workspace/src/github.com/jfrogdev/jfrog-cli-go/cliutils/ioutils.go:167 +0x4f9
github.com/jfrogdev/jfrog-cli-go/cliutils.SendPut(0xc82001c360, 0x5a, 0x0, 0x0, 0x0, 0xc82004bc70, 0xc820013500, 0xa, 0xc820013520, 0xa, ...)
/home/travis/gopath/src/github.com/JFrogDev/jfrog-cli-go/Godeps/_workspace/src/github.com/jfrogdev/jfrog-cli-go/cliutils/ioutils.go:129 +0xd9
github.com/jfrogdev/jfrog-cli-go/artifactory/commands.tryChecksumDeploy(0x7ffd4535f68a, 0x21, 0xc82001c360, 0x5a, 0xc82001c180, 0x0, 0x5a)
/home/travis/gopath/src/github.com/JFrogDev/jfrog-cli-go/Godeps/_workspace/src/github.com/jfrogdev/jfrog-cli-go/artifactory/commands/upload.go:167 +0x2bf
github.com/jfrogdev/jfrog-cli-go/artifactory/commands.uploadFile(0x7ffd4535f68a, 0x21, 0xc82001c360, 0x5a, 0xc82001c180, 0xc820013630, 0xa, 0x0)
/home/travis/gopath/src/github.com/JFrogDev/jfrog-cli-go/Godeps/_workspace/src/github.com/jfrogdev/jfrog-cli-go/artifactory/commands/upload.go:137 +0x3fd
github.com/jfrogdev/jfrog-cli-go/artifactory/commands.Upload.func1(0xc82001c180, 0x1, 0xc820011380, 0x1, 0x1, 0xc8200113a0, 0x3, 0x3, 0xc8200135f0, 0x0)
/home/travis/gopath/src/github.com/JFrogDev/jfrog-cli-go/Godeps/_workspace/src/github.com/jfrogdev/jfrog-cli-go/artifactory/commands/upload.go:38 +0x13d
created by github.com/jfrogdev/jfrog-cli-go/artifactory/commands.Upload
/home/travis/gopath/src/github.com/JFrogDev/jfrog-cli-go/Godeps/_workspace/src/github.com/jfrogdev/jfrog-cli-go/artifactory/commands/upload.go:43 +0x1e3

goroutine 1 [semacquire]:
sync.runtime_Semacquire(0xc8200135fc)
/usr/local/go/src/runtime/sema.go:43 +0x26
sync.(_WaitGroup).Wait(0xc8200135f0)
/usr/local/go/src/sync/waitgroup.go:126 +0xb4
github.com/jfrogdev/jfrog-cli-go/artifactory/commands.Upload(0x7ffd4535f68a, 0x21, 0x7ffd4535f6ac, 0x9, 0xc82001c180, 0xc820061a00, 0xc8200133f0)
/home/travis/gopath/src/github.com/JFrogDev/jfrog-cli-go/Godeps/_workspace/src/github.com/jfrogdev/jfrog-cli-go/artifactory/commands/upload.go:45 +0x1fe
github.com/jfrogdev/jfrog-cli-go/artifactory.upload(0xc8200903c0)
/home/travis/gopath/src/github.com/JFrogDev/jfrog-cli-go/Godeps/_workspace/src/github.com/jfrogdev/jfrog-cli-go/artifactory/cli.go:253 +0x2a1
github.com/jfrogdev/jfrog-cli-go/artifactory.GetCommands.func2(0xc8200903c0)
/home/travis/gopath/src/github.com/JFrogDev/jfrog-cli-go/Godeps/_workspace/src/github.com/jfrogdev/jfrog-cli-go/artifactory/cli.go:32 +0x21
github.com/JFrogDev/jfrog-cli-go/Godeps/_workspace/src/github.com/codegangsta/cli.Command.Run(0x8897d8, 0x6, 0x0, 0x0, 0xc820012de0, 0x1, 0x1, 0x88f520, 0xc, 0x0, ...)
/home/travis/gopath/src/github.com/JFrogDev/jfrog-cli-go/Godeps/_workspace/src/github.com/codegangsta/cli/command.go:174 +0x1397
github.com/JFrogDev/jfrog-cli-go/Godeps/_workspace/src/github.com/codegangsta/cli.(_App).Run(0xc820090140, 0xc82000a090, 0x7, 0x7, 0x0, 0x0)
/home/travis/gopath/src/github.com/JFrogDev/jfrog-cli-go/Godeps/_workspace/src/github.com/codegangsta/cli/app.go:187 +0x1135
main.main()
/home/travis/gopath/src/github.com/JFrogDev/jfrog-cli-go/jfrog/main.go:24 +0x315

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:1696 +0x1

can we put an option to ignore its verification like curl o wget have ?

Thanks

Generic API requests with JFrog CLI authentication (replace cURL)

Main motivations:

  1. It's insecure to pass credentials through command line and/or environment variables for cURL case - you never know where and how it leaks with advanced monitoring and/or multi-user environment.
  2. JFrog CLI already has more or less secure infrastructure for credentials storage and target server configuration.
  3. More API control in scripts is desired, but It's not feasible to implement all possible JFrog product API requests inside the CLI - it would constantly lag for new API getting added and may become a bloated monster as it already has 9.5M in size for amd64.

The proposal:

  1. Add generic jfrog (rt|bt|mc|xr) api[call] {method} {api_path} [ {body} | --body-file={file} ] command supporting the same global options for server selection and authentication.
  2. For PUT and POST cases, it should support a) plain string as parameter b) reading from file or c) reading from stdin, if neither of first cases.

Example of usage:

jfrog rt api PUT /repositories/test-repo '{ repo config }'

echo '{ repo config create }' | jfrog rt api PUT /repositories/test-repo2 

echo '{ repo config update }' > repo.json
jfrog rt api POST /repositories/test-repo2 --body-file=repo.json

jfrog rt api GET /repositories

jfrog rt api --server-id=other_repo GET /repositories

jfrog rt api DELETE /repositories/test-repo

Please add support for reporting error messages from the server

Troubleshooting problems pertaining to publishing to artifactory can be tedious if one does not have admin access to look at the artifactory system logs.

It would be helpful if the CLI provided an option, e.g., --debug, to include in the output whatever error information comes from the server in such cases.

Split into go client library?

Hi! I was happy to find this tool and was able to use it in my project - how do you guys feel about splitting part of the project into a Go client library? I could see some of the CLI options being useful as library calls, as well as some additional features (such as the List feature being discussed in issue #2)

Thanks!

download files from list

we have a usecase where we want to download multiple files from artifactory, that live in paths which are not easily expressible by wildcards. Therefore we want to specify a list of files that should be downloaded, so that we can use the parallel downloading capabilities of the jfrog client

E.g.:

# the following entries in list.txt
npm/tweetnacl/-/tweetnacl-0.13.3.tgz
npm/ua-parser-js/-/ua-parser-js-0.7.10.tgz
npm/uc.micro/-/uc.micro-1.0.2.tgz
npm/underscore/-/underscore-1.8.3.tgz
npm/urijs/-/urijs-1.18.1.tgz

command which downloads all items listed in list.txt:

jfrog rt dl --from-list ./list.txt

Make `rt search` parsable

Currently the output of the rt search command outputs a header such as:

Pinging Artifactory...
Done pinging Artifactory.
Searching Artifactory using AQL query: items.find({"repo": "my-repo","$or": [{"$and": [{"path": {"$match":"*"},"name":{"$match":"*"}}]}]}).include("name","repo","path")
Artifactory response: 200 OK

This makes is difficult to feed the output into commands such as jq.

Please provide some way of excluding this header, such as:

  1. A "quiet" flag to suppress the output
  2. Output the message to STDERR instead of STDOUT
  3. Don't output the message if STDOUT is not a TTY.

Download error

Hello,

i got this error when i download a folder:

Pinging Artifactory...
Done pinging Artifactory.
Searching Artifactory using AQL query: items.find({"repo": "gc-components","$or": [{"$and": [{"path": {"$match":"BrandResources/1.0.0.0/Keba"},"name":{"$match":""}}]},{"$and": [{"path": {"$match":"BrandResources/1.0.0.0/Keba/"},"name":{"$match":"_"}}]}]}).include("name","repo","path","actual_md5","actual_sha1","size")
Artifactory response: 403 Forbidden
panic: invalid character 'O' looking for beginning of value
goroutine 1 [running]:
panic(0x87fb80, 0xc0820c2a40)
/var/lib/jenkins/tools/org.jenkinsci.plugins.golang.GolangInstallation/g
o-1.6.2/src/runtime/panic.go:481 +0x3f4
github.com/jfrogdev/jfrog-cli-go/utils/cliutils.CheckError(0x3a5c18, 0xc0820c2a4
0)
/var/lib/jenkins/workspace/jfrog-cli-release/temp/src/github.com/jfrogde
v/jfrog-cli-go/utils/cliutils/utils.go:28 +0x52
github.com/jfrogdev/jfrog-cli-go/artifactory/utils.parseAqlSearchResponse(0xc082
136000, 0x3b, 0x600, 0x0, 0x0, 0x0)
/var/lib/jenkins/workspace/jfrog-cli-release/temp/src/github.com/jfrogde
v/jfrog-cli-go/artifactory/utils/aqlsearchutil.go:45 +0xb1
github.com/jfrogdev/jfrog-cli-go/artifactory/utils.AqlSearch(0xc082054000, 0x2b,
0x31300b0, 0xc082011080, 0xc082073d70, 0x6, 0x6, 0x0, 0x0, 0x0)
/var/lib/jenkins/workspace/jfrog-cli-release/temp/src/github.com/jfrogde
v/jfrog-cli-go/artifactory/utils/aqlsearchutil.go:39 +0x712
github.com/jfrogdev/jfrog-cli-go/artifactory/utils.AqlSearchDefaultReturnFields(
0xc082054000, 0x2b, 0x31300b0, 0xc082011080, 0x0, 0x0, 0x0)
/var/lib/jenkins/workspace/jfrog-cli-release/temp/src/github.com/jfrogde
v/jfrog-cli-go/artifactory/utils/aqlsearchutil.go:26 +0xc5
github.com/jfrogdev/jfrog-cli-go/artifactory/commands.Download(0xc082054000, 0x2
b, 0xc082011080)
/var/lib/jenkins/workspace/jfrog-cli-release/temp/src/github.com/jfrogde
v/jfrog-cli-go/artifactory/commands/download.go:24 +0x146
github.com/jfrogdev/jfrog-cli-go/artifactory.downloadCmd(0xc0820388c0)
/var/lib/jenkins/workspace/jfrog-cli-release/temp/src/github.com/jfrogde
v/jfrog-cli-go/artifactory/cli.go:352 +0x2f8
github.com/jfrogdev/jfrog-cli-go/artifactory.GetCommands.func3(0xc0820388c0)
/var/lib/jenkins/workspace/jfrog-cli-release/temp/src/github.com/jfrogde
v/jfrog-cli-go/artifactory/cli.go:40 +0x28
github.com/jfrogdev/jfrog-cli-go/vendor/github.com/codegangsta/cli.Command.Run(0
x9447d0, 0x8, 0x0, 0x0, 0xc082002f50, 0x1, 0x1, 0x93da50, 0xe, 0x0, ...)
/var/lib/jenkins/workspace/jfrog-cli-release/temp/src/github.com/jfrogde
v/jfrog-cli-go/vendor/github.com/codegangsta/cli/command.go:174 +0x13a0
github.com/jfrogdev/jfrog-cli-go/vendor/github.com/codegangsta/cli.(_App).RunAsS
ubcommand(0xc082038640, 0xc082038500, 0x0, 0x0)
/var/lib/jenkins/workspace/jfrog-cli-release/temp/src/github.com/jfrogde
v/jfrog-cli-go/vendor/github.com/codegangsta/cli/app.go:298 +0x11d0
github.com/jfrogdev/jfrog-cli-go/vendor/github.com/codegangsta/cli.Command.start
App(0x939520, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x982cc0, 0x14, 0x0, ...)
/var/lib/jenkins/workspace/jfrog-cli-release/temp/src/github.com/jfrogde
v/jfrog-cli-go/vendor/github.com/codegangsta/cli/command.go:249 +0x756
github.com/jfrogdev/jfrog-cli-go/vendor/github.com/codegangsta/cli.Command.Run(0
x939520, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x982cc0, 0x14, 0x0, ...)
/var/lib/jenkins/workspace/jfrog-cli-release/temp/src/github.com/jfrogde
v/jfrog-cli-go/vendor/github.com/codegangsta/cli/command.go:65 +0x80
github.com/jfrogdev/jfrog-cli-go/vendor/github.com/codegangsta/cli.(*App).Run(0x
c0820383c0, 0xc082006300, 0x6, 0x6, 0x0, 0x0)
/var/lib/jenkins/workspace/jfrog-cli-release/temp/src/github.com/jfrogde
v/jfrog-cli-go/vendor/github.com/codegangsta/cli/app.go:187 +0x1132
main.main()
/var/lib/jenkins/workspace/jfrog-cli-release/temp/src/github.com/jfrogde
v/jfrog-cli-go/jfrog/main.go:19 +0x112

the command:
jfrog.exe rt dl --url "http://lnzpc0663:8081/artifactory/" "gc-components/BrandResources/1.0.0.0/Keba/*"

Cannot use regexp for rt upload

Version: 1.8.0

command essential:
$ jfrog rt upload --spec=upload.spec

upload.spec

{
  "files": [
    {
      "pattern": ".*",
      "target": "local-repo/",
      "regexp" : "true"
    }
  ]
}

Result:

[Error] Path does not exist: .*

Seems jfrog try to get rootPath from pattern. I cannot find any document for regexp in spec file.

I would like to suggest to remove regexp support in pattern attribute. Instead, add new attribute, e.g. "filter", which is applied against resolved file set.

Feature Request: Support named instances of services so that multiple credentials can be configured

I've only used the CLI to interface with Artifactory, so I don't know if this would make sense for Bintray, MX, or XRay.

Currently in order to use stored credentials I have to rerun the config every time I switch between production and staging servers. While I can use command line arguments such as --url --user --api-key I'd rather have all my instances url/user/key in the config file, and a single --instance option that selects from them.

Forbidden response using rt search with api key

I've been experimenting with the CLI, but was unable to get artifactory search to work with the api key. I was trying:

bin/jfrog rt s --url https://my.artifactory --apikey abc123def releases/some/path/

However, this was returning a 403 Forbidden response.

I did some experimenting with the REST API, and found that when sending the equivalent HTTP request, I got a response Only non-anonymous users are allowed to access AQL queries. Sure enough, when I tried the user and password with the CLI, the query then worked as expected.

Having looked at the REST API docs, I suspect that the following is the correct fix:

diff --git a/utils/ioutils/ioutils.go b/utils/ioutils/ioutils.go
index fc1bffa..ccd8f90 100644
--- a/utils/ioutils/ioutils.go
+++ b/utils/ioutils/ioutils.go
@@ -556,7 +556,9 @@ func GetRemoteFileDetails(downloadUrl string, httpClientsDetails HttpClientDetai

 func setAuthentication(req *http.Request, httpClientsDetails HttpClientDetails) {
        //Set authentication
-   if httpClientsDetails.ApiKey != "" {
+ if httpClientsDetails.User != "" && httpClientsDetails.ApiKey != "" {
+         req.SetBasicAuth(httpClientsDetails.User, httpClientsDetails.ApiKey)
+ } else if httpClientsDetails.ApiKey != "" {
                req.Header.Set("X-JFrog-Art-Api", httpClientsDetails.ApiKey)
        } else if httpClientsDetails.User != "" && httpClientsDetails.Password != "" {
                req.SetBasicAuth(httpClientsDetails.User, httpClientsDetails.Password)

I have tested this locally, and it appears to work.

CLI parameter substitution for spec files

I have a case where I want to loop over path strings and run an AQL query with a spec file. At present I have tokenized spec file with tokens like @@path@@ and I'll have a sed command in my shell loop to copy the template spec file substituting the correct value for that loop iteration in place of the token and running the CLI command with the temp file. I'd like something like a --spec-template with accompanying --token argument. Ideally supporting multiple usage of --token in a single command, with the value using a format like : (since ':' is a necessary part of the spec file it's a good choice for an illegal character in a token name and therefore a good choice of character to separate token name and value on command line).

Downloading files with empty content

When I try to download file from artifactory using the following comamnd:

$ ./jfrog rt dl path/to/file/myfile.zip

I got the response like

Pinging Artifactory...
Done pinging Artifactory.
[Thread 0] : Artifactory response: 200 OK

But, the file is empty.

$ du -h path/to/file/myfile.zip
0 path/to/file/myfile.zip

And, I'm sure myfile.zip in the artifactory is not empty.

Post buildInfo from Jenkins with jfrog-cli

Hello. How i can post a buildInfo for deb-package from Jenkins build to Artifactory with jfrog-cli? Or its possibly only with hand-created json-file and post this file with curl to the server?

Add list and delete cli command options

Having the ability to list repositories and packages would be a big help, as would having the ability to delete packages. I'd like to request this as an enhancement.

Wrong download query is generated when placing wildcard at the end

for example jfrog rt dl releases/jfrog.com/test/server/server*
Generated the following query:
items.find({"repo": "releases","$or": [{"$and": [{"path": {"$match":"jfrog.com/test/server"},"name":{"$match":"server*"}}]},{"$and": [{"path": {"$match":"jfrog.com/test/serverserver"},"name":{"$match":"*"}}]}]})

Note the "serverserver"

jfrog rt delete with --quiet not working

I'm setting a cron job to automatically delete artifacts based on a spec, but I need to perform this operation without confirmation. Apparently the --quiet option is not working and it is apparently ignoring my spec...

I am using jfrog-cli 1.8.0

The following command will produce a list of artifacts to be deleted and in the end it asks for permission to delete the above paths:

$ jfrog rt delete --spec /usr/share/artifactory-curator/delete-aql.json

# list of artifacts starting here
(...)
Are you sure you want to delete the above paths? (y/n)

I've tried to use the --quiet to suppress the confirmation, but it is not working, it just displays the following message:

$ jfrog rt delete --quiet --spec /usr/share/artifactory-curator/delete-aql.json

[Info] Searching artifacts...
[Info] Found 0 artifacts.

Am I missing something here?
Thanks

Use patterns or AQL to delete

I have a repo in which I'm uploading expanded P2 software sites built with Maven/Tycho (ie not doing a 'mvn deploy' in the eclipse-repository project to publish the P2 site zip). The basic structure we have within the Artifactory repository is

/site/branch/buildNum

where site and branch are properties from the pom file and the buildNum folder has the format of YYYYMMDDhhmmss-commitId. I'm not aware of a Repository Layout I can define to facilitate automatic cleanup of entire buildNum folders like Maven artifact SNAPSHOT builds. So I'm looking at the jFrog CLI as an alternative to do manual cleanup. I would to be able to use an AQL expression to delete buildNum folders that are "older than X days but keep a minimum of Y instances". But I'd settle for a simple regex like "repo/site1/master/2016(07|080)*/" to delete all the folders under site1's master branch starting with 201607 or 2016080.

Repeated call of "rt config" leads to config corruption

Test case:

rm ~/.jfrog/jfrog-cli.conf;
for i in $(seq 1 10); do
    echo; echo "Step $i";
    jfrog -- rt config --interactive=false --enc-password=false --url=http://localhost:8081/artifactory --user=admin --password=password test-server;
    cat ~/.jfrog/jfrog-cli.conf;
done

Result:

Step 1
{
  "artifactory": [
    {
      "url": "http://localhost:8081/artifactory/",
      "user": "admin",
      "password": "password",
      "serverId": "test-server",
      "isDefault": true
    }
  ],
  "Version": "1"
}
Step 2
{
  "artifactory": [
    {
      "url": "http://localhost:8081/artifactory/",
      "user": "admin",
      "password": "password",
      "isDefault": true
    }
  ],
  "Version": "1"
}
Step 3
{
  "artifactory": [
    {
      "url": "http://localhost:8081/artifactory/",
      "user": "admin",
      "password": "password",
      "isDefault": true
    },
    {
      "url": "http://localhost:8081/artifactory/",
      "user": "admin",
      "password": "password",
      "serverId": "test-server"
    }
  ],
  "Version": "1"
}
Step 4
{
  "artifactory": [
    {
      "url": "http://localhost:8081/artifactory/",
      "user": "admin",
      "password": "password",
      "isDefault": true
    },
    {
      "url": "http://localhost:8081/artifactory/",
      "user": "admin",
      "password": "password"
    }
  ],
  "Version": "1"
}
Step 5
{
  "artifactory": [
    {
      "url": "http://localhost:8081/artifactory/",
      "user": "admin",
      "password": "password",
      "isDefault": true
    },
    {
      "url": "http://localhost:8081/artifactory/",
      "user": "admin",
      "password": "password"
    },
    {
      "url": "http://localhost:8081/artifactory/",
      "user": "admin",
      "password": "password",
      "serverId": "test-server"
    }
  ],
  "Version": "1"
}
Step 6
{
  "artifactory": [
    {
      "url": "http://localhost:8081/artifactory/",
      "user": "admin",
      "password": "password",
      "isDefault": true
    },
    {
      "url": "http://localhost:8081/artifactory/",
      "user": "admin",
      "password": "password"
    },
    {
      "url": "http://localhost:8081/artifactory/",
      "user": "admin",
      "password": "password"
    }
  ],
  "Version": "1"
}
Step 7
{
  "artifactory": [
    {
      "url": "http://localhost:8081/artifactory/",
      "user": "admin",
      "password": "password",
      "isDefault": true
    },
    {
      "url": "http://localhost:8081/artifactory/",
      "user": "admin",
      "password": "password"
    },
    {
      "url": "http://localhost:8081/artifactory/",
      "user": "admin",
      "password": "password"
    },
    {
      "url": "http://localhost:8081/artifactory/",
      "user": "admin",
      "password": "password",
      "serverId": "test-server"
    }
  ],
  "Version": "1"
}
Step 8
{
  "artifactory": [
    {
      "url": "http://localhost:8081/artifactory/",
      "user": "admin",
      "password": "password",
      "isDefault": true
    },
    {
      "url": "http://localhost:8081/artifactory/",
      "user": "admin",
      "password": "password"
    },
    {
      "url": "http://localhost:8081/artifactory/",
      "user": "admin",
      "password": "password"
    },
    {
      "url": "http://localhost:8081/artifactory/",
      "user": "admin",
      "password": "password"
    }
  ],
  "Version": "1"
}
Step 9
{
  "artifactory": [
    {
      "url": "http://localhost:8081/artifactory/",
      "user": "admin",
      "password": "password",
      "isDefault": true
    },
    {
      "url": "http://localhost:8081/artifactory/",
      "user": "admin",
      "password": "password"
    },
    {
      "url": "http://localhost:8081/artifactory/",
      "user": "admin",
      "password": "password"
    },
    {
      "url": "http://localhost:8081/artifactory/",
      "user": "admin",
      "password": "password"
    },
    {
      "url": "http://localhost:8081/artifactory/",
      "user": "admin",
      "password": "password",
      "serverId": "test-server"
    }
  ],
  "Version": "1"
}
Step 10
{
  "artifactory": [
    {
      "url": "http://localhost:8081/artifactory/",
      "user": "admin",
      "password": "password",
      "isDefault": true
    },
    {
      "url": "http://localhost:8081/artifactory/",
      "user": "admin",
      "password": "password"
    },
    {
      "url": "http://localhost:8081/artifactory/",
      "user": "admin",
      "password": "password"
    },
    {
      "url": "http://localhost:8081/artifactory/",
      "user": "admin",
      "password": "password"
    },
    {
      "url": "http://localhost:8081/artifactory/",
      "user": "admin",
      "password": "password"
    }
  ],
  "Version": "1"
}

capabilities to add symlinks to Artifactory

when try to upload a file to Artifactory using JFrog CLI jfrog rt u --flat=false "*" repo it should recognize if a file is a symlink having flag enabled for example jfrog rt u --flat=false --symlink=true "*" repo. In a case of symlink it should create an artifact with size 0 in Artifactory and add property symlink with a value of destination to symlink. It should do same when we are a downloading file from Artifactory using CLI. Check if artifact has property symlink then create symlink in destination directory.

Leading directories unwantedly preserved with copy/move

Am using CLI 1.5.0 with server 3.9.4. Probably easiest to illustrate with pictures.

Before:

leading-directories-before

Effectively I want test/base**#-sub#** to become test/base**#/sub#**, so I start with a copy

$ jfrog rt copy test-deploy-snapshots/test/base1-sub1/ test-deploy-snapshots/test/base1/sub1/
[Info:] Pinging Artifactory...
[Info:] Done pinging Artifactory.
[Info:] Searching Artifactory using AQL query: items.find({"repo": "test-deploy-snapshots","$or": [{"$and": [{"path": {"$match":"test/base1-sub1"},"name":{"$match":"*"}}]},{"$and": [{"path": {"$match":"test/base1-sub1/*"},"name":{"$match":"*"}}]}]}).include("name","repo","path","actual_md5","actual_sha1","size")
[Info:] Artifactory response: 200 OK
[Info:] Found 1 artifact.
[Info:] Copying artifact: test-deploy-snapshots/test/base1-sub1/file to test-deploy-snapshots/test/base1/sub1/test/base1-sub1/file
[Info:] Artifactory response: 200 OK
[Info:] Copied 1 artifacts in Artifactory

And as indicated in the Copying artifact line of the output, I end up like this

leading-directories-after

As circled in the after pic, the whole leading path is preserved under the to path.

CLI delete returns 'x509: certificate signed by unknown authority' when using self-signed certificate

Steps to reproduce:

  1. Import your self-signed certificate to ~/.jfrog/security/cert.pem
  2. Test file upload/download against a configured SSL-backed Artifactory server
  3. Try to remove a file using the 'del' command arguement:

$ jfrog rt del libs-release-local/org/test/artifact.jar

And you will get an error complaining about a self signed certificate being signed by an unknown authority:

[Info] Searching artifacts...
[Error] Post https://artifactory.art.local/artifactory/api/search/aql: x509: certificate signed by unknown authority_

Version: "jfrog version 1.7.1"

Provide a way to add System Variables to buildInfo

As of version 1.7.1, we have a command to capture environment variables:
jfrog rt bce frogger-build 17
Ideally, there should be also an option to import a json file with the desired content for the System Variables:
jfrog rt bcs --file my_system_variables.json frogger-build 17

Provide environment variables from file

I would like to be able to supply the environment variables from a json file. The reason for this is I'm building my binary and publishing it in different stages in my CI plan.
The environment I'm interested in capturing is from the machine where I compiled my binaries, not where I published them:
jfrog rt bce --file my_env.json frogger-build 17

Insecure credentials handling on Artifactory access

I noticed that jfrog-cli needs to give Artifactory username and password/API key as a command line parameter to handle Artifactory uploads/downloads. This is very insecure way to handle credentials on multi-user systems, as processes have their command line arguments visible in the process list that can be viewed, for example, with "ps aux" command. These command line options (--password, --apikey) should be replaced by something that does not leak credentials.

--props doesn't search correctly

When I try and use --props to filer which artifacts I want to delete, it generates an invalid search.

jfrog rt del foobar --props "size=781717698"  --dry-run

This generates a search, which returns no results

items.find({
  "repo": "foobar",
  "@size": {
    "$match": "781717698"
  },
  "$or": [{
    "$and": [{
      "path": {
        "$match": "*"
      },
      "name": {
        "$match": "*"
      }
    }]
  }]
}).include("name", "repo", "path", "actual_md5", "actual_sha1", "size")

The search that I expect to be run:

items.find(
  {
      "repo":"foobar",
      "size": "781717698"
  }
)

Is this a bug in the way --props works? or am I misinterpreting the documentation?

https://www.jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory#CLIforJFrogArtifactory-DeletingFiles

CLI crashes on URLs with special characters

If the URL has special characters like %, #, $, CLI crashes with error invalid URL escape for either download or upload.

As per RTFACT-9569,

When trying to upload a file which has the name 'Test1%2.txt':

jfrog rt u Test1%2.txt libs-release-local --url=http://localhost:8081/artifactory --user=admin --password=password
[Thread 0] Uploading artifact: http://localhost:8081/artifactory/libs-release-local/Test1%2.txt
panic: parse http://localhost:8081/artifactory/libs-release-local/Test1%2.txt: invalid URL escape "%2."
goroutine 5 [running]:
github.com/jfrogdev/jfrog-cli-go/cliutils.CheckError(0x8820916b50, 0x8207757d0)
/home/travis/gopath/src/github.com/JFrogDev/jfrog-cli-go/Godeps/_workspace/src/github.com/jfrogdev/jfrog-cli-go/cliutils/utils.go:26 +0x4b
github.com/jfrogdev/jfrog-cli-go/cliutils.UploadFile(0x820792038, 0x820772b40, 0x40, 0x820771530, 0x5, 0x820771550, 0x8, 0x8207757a0, 0x0)
/home/travis/gopath/src/github.com/JFrogDev/jfrog-cli-go/Godeps/_workspace/src/github.com/jfrogdev/jfrog-cli-go/cliutils/ioutils.go:180 +0x148
github.com/jfrogdev/jfrog-cli-go/artifactory/utils.UploadFile(0x820792038, 0x820772b40, 0x40, 0x820777270, 0x820775680, 0x0)
/home/travis/gopath/src/github.com/JFrogDev/jfrog-cli-go/Godeps/_workspace/src/github.com/jfrogdev/jfrog-cli-go/artifactory/utils/artifactoryutils.go:26 +0x1f6
github.com/jfrogdev/jfrog-cli-go/artifactory/commands.uploadFile(0x7fff5fbffb4d, 0xb, 0x820772b40, 0x40, 0x82077c180, 0x8207716b0, 0xa, 0x0)
/home/travis/gopath/src/github.com/JFrogDev/jfrog-cli-go/Godeps/_workspace/src/github.com/jfrogdev/jfrog-cli-go/artifactory/commands/upload.go:141 +0x485
github.com/jfrogdev/jfrog-cli-go/artifactory/commands.Upload.func1(0x82077c180, 0x1, 0x82076f3e0, 0x1, 0x1, 0x82076f400, 0x3, 0x3, 0x820771670, 0x0)
/home/travis/gopath/src/github.com/JFrogDev/jfrog-cli-go/Godeps/_workspace/src/github.com/jfrogdev/jfrog-cli-go/artifactory/commands/upload.go:38 +0x13d
created by github.com/jfrogdev/jfrog-cli-go/artifactory/commands.Upload
/home/travis/gopath/src/github.com/JFrogDev/jfrog-cli-go/Godeps/_workspace/src/github.com/jfrogdev/jfrog-cli-go/artifactory/commands/upload.go:43 +0x1e3

Codesign Windows Binaries

Hi,

I was wondering if it would be possible to code-sign (Authenticode) the official Windows binaries distributed via Bintray and here.

If not, maybe you could at least provide some checksums for the official binaries? That would be great.

Cheers!

"bt upload --publish" gets 405 but "bt upload; bt publish" works

This fails:

$ jfrog bt upload --publish --deb xenial/stable/amd64 /tmp/libtangort-dmd-dev_1.6.1-xenial_amd64.deb sociomantic-tsunami/dlang/tangort/v1.6.1 
[Info] Verifying repository tmp exists...
[Info] Verifying package libtangort-dmd-dev_1.6.1-xenial_amd64.deb exists...
[Error] Bintray response: 405 Not Allowed

But this works:

$ jfrog bt upload --deb xenial/stable/amd64 /tmp/libtangort-dmd-dev_1.6.1-xenial_amd64.deb sociomantic-tsunami/dlang/tangort/v1.6.1 
[Info] Verifying repository dlang exists...
[Info] Verifying package tangort exists...
[Info] Verifying version v1.6.1 exists...
[Info] [Thread 0] Uploading artifact: /tmp/libtangort-dmd-dev_1.6.1-xenial_amd64.deb
[Info] Uploaded 1 artifacts.

$ jfrog bt version-publish sociomantic-tsunami/dlang/tangort/v1.6.1
[Info] Publishing version...
[Info] Published version v1.6.1, details:
{
  "files": 2
}

Am I doing something wrong?

Download command outputs partial threading output with log level error

I expected a successful download to have no output when setting env variable JFROG_CLI_LOG_LEVEL=ERROR. However some, but not all, of the threading output is still printed.

Normal log level stripping threading output with grep

$ jfrog rt dl p2-lgc/dsg/thirdparty/master/10.5.4-Drop00/ --flat=false | grep -v Thread
[Info:] Searching Artifactory using AQL query: items.find({"repo": "p2-lgc","$or": [{"$and": [{"path": {"$match":"dsg/thirdparty/master/10.5.4-Drop00"},"name":{"$match":"*"}}]},{"$and": [{"path": {"$match":"dsg/thirdparty/master/10.5.4-Drop00/*"},"name":{"$match":"*"}}]}]}).include("name","repo","path","actual_md5","actual_sha1","size")
[Info:] Artifactory response: 200 OK
[Info:] Found 345 artifacts.
[Info:] Downloaded 345 artifacts from Artifactory.

ERROR output with no grep filtering

$ JFROG_CLI_LOG_LEVEL=ERROR jfrog rt dl p2-lgc/dsg/thirdparty/master/10.5.4-Drop00/ --flat=false
[Thread 2] [2]: 206 Partial Content...                                                          
[Thread 2] [1]: 206 Partial Content...                                                          
[Thread 2] [0]: 206 Partial Content...                                                          
[Thread 0] [1]: 206 Partial Content...                                                          
[Thread 0] [2]: 206 Partial Content...                                                          
[Thread 0] [0]: 206 Partial Content...                                                          
[Thread 1] [2]: 206 Partial Content...                                                          
[Thread 1] [1]: 206 Partial Content...                                                          
[Thread 1] [0]: 206 Partial Content...                                                          
[Thread 1] Done downloading.                                                                    
[Thread 1] [2]: 206 Partial Content...                                                          
[Thread 1] [1]: 206 Partial Content...                                                          
[Thread 1] [0]: 206 Partial Content...                                                          
[Thread 1] Done downloading.                                                                    
[Thread 1] [1]: 206 Partial Content...                                                          
[Thread 1] [0]: 206 Partial Content...                                                          
[Thread 1] [2]: 206 Partial Content...                                                          
[Thread 1] Done downloading.                                                                    
[Thread 1] [0]: 206 Partial Content...                                                          
[Thread 1] [2]: 206 Partial Content...                                                          
[Thread 1] [1]: 206 Partial Content...                                                          
[Thread 1] Done downloading.                                                                    
[Thread 0] Done downloading.                                                                    
[Thread 2] Done downloading.                                                                    
[Thread 1] [0]: 206 Partial Content...                                                          
[Thread 1] [2]: 206 Partial Content...                                                          
[Thread 1] [1]: 206 Partial Content...                                                          
[Thread 1] Done downloading.                                                                    
[Thread 2] [2]: 206 Partial Content...                                                          
[Thread 2] [0]: 206 Partial Content...                                                          
[Thread 2] [1]: 206 Partial Content...                                                          
[Thread 1] [0]: 206 Partial Content...                                                          
[Thread 1] [2]: 206 Partial Content...                                                          
[Thread 1] [1]: 206 Partial Content...                                                          
[Thread 1] Done downloading.                                                                    
[Thread 1] [0]: 206 Partial Content...                                                          
[Thread 1] [2]: 206 Partial Content...                                                          
[Thread 1] [1]: 206 Partial Content...                                                          
[Thread 0] [0]: 206 Partial Content...                                                          
[Thread 0] [2]: 206 Partial Content...                                                          
[Thread 0] [1]: 206 Partial Content...                                                          
[Thread 2] Done downloading.                                                                    
[Thread 0] Done downloading.                                                                    
[Thread 0] [0]: 206 Partial Content...                                                          
[Thread 0] [2]: 206 Partial Content...                                                          
[Thread 0] [1]: 206 Partial Content...                                                          
[Thread 0] Done downloading.                                                                    
[Thread 0] [1]: 206 Partial Content...                                                          
[Thread 0] [0]: 206 Partial Content...                                                          
[Thread 0] [2]: 206 Partial Content...                                                          
[Thread 1] Done downloading.                                                                    
[Thread 0] Done downloading.                                                                    
[Thread 2] [2]: 206 Partial Content...
[Thread 2] [1]: 206 Partial Content...
[Thread 2] [0]: 206 Partial Content...
[Thread 0] [1]: 206 Partial Content...
[Thread 0] [2]: 206 Partial Content...
[Thread 0] [0]: 206 Partial Content...
[Thread 1] [2]: 206 Partial Content...
[Thread 1] [1]: 206 Partial Content...
[Thread 1] [0]: 206 Partial Content...
[Thread 2] Done downloading.
[Thread 2] [0]: 206 Partial Content...
[Thread 2] [1]: 206 Partial Content...
[Thread 2] [2]: 206 Partial Content...
[Thread 1] Done downloading.
[Thread 2] Done downloading.
[Thread 1] [1]: 206 Partial Content...
[Thread 1] [2]: 206 Partial Content...
[Thread 1] [0]: 206 Partial Content...
[Thread 0] Done downloading.
[Thread 0] [0]: 206 Partial Content...
[Thread 0] [1]: 206 Partial Content...
[Thread 0] [2]: 206 Partial Content...
[Thread 1] Done downloading.
[Thread 0] Done downloading.
[Thread 2] [2]: 206 Partial Content...
[Thread 2] [0]: 206 Partial Content...
[Thread 2] [1]: 206 Partial Content...
[Thread 1] [2]: 206 Partial Content...
[Thread 1] [0]: 206 Partial Content...
[Thread 1] [1]: 206 Partial Content...
[Thread 2] Done downloading.
[Thread 1] Done downloading.
[Thread 0] [2]: 206 Partial Content...
[Thread 0] [1]: 206 Partial Content...
[Thread 0] [0]: 206 Partial Content...
[Thread 1] [0]: 206 Partial Content...
[Thread 1] [1]: 206 Partial Content...
[Thread 1] [2]: 206 Partial Content...
[Thread 1] Done downloading.
[Thread 0] Done downloading.

jfrog bt: indicate which version is published/unpublished

Currently, the web interface shows whether there are unpublished package versions that require manual publishing (see: https://bintray.com/docs/usermanual/uploads/uploads_managinguploadedcontent.html#_publishing)

From the CLI (version 1.4.1), it seems that there is no way to determine this information.
That is, I would expect that either jfrog bt ps or jfrog bt vs would somehow include a field in the JSon result indicating whether a particular version is published or not.

The JSon I get from published vs. unpublished package versions is structurally equivalent.
I suggest adding a field in the JSon result specifically for this information.

wrong property conversion

Hey,

thanks for this great client. but i'Ve some problems while uploading svg images

jfrog rt upload --flat=false --props "artifactory.content-type=image/svg+xml" "images/*.svg" $DESTINATION_REPO

but these resources will have the wrong value: "image/svg xml" for the key: "artifactory.content-type"

i've tried to encode or escape the "+" character --> but without any success.

Incomplete help for 'rt config'

I downloaded the latest jfrog and the jfrog rt config --help output does not reflect the 'server-id' parameter that now appears to be required.

$ ./jfrog rt config --help
NAME:
   jfrog rt config - Configure Artifactory details.

USAGE:
   jfrog rt config [command options] [arguments...]

OPTIONS:
   --interactive 	[Default: true] Set to false if you do not want the config command to be interactive. If true, the --url option becomes optional.
   --enc-password 	[Default: true] If set to false then the configured password will not be encrypted using Artifatory's encryption API.
   --url 		[Optional] Artifactory URL.
   --user 		[Optional] Artifactory username.
   --password 		[Optional] Artifactory password.
   --apikey 		[Optional] Artifactory API key.
   --ssh-key-path 	[Optional] SSH key file path.

$./jfrog -v
jfrog version 1.8.0

I see the new parameter here:
https://github.com/JFrogDev/jfrog-cli-go/blob/356aefb5fa6a9b64cbbeb9476a6ee89eab1fe063/artifactory/cli.go#L170

I don't know enough Go to make a valid PR.

CLI should support argument for specifying config file

At the moment, jfrog cli assumes the config file is located in ~/.jfrog/jfrog-cli.conf. We'd like to use this tool in our build system, but we need to be able to specify where the config file is. I don't see a way to do that. It appeared that setting $HOME may do it, but upon testing, it failed.

Download fails through virtual repo

I have a virtual repo to aggregate Maven Central and our internal Maven artifacts. There is a settings.xml deployed in a local repo that is included in the virtual repo. Downloading the settings.xml with jfrog-cli finds no artifacts using the virtual repo, but succeeds using the actual repo. Downloading from the virtual repo with curl works fine.

C:\Users\jgeorgeson\Downloads
> jfrog rt download maven-virtual/settings.xml
Pinging Artifactory...
Searching Artifactory using AQL query: items.find({"repo": "maven-virtual","$or": [{"$and": [{"path": {"$match":"*"},"name":{"$match":"settings.xml"}}]}]})
Artifactory response: 200 OK
Downloaded 0 artifacts from Artifactory.

C:\Users\jgeorgeson\Downloads
> jfrog rt download maven-local/settings.xml
Pinging Artifactory...
Searching Artifactory using AQL query: items.find({"repo": "maven-local","$or": [{"$and": [{"path": {"$match":"*"},"name":{"$match":"settings.xml"}}]}]})
Artifactory response: 200 OK
[Thread 0] Downloading http://artprod.example.com/artifactory/maven-local/settings.xml
[Thread 0] Artifactory response: 200 OK
Downloaded 1 artifacts from Artifactory.

C:\Users\jgeorgeson\Downloads
> curl -u jgeorgeson http://artprod.example.com/artifactory/maven-virtual/settings.xml -o settings2.xml
Enter host password for user 'jgeorgeson':
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3831  100  3831    0     0  40755      0 --:--:-- --:--:-- --:--:-- 81510

C:\Users\jgeorgeson\Downloads
> fc settings.xml settings2.xml
Comparing files settings.xml and SETTINGS2.XML
FC: no differences encountered


C:\Users\jgeorgeson\Downloads
>

Support option to prune empty directories during recursive delete

I much prefer the CLI tool over using straight REST requests, on account of the support for wildcard paths. When I do something like this

jfrog rt del --recursive=true repo1/*/path1/

My intent would be to have the same result as having run

curl -X DEL http://art.example.com/artifactory/repo1/.../path1

for all existing ... directories. Instead all the repo1/*/path1/ folder structures are left in place, with only the files having been deleted. I think a --prune option would be good to combine with --recursive=true

jfrog bt logs points to the wrong docs

Running jfrog bt logs sends you to the git repo README.md, which tells you how to build the CLI.

./jfrog bt logs 
[Error:] Wrong number of arguments. You can read the documentation at https://github.com/jfrogdev/jfrog-cli-go/blob/master/README.md

It probably should send you here:
https://www.jfrog.com/confluence/display/CLI/Welcome+to+JFrog+CLI

Or since it was jfrog bt I was passing the wrong information to:
https://www.jfrog.com/confluence/display/CLI/CLI+for+JFrog+Bintray

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.