jenkins是一种持续集成工具,自动化和简单易用使他很受欢迎,下面是他的安装简介;
1 前提:安装jdk
版本要求:2.54 (2017-04) and newer: Java 81.612 (2015-05) and newer: Java 7
2 下载:
- rpm安装
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.reposudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
- yum安装
yum search jenkins(yum install jenkins.noarch)
3 安装:
yum install jenkins
4 启动:
1 service jenkins start/restart/stop(提示信息比较少,看不到启动日志)2 java -jar /usr/lib/jenkins/jenkins.war(后台执行使用命令:nohup xxx &)
注:
1初始信息
jenkins包:JENKINS_WAR="/usr/lib/jenkins/jenkins.war"配置文件位置:JENKINS_CONFIG=/etc/sysconfig/jenkins配置文件中默认信息:JENKINS_HOME="/var/lib/jenkinsJENKINS_PORT="8080"日志位置:/var/log/jenkins/jenkins.log.初始密码位置:/var/lib/jenkins/secrets/initialAdminPassword
2 遇到问题:
- 字体初始化异常
1.8.0_151-b12SEVERE: Failed to initialize Jenkinshudson.util.AWTProblem: java.lang.NullPointerExceptionCaused by: java.lang.NullPointerExceptionat sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1264)原因:jdk包下载不全,造成字体配置信息缺失.
- 访问阿里云服务器,没有响应异常
原因:阿里云服务器有安全策略,需要单独设置可访问端口;
参考资料: