Administrator
发布于 2022-06-30 / 896 阅读
0
0

自动化开发环境搭建 -- 2. Jenkins 安装

准备

# 安装 jdk
apt install openjdk-11-jdk
# 安装 jenkins
curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io.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
apt-get update
apt-get install jenkins

配置

# 修改端口号
systemctl edit jenkins 
---
[Service]
Environment="JENKINS_PORT=8081"
---
# 重启 
systemctl restart jenkins

运行

# 查看初始密码
cat /var/lib/jenkins/secrets/initialAdminPassword

登录后,下载相关插件,可能会有一些插件下载不下来。
配置 更新源地址, 重新下载相关依赖就可以了。

https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json

评论