1

I am writing a command to do login in jfrog url using jfrog command line interface

Jfrog document states that we need to do the login in the machine and need to save the credentials in the machine

https://jfrog.com/help/r/jfrog-cli/authenticating-with-username-and-password/api-key

but I am not sure that while executing the script it will run on which agent - and it is not possible for me to do the login on every agent

So, I have tried to create a comand having username and password as well as the jfrog url ** jfrog auth login --user= --password= --url=<jfrog_url> ** but the same is not working in the terminal, it is saying jf auth is not a valid command

1 Answers1

2

jf c add is the command that we use on any client where we wanted to work with Artifactory. For example, it can be a development machine or any other machine.

If we want to work with Artifactory via JFrog CLI, there are two ways.

  1. By configuring Platform server using JFrog CLI and registering it. (I believe you must be aware of it and you must be doing this already)

jf c add (Adds a server configuration)

  1. choose a server ID: myartifactory
  2. JFrog Platform URL: http://myartifactory.jfrog.io/
  3. JFrog username: myuser
  4. JFrog password or API key: XXXXXX
  5. Is the Artifactory reverse proxy configured to accept a client certificate? (y/n) [n]? n

This way we can configure and use the same server id for all the next operations.

  1. The other option is, to pass the credentials, url to the command that we use. For example, to upload/download an artifact.

jf rt u "testfile.txt" "generic-local/path1/subpath/" --url="https://myartifactory.jfrog.io/artifactory" --user="youruser" --password="yourpassword"

Please visit this page for addition details. JFrog CLI

Sanjay C
  • 21
  • 2