# jfrog-cli **Repository Path**: donhui/jfrog-cli ## Basic Information - **Project Name**: jfrog-cli - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: dev - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-01-19 - **Last Updated**: 2022-01-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README | Branch | Status | | :----: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | | v2 | [![JFrog CLI Tests](https://github.com/jfrog/jfrog-cli/actions/workflows/tests.yml/badge.svg?branch=v2)](https://github.com/jfrog/jfrog-cli/actions/workflows/tests.yml) | | dev | [![JFrog CLI Tests](https://github.com/jfrog/jfrog-cli/actions/workflows/tests.yml/badge.svg?branch=dev)](https://github.com/jfrog/jfrog-cli/actions/workflows/tests.yml) | | v1 | [![JFrog CLI Tests](https://github.com/jfrog/jfrog-cli/actions/workflows/tests.yml/badge.svg?branch=v1)](https://github.com/jfrog/jfrog-cli/actions/workflows/tests.yml) | | dev-v1 | [![JFrog CLI Tests](https://github.com/jfrog/jfrog-cli/actions/workflows/tests.yml/badge.svg?branch=dev-v1)](https://github.com/jfrog/jfrog-cli/actions/workflows/tests.yml) | # Table of Contents - [Overview](#overview) - [Download and Installation](#download-and-installation) - [Building the Executable](#building-the-executable) - [Tests](#tests) - [Code Contributions](#code-contributions) - [Using JFrog CLI](#using-jfrog-cli) - [JFrog CLI Plugins](#jfrog-cli-plugins) - [Release Notes](#release-notes) # 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: - Multi-threaded 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](https://jfrog.com/getcli/) for details. # Building the Executable JFrog CLI is written in the [Go programming language](https://golang.org/), so to build the CLI yourself, you first need to have Go installed and configured on your machine. ## Install Go To download and install `Go`, please refer to the [Go documentation](https://golang.org/doc/install). Please download `Go 1.14.x` or above. ## Download and Build the CLI 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. # Tests ### Usage ``` 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 | - Running the tests will create builds and repositories with timestamps, for example: `cli-rt1-1592990748` and `cli-rt2-1592990748`.
Once the tests are completed, the content of these repositories will be deleted. #### Artifactory tests In addition to [general optional flags](#Usage) 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. | ##### Examples To run artifactory tests execute the following command. ``` go test -v github.com/jfrog/jfrog-cli -test.artifactory [flags] ``` #### Npm tests ##### Requirements - The _npm_ executables should be included as part of the _PATH_ environment variable. - The tests are compatible with npm 7 and higher. ##### Limitation - Currently, npm integration support only http(s) connections to Artifactory using username and password. ##### Examples To run npm tests execute the following command. ``` go test -v github.com/jfrog/jfrog-cli -test.npm [flags] ``` #### Maven tests ##### Requirements - The _java_ executable should be included as part of the _PATH_ environment variable. Alternatively, set the _JAVA_HOME_ environment variable. ##### Limitation - Currently, maven integration support only http(s) connections to Artifactory using username and password. ##### Examples To run maven tests execute the following command. ``` go test -v github.com/jfrog/jfrog-cli -test.maven [flags] ``` #### Gradle tests ##### Requirements - The _gradle_ executables should be included as part of the _PATH_ environment variable. - The _java_ executable should be included as part of the _PATH_ environment variable. Alternatively, set the _JAVA_HOME_ environment variable. ##### Limitation - Currently, gradle integration support only http(s) connections to Artifactory using username and password. ##### Examples To run gradle tests execute the following command. ``` go test -v github.com/jfrog/jfrog-cli -test.gradle [flags] ``` #### Docker tests In addition to [general optional flags](#Usage) you _must_ use the following docker flags. ##### Requirements - On Linux machines, [Podman](https://podman.io/) tests will be running, so make sure it's available in the local path. | 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. | ##### Examples 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 commands tests ##### Requirement - The tests are compatible with Artifactory 6.10 and higher. - To run go tests run the following command: ``` go test -v github.com/jfrog/jfrog-cli -test.go [flags] ``` #### NuGet tests ##### Requirement - Add NuGet executable to the system search path (PATH environment variable). - Run the following command: ``` go test -v github.com/jfrog/jfrog-cli -test.nuget [flags] ``` #### Pip tests ##### Requirement - Add Python and pip executables to the system search path (PATH environment variable). - Run the following command: ``` go test -v github.com/jfrog/jfrog-cli -test.pip [flags] ``` #### Plugins tests To run Plugins tests execute the following command: ``` go test -v github.com/jfrog/jfrog-cli -test.plugins ``` ### Distribution tests To run Distribution tests execute the following command: ``` go test -v github.com/jfrog/jfrog-cli -test.distribution [flags] ``` ### Xray tests To run Xray tests execute the following command: ``` go test -v github.com/jfrog/jfrog-cli -test.xray [flags] ``` # Code Contributions We welcome code contributions through pull requests from the community. ## Pull Requests Guidelines - If the existing tests do not already cover your changes, please add tests.. - Pull requests should be created on the _dev_ branch. - Please use [gofmt](https://golang.org/cmd/gofmt/) for formatting the code before submitting the pull request. # 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](https://www.jfrog.com/confluence/display/CLI/Welcome+to+JFrog+CLI). # 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](https://github.com/jfrog/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](guides/jfrog-cli-plugins-developer-guide.md). # Release Notes The release notes are available [here](RELEASE.md#release-notes).