1.作为一个 Java 应用程序,Jenkins 要求 Java 8 及更高版本,检查系统上是否安装了 Java
检查是否安装java
java --version
- 1
安装java
sudo apt install -y openjdk-17-jre-headless
- 1
2.通过官方存储库安装 Jenkins
从 Jenkins 存储库导入 Jenkins GPG 密钥
将 Jenkins 存储库加入到源列表文件
curl -fsSL /debian/ | sudo tee \
/usr/share/keyrings/ > /dev/null
echo deb [signed-by=/usr/share/keyrings/] \
/debian binary/ | sudo tee \
/etc/apt// > /dev/null
- 1
- 2
- 3
- 4
- 5
更新apt
sudo apt update
- 1
3.安装jenkins
sudo apt install jenkins
- 1
4.查看是否启动
systemctl status jenkins
- 1
systemctl 命令启动或者停止
5.进入jetkins
http://server-IP:8080
6.查看密码
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
- 1