jenkins
# jenkins
# jenkins 安装
- 下载安装
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
2
3
4
运行
进入/usr/share/jenkins 目录中运行
java -jar jenkins.war
修改端口
进入/etc/default/jenkins 目录修改 HTTP_PORT=9001
修改配置(JDK 环境)
找到 JAVA=
type -p java
注释掉修改为: JAVA=/usr/local/lib/jdk1.8.0_261/bin/java 重载systemctl daemon-reload
使用
启动:
/etc/init.d/jenkins start
停止:/etc/init.d/jenkins stop
重启:/etc/init.d/jenkins restart
查看状态:/etc/init.d/jenkins status
修改国内
查找文件地址:
find / -name hudson.model.UpdateCenter.xml
sudo vi /home/roninwz/.jenkins/hudson.model.UpdateCenter.xml 把http://updates.jenkins-ci.org/update-center.json
改为https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json
访问
输入地址: ip:9001
卸载
移除 jenkins 和依赖关系
sudo apt-get remove jenkins
sudo apt-get remove --auto-remove jenkins
清除配置和数据
sudo apt-get purge jenkins
sudo apt-get purge --auto-remove jenkins
更新
sudo apt-get update
sudo apt-get install jenkins
日志
jenkins 日志文件路径: /var/log/jenkins/jenkins.log
参考链接: https://www.cnblogs.com/xingyunqiu/p/12870769.html (opens new window)