1、官网:https://jenkins.io/download/ 选择ubuntu
2、采用自动安装的方式,执行下列命令:
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
deb https://pkg.jenkins.io/debian-stable binary/
sudo apt-get update
sudo apt-get install jenkins
如果报如下错误(未关联java可执行文件)则执行:
update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk1.8.0_131/bin/java" 1
3、启动jenkins:
service jenkins start/stop
service jenkins status
uninstall:apt-get --purge remove jenkins
如果因为jenkins默认的8080端口被占用致启动失败,则修改默认端口:
vim /etc/default/jenkins
如:HTTP_PORT=8090
4、war包安装:
cd /opt
wget http://mirrors.jenkins.io/war/2.83/jenkins.war
java -jar jenkins.war &