英文:
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=<username> --password=<password> --url=<jfrog_url>
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一起工作,有两种方法。
- 通过使用JFrog CLI配置平台服务器并注册它来配置。(我相信您对此已经很了解,并且已经在这样做了)
jf c add
(添加服务器配置)
- 选择服务器ID:myartifactory
- JFrog平台URL:http://myartifactory.jfrog.io/
- JFrog用户名:myuser
- JFrog密码或API密钥:XXXXXX
- Artifactory反向代理是否配置为接受客户端证书?(y/n)[n]? n
通过这种方式,我们可以配置并在所有后续操作中使用相同的服务器ID。
- 另一种选择是将凭据和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.
- 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)
- choose a server ID: myartifactory
- JFrog Platform URL: http://myartifactory.jfrog.io/
- JFrog username: myuser
- JFrog password or API key: XXXXXX
- 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.
- 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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论