Centos 7 安装 Jenkins

Edit

Centos 7 安装 Jenkins

配置环境

jenkins 官网推荐安装 java 1.8,但是 java 1.7 也是可以的。

# yum install -y java 
# wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins.io/redhat-stable/jenkins.repo
# rpm --import http://pkg.jenkins.io/redhat-stable/jenkins.io.key
# yum install -y jenkins 
# service jenkins start

配置防火墙规则(如有需要)

# firewall-cmd --zone=public --add-port=8080/tcp --permanent
# firewall-cmd --zone=public --add-service=http --permanent
# firewall-cmd --reload 

配置文件说明

/etc/sysconfig/jenkins ,该配置文件可以修改默认的路径、端口、user、httpport 等等信息。

浏览器配置

启动服务
# service jenkins start
复制 jenkins 自动生成的密码
# cat /var/lib/jenkins/secrets/initialAdminPassword     

浏览器: ip:port

Centos 7 安装 Jenkins_第1张图片
在这里粘贴上面的密码,点击 Continue


Centos 7 安装 Jenkins_第2张图片
选择 Install suggested plugins,等等安装完成即可。



Centos 7 安装 Jenkins_第3张图片
输入新的用户名和密码,即可成功。



Centos 7 安装 Jenkins_第4张图片

%23%23%23%20Centos%207%20%u5B89%u88C5%20Jenkins%20%0A@%28Jenkins%20%u6301%u7EED%u96C6%u6210%29%0A%23%23%23%23%20%u914D%u7F6E%u73AF%u5883%0A%3E%20jenkins%20%u5B98%u7F51%u63A8%u8350%u5B89%u88C5%20java%201.8%uFF0C%u4F46%u662F%20java%201.7%20%u4E5F%u662F%u53EF%u4EE5%u7684%u3002%0A%60%60%60python%0A%23%20yum%20install%20-y%20java%20%0A%23%20wget%20-O%20/etc/yum.repos.d/jenkins.repo%20http%3A//pkg.jenkins.io/redhat-stable/jenkins.repo%0A%23%20rpm%20--import%20http%3A//pkg.jenkins.io/redhat-stable/jenkins.io.key%0A%23%20yum%20install%20-y%20jenkins%20%0A%23%20service%20jenkins%20start%0A%60%60%60%0A%0A%u914D%u7F6E%u9632%u706B%u5899%u89C4%u5219%uFF08%u5982%u6709%u9700%u8981%uFF09%0A%60%60%60%20python%0A%23%20firewall-cmd%20--zone%3Dpublic%20--add-port%3D8080/tcp%20--permanent%0A%23%20firewall-cmd%20--zone%3Dpublic%20--add-service%3Dhttp%20--permanent%0A%23%20firewall-cmd%20--reload%20%0A%60%60%60%0A%u914D%u7F6E%u6587%u4EF6%u8BF4%u660E%0A%3E%20/etc/sysconfig/jenkins%20%uFF0C%u8BE5%u914D%u7F6E%u6587%u4EF6%u53EF%u4EE5%u4FEE%u6539%u9ED8%u8BA4%u7684%u8DEF%u5F84%u3001%u7AEF%u53E3%u3001user%u3001httpport%20%u7B49%u7B49%u4FE1%u606F%u3002%0A%0A%23%23%23%23%20%u6D4F%u89C8%u5668%u914D%u7F6E%0A%60%60%60python%0A%u542F%u52A8%u670D%u52A1%0A%23%20service%20jenkins%20start%0A%u590D%u5236%20jenkins%20%u81EA%u52A8%u751F%u6210%u7684%u5BC6%u7801%0A%23%20cat%20/var/lib/jenkins/secrets/initialAdminPassword%20%20%20%20%20%0A%0A%u6D4F%u89C8%u5668%uFF1A%20ip%3Aport%0A%60%60%60%0A%21%5BAlt%20text%5D%28./1496549598685.png%29%0A%u5728%u8FD9%u91CC%u7C98%u8D34%u4E0A%u9762%u7684%u5BC6%u7801%uFF0C%u70B9%u51FB%20Continue%0A%0A%21%5BAlt%20text%5D%28./1496549966785.png%29%0A%u9009%u62E9%20Install%20suggested%20plugins%uFF0C%u7B49%u7B49%u5B89%u88C5%u5B8C%u6210%u5373%u53EF%u3002%0A%0A%21%5BAlt%20text%5D%28./1496551263241.png%29%0A%u8F93%u5165%u65B0%u7684%u7528%u6237%u540D%u548C%u5BC6%u7801%uFF0C%u5373%u53EF%u6210%u529F%u3002%0A%0A%21%5BAlt%20text%5D%28./1496556356759.png%29%0A

你可能感兴趣的:(jenkins)