无法使用JFrog CLI登录。

huangapple go评论103阅读模式
英文:

Not able to login using JFrog CLI

问题

我正在编写一个命令,以使用JFrog命令行界面在JFrog URL上进行登录。

JFrog文档说明我们需要在机器上进行登录并保存凭据在机器上:

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

但我不确定在执行脚本时会在哪个代理上运行,我无法在每个代理上都进行登录。

因此,我尝试创建一个命令,其中包含用户名和密码以及JFrog URL:

jfrog auth login --user=<username> --password=<password> --url=<jfrog_url>

但在终端中它不起作用,显示以下错误:

jf auth is not a valid command
英文:

I am writing a command to do login in JFrog URL using the 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 command having username and password as well as the JFrog URL

jfrog auth login --user=&lt;username&gt; --password=&lt;password&gt; --url=&lt;jfrog_url&gt;

but the same is not working in the terminal, it is saying

> jf auth is not a valid command

答案1

得分: 2

jf c add 是我们在任何客户端上使用的命令,用于与Artifactory进行工作。
例如,它可以是开发机器或任何其他机器。

如果我们想要通过JFrog CLI与Artifactory一起工作,有两种方法。

  1. 通过使用JFrog CLI配置平台服务器并注册它来配置。(我相信您对此已经很了解,并且已经在这样做了)

jf c add(添加服务器配置)

  1. 选择服务器ID:myartifactory
  2. JFrog平台URL:http://myartifactory.jfrog.io/
  3. JFrog用户名:myuser
  4. JFrog密码或API密钥:XXXXXX
  5. Artifactory反向代理是否配置为接受客户端证书?(y/n)[n]? n

通过这种方式,我们可以配置并在所有后续操作中使用相同的服务器ID。

  1. 另一种选择是将凭据和URL传递给我们使用的命令,例如,上传/下载一个构件。

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

请访问此页面获取更多详细信息。
JFrog CLI

英文:

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 &quot;testfile.txt&quot; &quot;generic-local/path1/subpath/&quot; --url=&quot;https://myartifactory.jfrog.io/artifactory&quot; --user=&quot;youruser&quot; --password=&quot;yourpassword&quot;

Please visit this page for addition details.
JFrog CLI

huangapple
  • 本文由 发表于 2023年6月22日 02:20:24
  • 转载请务必保留本文链接:https://go.coder-hub.com/76526119.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定