Jenkins安装
参考Debian Jenkins Packageshttps://pkg.origin.jenkins.io/debian-stable/
加Key
curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee \
/usr/share/keyrings/jenkins-keyring.asc > /dev/null
加仓库
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
https://pkg.jenkins.io/debian-stable binary/ | sudo tee \
/etc/apt/sources.list.d/jenkins.list > /dev/null
更新索引,并安装依赖库,再安装jenkins
fontconfig openjdk-11-jre
sudo apt-get update
sudo apt-get install fontconfig openjdk-11-jre
sudo apt-get install jenkins
Jenkins服务运行
开启服务
sudo systemctl start jenkins
检查是否正在运行
sudo systemctl status jenkins
在浏览器种输入下面的URL,打开Jenkins,默认端口8080
http://your_server_ip_or_domain:8080
解锁Jenkins
第一次在浏览器中访问Jenkins时,您将被提示解锁Jenkins。初始admin密码可以在以下文件中找到:
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
复制密码到浏览器解锁Jenkins.
配置Jenkins:
按照说明设置Jenkins,可以根据需要安装插件和配置Jenkins。
运行Jenkins服务:
要确保Jenkins在启动时自动启动,并作为系统服务进行管理,请执行以下命令:
sudo systemctl enable jenkins