安装Jenkins到Ubuntu(APT)

运行环境

系统版本:Ubuntu 16.04.4 LTS
软件版本:Jenkins-2.176.2
硬件要求:最低内存:256MB、磁盘:1GB

安装过程

1、配置APT-Jenkins存储库

APT-Jenkins存储库由Jenkins官网提供。

root@localhost:~# wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
root@localhost:~# sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
root@localhost:~# sudo apt-get update

2、安装Jenkins

root@localhost:~# sudo apt-get install jenkins

3、修改Jenkins的端口号

root@localhost:~# vim /etc/default/jenkins
HTTP_PORT=8070
root@localhost:~# vim /etc/init.d/jenkins
    check_tcp_port "http" "$HTTP_PORT" "8070" "$HTTP_HOST" "0.0.0.0" || return 2

4、重启Jenkins服务

root@localhost:~# systemctl daemon-reload
root@localhost:~# systemctl restart jenkins

5、第一次访问登录

第一次访问登录我们需要解锁Jenkins。

获取解锁码:
root@localhost:~# cat /var/lib/jenkins/secrets/initialAdminPassword
a5e6886c5e0140d4871f8fb7cf215c89


我们需要安装一些常用的插件。

乐在分享!~~
原文地址:https://www.cnblogs.com/network-ren/p/12377345.html