Jfrog CLI action global config

6k Views Asked by At

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.

2

There are 2 best solutions below

0
On BEST ANSWER

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........."
2
On

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.