需要一种机制去存储所有的二进制代码(build,packages,third-party plugins等)到类似于版本控制系统的系统。
像Git,SVN存储代码,它们存储的往往是源代码,不是二进制文件。Artifactory或者Nexus就是和Jenkins紧密集成的二进制文件存储库系统。
可以带来以下好处:
追踪构建(谁触发?谁构建)
依赖关系
部署历史
jfrog artifactory是一款二进制存储管理工具,用来管理构建工具(如:maven、gradle)等所依赖的二进制仓库,以方便管理第三方库和发布目标版本库,从而提高软件开发效率。它提供大量的插件以利于和不同工具之间的整合,内部使用权限管理更加安全,并支持高并发等等特性。
下图描述了二进制库工具和Jenkins结合在一起如何存储artifacts.
1 安装JAVA
[[email protected] ~]# yum install java-1.8.0-openjdk-devel.x86_64
[[email protected] logs]# vi /etc/profile
[[email protected] logs]# source /etc/profile
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-0.el7_6.x86_64/ export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export PATH=$PATH:$JAVA_HOME/bin
[[email protected] ~]# java -version
通过zip包方式安装jfrog
jfrog的安装有两种方式,第一种是通过zip包的方式进行安装,第二种是通过yum或者rpm方式进行安装。
在此我们先介绍zip包方式的安装,可以通过如下网址查看zip包的相关信息:
https://bintray.com/jfrog/artifactory/jfrog-artifactory-oss-zip
以上连接打开后
2 复制连接地址,并下载
[[email protected] ~]# cd /usr/local/src/
[[email protected] src]# wget https://bintray.com/jfrog/artifactory/download_file?file_path=jfrog-artifactory-oss-6.13.1.zip
[[email protected] src]# unzip -q download_file\?file_path\=jfrog-artifactory-oss-6.13.1.zip -d /usr/local/
[[email protected] src]# mv /usr/local/artifactory-oss-6.13.1 /usr/local/jfrog
[[email protected] src]# ll /usr/local/jfrog
-rw-r--r-- 1 root root 67681 Oct 8 13:36 Access-Third-Parties-Usage-About-Box.html drwxr-xr-x 3 root root 307 Oct 8 14:04 bin -rw-r--r-- 1 root root 31780 Oct 8 13:36 COPYING.AFFERO drwxr-xr-x 2 root root 136 Oct 8 13:36 etc drwxr-xr-x 2 root root 6 Oct 8 14:04 logs drwxr-xr-x 6 root root 94 Oct 8 14:04 misc -rw-r--r-- 1 root root 195 Oct 8 13:36 README.txt -rw-r--r-- 1 root root 51256 Oct 8 13:36 Third-Parties-Usage-About-Box.html drwxr-xr-x 8 root root 148 Oct 8 14:04 tomcat drwxr-xr-x 2 root root 47 Oct 8 14:04 webapps
3 启动
[[email protected] src]# /usr/local/jfrog/bin/artifactoryctl start
Found java executable in JAVA_HOME (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-0.el7_6.x86_64/) Using CATALINA_BASE: /usr/local/jfrog/tomcat Using CATALINA_HOME: /usr/local/jfrog/tomcat Using CATALINA_TMPDIR: /usr/local/jfrog/tomcat/temp Using JRE_HOME: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-0.el7_6.x86_64/ Using CLASSPATH: /usr/local/jfrog/tomcat/bin/bootstrap.jar:/usr/local/jfrog/tomcat/bin/tomcat-juli.jar Using CATALINA_PID: /usr/local/jfrog/run/artifactory.pid Existing PID file found during start. Removing/clearing stale PID file. Tomcat started.
[[email protected] logs]# ps -ef |grep java
root 2353 1 99 11:49 pts/1 00:00:54 /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-0.el7_6.x86_64//bin/java -Djava.util.logging.config.file=/usr/local/jfrog/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -server -Xms512m -Xmx4g -Xss256k -XX:+UseG1GC -XX:OnOutOfMemoryError=kill -9 %p -Djruby.compile.invokedynamic=false -Dfile.encoding=UTF8 -Dartdist=zip -Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true -Djava.security.egd=file:/dev/./urandom -Dartifactory.home=/usr/local/jfrog -Dfile.encoding=UTF8 -Djruby.bytecode.version=1.8 -Djruby.compile.invokedynamic=false -Djfrog.join.key.paths=/usr/local/jfrog -Dignore.endorsed.dirs= -classpath /usr/local/jfrog/tomcat/bin/bootstrap.jar:/usr/local/jfrog/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/jfrog/tomcat -Dcatalina.home=/usr/local/jfrog/tomcat -Djava.io.tmpdir=/usr/local/jfrog/tomcat/temp org.apache.catalina.startup.Bootstrap start
[[email protected] logs]# ps -ef |grep jfrog
root 2353 1 99 11:49 pts/1 00:01:14 /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-0.el7_6.x86_64//bin/java -Djava.util.logging.config.file=/usr/local/jfrog/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -server -Xms512m -Xmx4g -Xss256k -XX:+UseG1GC -XX:OnOutOfMemoryError=kill -9 %p -Djruby.compile.invokedynamic=false -Dfile.encoding=UTF8 -Dartdist=zip -Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true -Djava.security.egd=file:/dev/./urandom -Dartifactory.home=/usr/local/jfrog -Dfile.encoding=UTF8 -Djruby.bytecode.version=1.8 -Djruby.compile.invokedynamic=false -Djfrog.join.key.paths=/usr/local/jfrog -Dignore.endorsed.dirs= -classpath /usr/local/jfrog/tomcat/bin/bootstrap.jar:/usr/local/jfrog/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/jfrog/tomcat -Dcatalina.home=/usr/local/jfrog/tomcat -Djava.io.tmpdir=/usr/local/jfrog/tomcat/temp org.apache.catalina.startup.Bootstrap start
通过上图,可以很明显的看出jfrog已经正常启动,并且也可以看出jfrog默认监听的是8081端口。
http://192.168.132.134:8081/artifactory/webapp/#/login
jfrog默认的端口是8081,默认的用户名和密码是:admin/password。
登陆进入
安装完成
原文地址:https://www.cnblogs.com/zyxnhr/p/11780033.html