什么是 Artifactory
Artifactory 是 JFrog 的一个产品,用作二进制存储库管理器。二进制存储库可以将所有这些二进制统一托管,从而使团队的管理更加高效和简单。
就跟你用 Git 一样,Git 是用来管理代码的,Artifactory 是用来管理二进制文件的,通常是指 jar, war, pypi, DLL, EXE 等 build 文件。
我觉得使用 Artifactory 的最大优势是创造了更好的持续集成环境,有助于其他持续集成任务去 Artifactory 里调用,再部署到不同的测试或开发环境,这对于实施 DevOps 至关重要。
安装 Artifactory
- 从官网下载 Open Source Artifactory,这里我是安装到 Linux,所以点击 下载的是 RPM 包。
- 将下载好的 jfrog-artifactory-oss-6.14.0.rpm 上传到 Linux 上
# 创建一个文件夹,你也可以在其他位置目录创建
sudo mkdir /artifactory
cd /artifactory
# 这是下载好的 rpm 包文件
$ ls
jfrog-artifactory-oss-6.14.0.rpm
# 安装 artifactory
sudo rpm -ivh jfrog-artifactory-oss-6.14.0.rpm
Artifactory 服务启动和关闭
代码语言:javascript复制# 启动服务
sudo systemctl start artifactory.service
# 停止服务
sudo systemctl stop artifactory.service
# 查看服务状态
sudo systemctl status artifactory.service
访问 Artifactory
Artifactory 默认端口是8040,安装成功后访问:http://hostname:8040 即可登录(默认用户名 admin 密码 password)
Artifactory 升级
- 从官网下载最新的 Artifactory
- 将下载好的 jfrog-artifactory-oss-6.15.0.rpm(目前最新)上传到你的 Linux 上
cd /artifactory
ls
jfrog-artifactory-oss-6.14.0.rpm jfrog-artifactory-oss-6.15.0.rpm
# 停止服务
sudo systemctl stop artifactory.service
# 进行升级
sudo rpm -U jfrog-artifactory-oss-6.15.0.rpm
# 输出升级成功的日志
warning: jfrog-artifactory-oss-6.15.0.rpm: Header V4 DSA/SHA1 Signature, key ID d7639232: NOKEY
Checking if ARTIFACTORY_HOME exists
Removing tomcat work directory
Removing Artifactory's exploded WAR directory
Initializing artifactory service with systemctl...
************ SUCCESS ****************
The upgrade of Artifactory has completed successfully.
Start Artifactory with:
> systemctl start artifactory.service
Check Artifactory status with:
> systemctl status artifactory.service
NOTE: Updating the ownership of files and directories. This may take several minutes. Do not stop the installation/upgrade process.