实例操作:基于 PipeLine 实现 JAVA项目集成 SonarQube代码检测通知 Jenkins

图例过程如下:

实现方式流程:

①准备相关服务器,并实现域名解析

方法1:安装bind9 并配置文件 vim /etc/bind/self.zone

复制代码
$TTL    604800
@       IN      SOA     localhost. root.localhost. (
                              1         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL

                IN      NS      master

master          IN      A       10.0.0.100
gitlab          IN      A       10.0.0.100
jenkins         IN      A       10.0.0.101
harbor          IN      A       10.0.0.102
sonarqube       IN      A       10.0.0.103

方法2:在/etc/hosts 里面定义下面的内容

复制代码
10.0.0.100 gitlab.self.org    
10.0.0.101 jenkins.self.org       
10.0.0.102 harbor.self.org        
10.0.0.103 sonarqube.self.org

②安装GitLab和准备项目

注意:在配置gitlab的时候一定要把虚拟内存调到8g 否则页面会很卡
#可以从gitee码云导入项目代码到github
https://gitee.com/lbtooth/spring-boot-helloworld.git
https://gitee.com/lbtooth/helloworld-spring-boot.git

详细步骤:

包安装gitlab
/etc/gitlab #配置文件目录,重要
/var/opt/gitlab #数据目录,源代码就存放在此目录,重要
/var/log/gitlab #日志目录
/run/gitlab #运行目录,存放很多的数据库文件
/opt/gitlab #安装目录

vim /etc/gitlab/gitlab.rb ←安装完成后进入并修改配置 修改里面的
external_url 'http://gitlab.self.org' #修改此行
gitlab_rails'initial_root_password' = "self@123456" #增加此行 默认登录账号为root
gitlab-ctl reconfigure 修改配置完成后进行reconfigure的配置

其他的安装

apt install git

git clone https://gitee.com/lbtooth/spring-boot-helloworld.git

git clone https://gitee.com/lbtooth/helloworld-spring-boot.git

遇到的问题:

解决办法:进入分支设置点击 "Settings" -> "Repository",定位到 "Protected branches" 部分。unprotected branch

③安装Harbor并配置Jenkins连接****Harbor

在 Jenkins服务器安装Docker,并配置连接Harbor

相关推荐
分布式存储与RustFS6 小时前
备份作业卡在许可证上:用 Veeam 13 把 Windows 整机备份落进 RustFS
运维·云原生·开源·对象存储·分布式存储·s3·性能基准
飞奔的瓜牛6 小时前
Linux 数据盘分区、格式化与自动挂载完整实践
linux·运维·服务器
进击的荆棘8 小时前
Linux网络——Socket编程TCP
linux·运维·服务器·网络·tcp/ip
大今野9 小时前
2026 专转本计算机|Linux CentOS7 软件包管理:yum 仓库配置与常用命令考点全解(附例题)
linux·运维·服务器·专转本
无奈笑天下9 小时前
Wine适配Windows程序常见故障标准处理流程
linux·运维·服务器·windows
沫璃染墨10 小时前
从零入门计算机网络系列(二十六):IPv4分片机制详解——从MTU与MSS到报文分片与重组
运维·服务器·网络·网络协议·tcp/ip·ip
无足鸟ICT10 小时前
【RHCA+】hdparm命令(查看硬盘)
linux·运维·服务器
时间的拾荒人1 天前
Linux 系统命令与网络、磁盘、日志监控(下篇):性能原理与优化
linux·运维·网络
鹤落晴春1 天前
MySQL日志梳理
运维·数据库·mysql
zly35001 天前
esxi安装 windows2000 鼠标不动
运维·服务器