JFrog CLI 客户端的使用
# 下载工具
官方下载链接 : https://jfrog.com/getcli/
# 安装配置
执行安装客户端命令
echo "[jfrog-cli]" > jfrog-cli.repo &&
echo "name=jfrog-cli" >> jfrog-cli.repo &&
echo "baseurl=https://releases.jfrog.io/artifactory/jfrog-rpms" >> jfrog-cli.repo &&
echo "enabled=1" >> jfrog-cli.repo &&
rpm --import https://releases.jfrog.io/artifactory/jfrog-gpg-public/jfrog_public_gpg.key &&
sudo mv jfrog-cli.repo /etc/yum.repos.d/ &&
yum install -y jfrog-cli-v2-jf &&
jf intro
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
下载完成命令行之后,放置在系统$PATH下测试执行,成功后返回结果。
jf --version
1
配置Cli与Artifactory链接
jf rt ping
1
[root@localhost ~]# jf rt ping
To avoid this message in the future, set the CI environment variable to true.
The CLI commands require the URL and authentication details
Configuring JFrog CLI with these parameters now will save you having to include them as command options.
You can also configure these parameters later using the 'jfrog c' command.
Configure now? (y/n) [n]? y
Enter a unique server identifier: jf
JFrog Platform URL: http://192.168.153.102:18080/
JFrog username: admin
JFrog password or API key:
Is the Artifactory reverse proxy configured to accept a client certificate? (y/n) [n]?
Your JFrog URL uses an insecure HTTP connection, instead of HTTPS. Are you sure you want to continue? (y/n) [n]? y
OK
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
查看配置
jf c show
1
上传文件
[root@localhost ~]# jf rt u anaconda-ks.cfg local-aa/
15:25:00 [[34mInfo] Log path: /root/.jfrog/logs/jfrog-cli.2024-03-23.15-25-00.1078866.log
15:25:00 [[34mInfo] These files were uploaded:
local-aa
└── anaconda-ks.cfg
{
"status": "success",
"totals": {
"success": 1,
"failure": 0
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
登录 jfrog 系统,查看刚才上传的制品包
jf命令下载文件
[root@localhost ~]# jf rt download local-aa/1.0.1.tar.gz
15:35:00 [[34mInfo] Log path: /root/.jfrog/logs/jfrog-cli.2024-03-23.15-35-00.1082768.log
{
"status": "success",
"totals": {
"success": 1,
"failure": 0
}
}
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
上次更新: 2024/04/10, 17:39:32