CentOS 安装 Jenkins

烂漫一生 提交于 2020-03-06 18:45:58

原文:https://www.sunjianhua.cn/archives/centos-jenkins.html

 

1.更换源

  mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
  wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
  yum makecache

2.安装组件

  yum install -y  net-tools vim wget zip unzip lrzsz pcre pcre-devel curl openssl openssl-devel openssh-server openssh-clients gcc-c++ zlib1g-dev zlib zlib-devel curl-devel expat-devel gettext-devel opgcc perl-ExtUtils-MakeMaker

3.安装java

4.yum 安装jenkins

  sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo
  sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
  sudo yum install jenkins
  systemctl restart jenkins.service
  systemctl status jenkins.service

5.配置jenkins

  a. 修改运行用户和端口

  b. 设置java路径
  vi /etc/init.d/jenkins
  #如下图加入
  /usr/local/java/jdk1.8.0_171/bin/java

  c. 防火墙放行
  firewall-cmd --zone=public --add-port=8888/tcp --permanent
  systemctl daemon-reload
  systemctl restart firewalld
  systemctl restart jenkins

6.访问jenkins

http://ip:8888/

  #查找安装密码,然后一路下一步
  cat /var/lib/jenkins/secrets/initialAdminPassword

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!