Branch | Status |
---|---|
v2 | |
dev | |
v1 | |
dev-v1 |
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:
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.
JFrog CLI is written in the Go programming language, so to build the CLI yourself, you first need to have Go installed and configured on your machine.
To download and install Go
, please refer to the Go documentation.
Please download Go 1.14.x
or above.
Navigate to a directory where you want to create the jfrog-cli project, outside the $GOPATH
tree.
If the GOPATH
variable is unset, it's default value is the go folder under the user home.
Verify that the GO111MODULE
variable is either unset, or explicitly set to auto
.
Clone the jfrog-cli project by executing the following command:
git clone https://github.com/jfrog/jfrog-cli
Build the project by navigating to the jfrog folder and executing the following commands. On Unix based systems run:
cd jfrog-cli
build/build.sh
On Windows run:
cd jfrog-cli
build\build.bat
Once completed, you will find the JFrog CLI executable at your current directory.
go test -v github.com/jfrog/jfrog-cli [test-types] [flags]
The flags are:
Flag | Description |
---|---|
-jfrog.url |
[Default: http://localhost:8081] JFrog platform URL. |
-jfrog.user |
[Default: admin] JFrog platform username. |
-jfrog.password |
[Default: password] JFrog platform password. |
-jfrog.adminToken |
JFrog platform admin token. |
-ci.runId |
[Optional] A unique identifier used as a suffix to create repositories and builds in the tests. |
The types are:
Type | Description |
---|---|
-test.artifactory |
Artifactory tests |
-test.npm |
Npm tests |
-test.maven |
Maven tests |
-test.gradle |
Gradle tests |
-test.docker |
Docker tests |
-test.go |
Go tests |
-test.pip |
Pip tests |
-test.pipenv |
Pipenv tests |
-test.nuget |
Nuget tests |
-test.plugins |
Plugins tests |
-test.distribution |
Distribution tests |
-test.xray |
Xray tests |
cli-rt1-1592990748
and cli-rt2-1592990748
.In addition to general optional flags you can use the following optional artifactory flags.
Flag | Description |
---|---|
-jfrog.sshKeyPath |
[Optional] Ssh key file path. Should be used only if the Artifactory URL format is ssh://[domain]:port. |
-jfrog.sshPassphrase |
[Optional] Ssh key passphrase. |
To run artifactory tests execute the following command.
go test -v github.com/jfrog/jfrog-cli -test.artifactory [flags]
To run npm tests execute the following command.
go test -v github.com/jfrog/jfrog-cli -test.npm [flags]
To run maven tests execute the following command.
go test -v github.com/jfrog/jfrog-cli -test.maven [flags]
To run gradle tests execute the following command.
go test -v github.com/jfrog/jfrog-cli -test.gradle [flags]
In addition to general optional flags you must use the following docker flags.
Flag | Description |
---|---|
-rt.dockerRepoDomain |
Artifactory Docker registry domain. |
-rt.dockerVirtualRepo |
Artifactory Docker virtual repository name. |
-rt.dockerRemoteRepo |
Artifactory Docker remote repository name. |
-rt.dockerLocalRepo |
Artifactory Docker local repository name. |
-rt.dockerPromoteLocalRepo |
Artifactory Docker local repository name - Used for promotion. |
To run docker tests execute the following command (fill out the missing parameters as described below).
go test -v github.com/jfrog/jfrog-cli -test.docker -rt.dockerRepoDomain=DOCKER_DOMAIN -rt.DockerLocalRepo=DOCKER_LOCAL_REPO [flags]
go test -v github.com/jfrog/jfrog-cli -test.go [flags]
go test -v github.com/jfrog/jfrog-cli -test.nuget [flags]
go test -v github.com/jfrog/jfrog-cli -test.pip [flags]
To run Plugins tests execute the following command:
go test -v github.com/jfrog/jfrog-cli -test.plugins
To run Distribution tests execute the following command:
go test -v github.com/jfrog/jfrog-cli -test.distribution [flags]
To run Xray tests execute the following command:
go test -v github.com/jfrog/jfrog-cli -test.xray [flags]
We welcome code contributions through pull requests from the community.
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 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 publically with the rest of the community. Read more about this in the JFrog CLI Plugin Developer Guide.
The release notes are available here.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。