jenkins安装
//
Jenkins官方地址 (opens new window)
Jenkins War包下载地址 (opens new window)
Jenkins-rpm-archives (opens new window)
最低硬件要求
256 MB 内存
1 GB 的驱动器空间(尽管如果将 Jenkins 作为 Docker 容器运行,则建议至少 10 GB)
牛逼的人不需要解释
# Linux部署jenkins
- 安装
sudo wget -O /etc/yum.repos.d/jenkins.repo \
https://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
sudo yum upgrade
# Add required dependencies for the jenkins package
sudo yum install epel-release
sudo yum install fontconfig java-11-openjdk
sudo yum install jenkins
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
如果jdk不是通过yum安装,按自己的java路径创建软连接,默认 /usr/bin/java,也可以修改配置:/etc/sysconfig/jenkins
ln -s /usr/local/jdk-11.0.5/bin/java /usr/bin/java
jenkins主要的目录
/usr/lib/jenkins/:jenkins安装目录,WAR包会放在这里
/etc/sysconfig/jenkins:jenkins配置文件,“端口”,“JENKINS_HOME”等都可以在这里配置
/var/lib/jenkins/:默认的JENKINS_HOME
/var/log/jenkins/jenkins.log:Jenkins日志文件
- 启动
systemctl start jenkins
systemctl enable jenkins
1
2
2
- 通过nginx代理
vi /etc/nginx/conf.d/jenkins.conf
upstream jenkins{
server 127.0.0.1:8080;
}
server
{
listen 80;
server_name jenkins.yfklife.cn;
location / {
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Graylog-Server-URL http://$server_name/;
proxy_pass http://jenkins;
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
- 登录:
jenkins.yfklife.cn
初次登陆密码:cat /var/lib/jenkins/secrets/initialAdminPassword
# k8s部署
//
如果此文章对您有帮助,点击 -->> 请博主喝咖啡 (opens new window)
上次更新: 2023/05/25, 16:16:09