CloasGao 2019-06-28
java -version
有安装则跳过
无安装则先安装jdk
安装方式点击查看
ps 我选择安装jdk为:sudo apt-get install openjdk-8-jdk
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add - sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list' sudo apt-get update sudo apt-get install jenkins
ps: 安装后会出现大量dbkg依赖包错误
1.$ sudo mv /var/lib/dpkg/info /var/lib/dpkg/info_old //现将info文件夹更名 2.$ sudo mkdir /var/lib/dpkg/info //再新建一个新的info文件夹 3.$ sudo apt-get update, apt-get -f install 4.$ sudo mv /var/lib/dpkg/info/* /var/lib/dpkg/info_old // 5.$ sudo rm -rf /var/lib/dpkg/info //把自己新建的info文件夹删掉 6.$ sudo mv /var/lib/dpkg/info_old /var/lib/dpkg/info //把以前的info文件夹重新改回名字
查看是否安装成功systemctl status jenkins.service
cat /etc/services | grep 8080
#查看8080端口是否开启成功
vim /etc/default/jenkins
# port for HTTP connector (default 8080; disable with -1) HTTP_PORT=8080 修改为: # port for HTTP connector (default 8080; disable with -1) HTTP_PORT=8089
sudo service jenkins start sudo service jenkins stop 或者 sudo systemctl start jenkins sudo systemctl stop jenkins
安装路径:/var/lib/jenkins
日志路径:/var/log/jenkins/jenkins.log
3.启动jenkins
http://ip:8089
根据提示 获取初始密码sudo cat /var/lib/jenkins/secrets/initialAdminPassword
最后根据提示完成安装
ps:可以配置nginx 来实现反向代理 这样比较安全