0

I am trying to use jfrog action for github: https://github.com/marketplace/actions/setup-jfrog-cli

This action allows to configure jfrog. I am using it to upload and download artifacts from repo.

The way I use it is:

- run: jf rt dl path_to_file --user=<usr_name> --password=${{ secrets.<secret_id> }} --url=<url>

It works fine. But I do not want to specify my username, password and url each time I call jf. I found command jf c add which should configure global settings. However, I did not find any examples of how to use it. I have tried:

- run: jf c add --user=<usr_name> --password=${{ secrets.<secret_id> }} --url=<url>

But it did not work.

Also tried: Jfrog CLI does not respect configured API key

But it gives an error: 'jf rt config' is not a jf command. See --help

Can someone please explain me how to configure global settings using jf c add? Is it even possible?

Note: I am executing all commands on github actions yaml file.

TylerH
  • 20,799
  • 66
  • 75
  • 101
Farrukh Nabiyev
  • 346
  • 2
  • 11

2 Answers2

2

You can try and follow JFrog's CLI documentation for adding global configuration.

Please note that JFrog's CLI does allow using basic authentication (and also API Key that replaces the password), but it is not part of the default behavior.

In order to use basic authentication with API Key you can use the following command:

jf c add <SERVER_ID> --basic-auth-only --url <"JFROG_PLATFORM_URL"> --user <userName> --password <"API_KEY">

For example:

jf c add test --basic-auth-only --url "http://myArtifactoryURL:8082" --user yonatanb --password "AKCp8m........."
TylerH
  • 20,799
  • 66
  • 75
  • 101
Yonatan Brand
  • 781
  • 3
  • 11
-1

Follow the Storing JFrog Connection Details as Secrets section in the action's overview.

It provides clear instructions and examples on the recommended way to use authentication with the action.

Prostagma
  • 1,756
  • 9
  • 21
  • Hi, I have seen the instructions, but they do not have example of using jf c add command. It is more about how to use secrets AFTER you use jf c add, but no example of the command itself. – Farrukh Nabiyev Apr 28 '22 at 05:03
  • As described in the instructions, you should run the `jf c add` command on your **local** machine. This is a intuitive interactive command. If you encounter any problems go a head and update your question with the updated issues – Prostagma May 02 '22 at 07:41