jenkins 安装部署文档

Yum 安装

yum install -y java-1.8.0-openjdk && \  
wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat/jenkins.repo && \  
rpm --import https://pkg.jenkins.io/redhat/jenkins.io.key &&\  
yum clean all && yum makecache && \  
yum install -y jenkins && \  
systemctl start jenkins  

war包安装

yum install -y java-1.8.0-openjdk  
wget  https://mirrors.tuna.tsinghua.edu.cn/jenkins/war/2.199/jenkins.war  

如何访问

  • 查看密码
cat /var/lib/jenkins/secrets/initialAdminPassword  
  • 访问地址: http://ip:8080
  • 如果全局设置和系统设置打开报错,可能和系统时间有关,安装ntp,执行同步后正常
/usr/sbin/ntpdate us.pool.ntp.org | logger -t NTP

安装目录

  • rpm -ql jenkins
/etc/init.d/jenkins
/etc/logrotate.d/jenkins
/etc/sysconfig/jenkins   配置文件
/usr/lib/jenkins    安装目录
/usr/lib/jenkins/jenkins.war
/usr/sbin/rcjenkins
/var/cache/jenkins
/var/lib/jenkins
/var/log/jenkins 日志目录

相关工具安装

  • 网页上直接安装推荐插件即可
  • git/svn/maven