安装
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins
修改配置
Global Tool Configuration
配置 jdk、maven 目录:
JAVA_HOME目录: /usr/lib/jdk
MAVEN_HOME:/usr/share/maven
修改默认的8080端口:
/etc/default/jenkins
HTTP_PORT=8080 改为 8888
sudo service jenkins restart 生效
配置maven:
管理插件--> 安装 Maven Integration plugin 插件 并重启
更改.m2路径
sudo vim /usr/share/maven/conf/settings.xml
增加: <localRepository>/var/lib/jenkins/.m2/repository</localRepository>
远程部署插件:
系统管理->管理插件->可选插件->搜索“Deploy to container Plugin”