ubuntu安装Jenkins
apt install fontconfig openjdk-17-jre
sudo wget -O /usr/share/keyrings/jenkins-keyring.asc https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key
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
sudo apt-get update
sudo apt-get install jenkins
systemctl enable jenkins
启动有点慢
systemctl start jenkins
查看密码
cat /var/lib/jenkins/secrets/initialAdminPassword
打开
http://192.168.56.107:8080/
修改端口
vim /usr/lib/systemd/system/jenkins.service
systemctl daemon-reload
用户名:xuxb
密码: zgjuan
全名: 徐小波
电子邮件地址:xuxiaobovip@126.com
修改插件下载源
首先停止jenkins的运行,命令为 sudo systemctl stop jenkins。 然后寻找源的配置文件
sudo find / -name *.UpdateCenter.xml
修改找到的配置文件 /var/lib/jenkins/hudson.model.UpdateCenter.xml
# 修改前
<?xml version='1.1' encoding='UTF-8'?>
<sites>
<site>
<id>default</id>
<url>https://updates.jenkins.io/update-center.json</url>
</site>
</sites>
# 修改后 替换为清华的源
<?xml version='1.1' encoding='UTF-8'?>
<sites>
<site>
<id>default</id>
<url>https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json</url>
</site>
</sites>
sudo systemctl start jenkins 重启jenkins,完工!我们验证一下源是否修改完成
教程:https://blog.csdn.net/qq_34481955/article/details/142924694