Loading [MathJax]/jax/output/CommonHTML/config.js
前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >专栏 >Hygieia-你值得拥有!!!(下篇)

Hygieia-你值得拥有!!!(下篇)

作者头像
用户5521279
发布于 2019-10-08 08:43:54
发布于 2019-10-08 08:43:54
2.5K00
代码可运行
举报
文章被收录于专栏:搜狗测试搜狗测试
运行总次数:0
代码可运行

书接上篇,我们介绍了Hygieia的架构图、应用的的技术、以及主要工程的搭建步骤,现在Hygieia系统已经能够完整的运行起来了,但是如果要充分发挥Hygieia的作用,还需要借助各个collector,通过这些collector,将我们需要的各类数据进行收集,同时在主界面中得到展现。

本篇我们主要介绍我们实际应用到的4个collector的搭建以及应用:

  • hygieia-scm-gitlab-collector
  • hygieia-scm-subversion-collector
  • hygieia-build-jenkins-collector
  • hygieia-codequality-sonar-collector

环境要求

  • Java - Version 1.8 is recommended
  • Maven - Version 3.3.9 and above are recommended
  • Git - Install Git

hygieia-scm-gitlab-collector

第一步:使用Hygieia-Core生成一个用于认证的密钥key

  • 进入Hygieia-Core\target 目录
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
java -jar core-3.1.3-SNAPSHOT.jar com.capitalone.dashboard.util.Encryption
  • 记录最后一行内容,即“PbA/8tJ+PXthc3a3KijBqmyo6eC4V2qu”

第二步:获取工程代码

获取代码的方式有两种,克隆或者下载:

  • 克隆,获取最新的代码,执行 “git clone https://github.com/Hygieia/hygieia-scm-gitlab-collector.git ” ,存在的风险是无法工程可能编译不成功;
  • 下载,获取最新的Release版本, https://github.com/Hygieia/hygieia-scm-gitlab-collector/archive/v3.1.0.tar.gz ,推荐使用。

第三步、编写配置文件

  • 进入hygieia-scm-gitlab-collector根目录
  • 在/src/main/resources/目录下新建文件,文件名为gitlab-collector.properties
  • 修改配置文件 # mogonDB的数据库名称 dbname=xxx # mogonDB的数据库地址 - default is localhost dbhost=xxx.xxx.xxx.xxx # mogonDB的数据库端口 - default is 27017 dbport=27017 # MongoDB replicaset dbreplicaset=false dbhostport=xxx.xxx.xxx.xxx:27017 # mogonDB的数据库用户名 - default is blank dbusername=xxxxx # mogonDB的数据库密码 - default is blank dbpassword=xxxxx # Log文件存在地址 logging.file=./logs/gitlab.log # Collector执行策略 (required) gitlab.cron=0/10 * * * * * # Gitlab地址 (optional, defaults to 'gitlab.com') gitlab.host=gitlab.com # Gitlab服务器协议 (optional, defaults to 'http') gitlab.protocol=https # 如果gitlab中的工程目录结构存在Subgroup,则需要开启。如果开启,在前端dashboard的插件中配置URL的格式为 <gitlab.protocol>://<gitlab.host>/<gitlab_project_id>, gitlab.useProjectId=true # Gitlab端口 (optional, 默认协议则为默认端口,即http为80、https为443) #gitlab.port=80 # 如果Gitlab path (optional, if your instance of gitlab requires a path) #gitlab.path= #If your instance of Gitlab is using a self-signed certificate, set to true, default is false gitlab.selfSignedCertificate=true # Gitlab API Token (required, 内容通过Gitlab设置页中生成,collector获取数据时默认使用, 如果在UI界面配置时填写了新的Token内容,则会覆盖此处默认设置的内容) #gitlab.apiToken= # 最多显示之前多少天的数据 gitlab.commitThresholdDays=60 # Gitlab key for private repos,通过Hygieia-core生成 gitlab.key=xxxxxx
  • 编译打包: mvn clean install package

第四步:启动服务

  • 前台运行: java -jar target/gitlab-scm-collector-3.1.0-SNAPSHOT.jar --spring.config.name=gitlab --spring.config.location=src/main/resources/gitlab-collector.properties
  • 静默运行: nohup java -jar target/gitlab-scm-collector-3.1.0-SNAPSHOT.jar --spring.config.name=gitlab --spring.config.location=src/main/resources/gitlab-collector.properties &

hygieia-scm-subversion-collector

第一步:获取工程代码

获取代码的方式有两种,克隆或者下载:

  • 克隆,获取最新的代码,执行 “git clone https://github.com/Hygieia/hygieia-scm-subversion-collector.git ” ,存在的风险是无法工程可能编译不成功;
  • 下载,获取最新的Release版本, https://github.com/Hygieia/hygieia-scm-subversion-collector/archive/subversion-collector-3.0.2.tar.gz ,推荐使用。

第二步:编写配置文件

  • 进入hygieia-scm-subversion-collector根目录
  • 在/src/main/resources/目录下新建文件,文件名为subversion-collector.properties
  • 修改配置文件 # Database Name dbname=dashboard # Database HostName - default is localhost dbhost=xxx.xxx.xxx.xxx # Database Port - default is 27017 dbport=27017 # MongoDB replicaset dbreplicaset=false dbhostport=xxx.xxx.xxx.xxx:27017 # Database Username - default is blank dbusername=xxxxx # Database Password - default is blank dbpassword=xxxxx # Logging File location logging.file=./logs/subversion.log # Collector schedule (required) # subversion.cron=0 0/5 * * * * subversion.cron=0/10 * * * * * # Shared subversion username and password # subversion.username=foo # subversion.password=bar # subversion.host=subversion.host.com # Maximum number of previous days from current date, when fetching commits subversion.commitThresholdDays=15
  • 编译打包: mvn clean install package

第三步:启动服务

  • 前台运行: java -jar target/subversion-collector-3.0.1.jar --spring.config.name=subversion --spring.config.location=src/main/resources/subversion-collector.properties
  • 静默运行: nohup java -jar target/subversion-collector-3.0.1.jar --spring.config.name=subversion --spring.config.location=src/main/resources/subversion-collector.properties &

hygieia-build-jenkins-collector

第一步:在Jenkins中获取API Token

  • 登录Jenkins,点击左侧的People
  • 在右侧列表中点击当前登录的账号
  • 在打开的页面中,点击左侧的Configure
  • 在右侧API Token中点击“Add new Token”
  • 输入名称后,点击右侧的“Generate”按钮
  • 记录最后一行内容,即“119ad0a8f0e7a41a6f6166eb9ab3a56640”,注意,该内容仅出现一次

第二步:获取工程代码

获取代码的方式有两种,克隆或者下载:

  • 克隆,获取最新的代码,执行 “git clone https://github.com/Hygieia/hygieia-build-jenkins-collector.git ” ,存在的风险是无法工程可能编译不成功;
  • 下载,获取最新的Release版本, https://github.com/Hygieia/hygieia-build-jenkins-collector/archive/v3.1.0.tar.gz ,推荐使用。

第三步:编写配置文件

  • 进入hygieia-build-jenkins-collector根目录
  • 在src/main/resources/目录下新建文件,文件名为jenkins-build.properties
  • 修改配置文件 # Database Name dbname=xxxxx # Database HostName - default is localhost dbhost=xxx.xxx.xxx.xxx # Database Port - default is 27017 dbport=27017 # MongoDB replicaset dbreplicaset=false dbhostport=xxx.xxx.xxx.xxx:27017 # Database Username - default is blank dbusername=xxxxxx # Database Password - default is blank dbpassword=xxxxxx # Collector schedule (required) jenkins.cron=0/10 * * * * * # The page size jenkins.pageSize=1000 # The folder depth - default is 10 jenkins.folderDepth=10 # Jenkins server (required) - Can provide multiple,如果无需账号验证,只需要配置这里 # jenkins.servers、jenkins.usernames、jenkins.apiKeys、jenkins.searchFields配置是成对出现的,使用[0]来归类, # jenkins.servers[0]=http://jenkins.company.com #jenkins.servers[0]=http://JenkinsHost1 #jenkins.servers[1]=http://JenkinsHost2 # If using username/token for API authentication,如果需要账号验证,需要配置这里,以及下方的Another option,token为上述中通过Jenkins中生成的API Token # (required for Cloudbees Jenkins Ops Center) For example, # jenkins.servers[0]=http://username:token@jenkins.company.com jenkins.servers[0]=http://username0:token0@JenkinsHost1 jenkins.servers[1]=http://username1:token1@JenkinsHost2 # Another option: If using same username/password Jenkins auth, # set username/apiKey to use HTTP Basic Auth (blank=no auth) jenkins.usernames[0]=username0 jenkins.apiKeys[0]=token0 jenkins.usernames[1]=username1 jenkins.apiKeys[1]=token1 # Search criteria enabled via properties (max search criteria = 2) jenkins.searchFields[0]= options.jobName jenkins.searchFields[1]= niceName # Determines if build console log is collected - defaults to false jenkins.saveLog=true # Timeout values jenkins.connectTimeout=20000 jenkins.readTimeout=20000
  • 编译打包: mvn clean install package

第四步:启动服务

  • 前台运行: java -jar target/jenkins-build-collector-3.0.1.jar --spring.config.name=jenkins --spring.config.location=src/main/resources/jenkins-build.properties
  • 静默运行: nohup java -jar target/jenkins-build-collector-3.0.1.jar --spring.config.name=jenkins --spring.config.location=src/main/resources/jenkins-build.properties &

hygieia-codequality-sonar-collector

第一步:获取工程代码

获取代码的方式有两种,克隆或者下载:

  • 克隆,获取最新的代码,执行 “git clone https://github.com/Hygieia/hygieia-codequality-sonar-collector.git ” ,存在的风险是无法工程可能编译不成功;
  • 下载,获取最新的Release版本, https://github.com/Hygieia/hygieia-codequality-sonar-collector/archive/v1.0.0.tar.gz ,推荐使用。

第二步:编写配置文件

  • 进入hygieia-codequality-sonar-collector根目录
  • 在src/main/resources/目录下新建文件,文件名为sonar-build.properties
  • 修改配置文件 # Database Name dbname=xxxxx # Database HostName - default is localhost dbhost=xxx.xxx.xxx.xxx # Database Port - default is 27017 dbport=27017 # MongoDB replicaset dbreplicaset=false dbhostport=xxx.xxx.xxx.xxx:27017 # Database Username - default is blank dbusername=xxxxx # Database Password - default is blank dbpassword=xxxxx # Collector schedule (required) sonar.cron=0/10 * * * * * # Sonar server(s) (required) - Can provide multiple sonar.servers[0]=https://sonar.com # Sonar version, match array index to the server. If not set, will default to version prior to 6.3. sonar.versions[0]=6.7 # Sonar Metrics - Required. #Sonar versions lesser than 6.3 sonar.metrics[0]=ncloc,line_coverage,violations,critical_violations,major_violations,blocker_violations,violations_density,sqale_index,test_success_density,test_failures,test_errors,tests # For Sonar version 6.3 and above sonar.metrics[0]=ncloc,violations,new_vulnerabilities,critical_violations,major_violations,blocker_violations,tests,test_success_density,test_errors,test_failures,coverage,line_coverage,sqale_index,alert_status,quality_gate_details # Sonar login credentials #sonar.username= #sonar.password=
  • 编译打包: mvn clean install package

第三步:启动服务

  • 前台运行: java -jar target/sonar-codequality-collector-3.0.1.jar --spring.config.name=sonar --spring.config.location=src/main/resources/sonar-build.properties
  • 静默运行: nohup java -jar target/sonar-codequality-collector-3.0.1.jar --spring.config.name=sonar --spring.config.location=src/main/resources/sonar-build.properties &
本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2019-09-30,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 搜狗测试 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
暂无评论
推荐阅读
编辑精选文章
换一批
(最新 9000 字 )Spring Boot 配置特性解析
目前Spring Boot版本: 2.3.4.RELEASE,这更新的速度也是嗖嗖的了,随着新版本的发布,也一步步针对公司基础组件进行了升级改造,其中很重要的一块就是配置文件的更新(虽然目前已经全部使用了Apollo)。针对Spring Boot 新版本的配置文件也做了一次梳理,确实发现了以前没有注意到的点。
鲁大猿
2020/09/25
6230
(最新 9000 字 )Spring Boot 配置特性解析
补习系列(10)-springboot 之配置读取
在早前的博客中曾经写过 Spring 程序通过 Bean 映射实现配置信息的读取。 在SpringBoot 框架中读取配置的方式变得非常多样,这导致读者在搜寻资料时反而容易迷糊。
美码师
2019/01/23
1.2K0
Hygieia-你值得拥有!!!(上篇)
Hygieia,由Capitalone公司开源的DevOps系统,可构建软件需求、开发、测试、部署全流程的端到端Dashboard看板平台,采集各种常见系统的数据并图形化集中动态展示,涉及的系统包括不限于jira、gitlab、github、svn、jenkins、sonarqube等。使用Hygieia后,在整个软件开发周期中,用户可以选择VersionOne或Jira进行用户故事的追踪,选择Subversion或GitHub作为代码仓库,选择Jenkins或Hudson进行构建,选择Selenium和SonarQube用于质量检测,以及选择uDeploy或Jenkins进行部署等等,当然Hygieia不止这点,它的api基于rest风格插件设计,其他的一些软件工程组件可以很轻松的接入到Hygieia,他的dashboard大盘可以展示软件创建到交付的整个生命周期数据。
用户5521279
2019/09/17
4.7K0
Hygieia-你值得拥有!!!(上篇)
三万字无坑搭建基于Docker+K8S+GitLab/SVN+Jenkins+Harbor持续集成交付环境!!
作者个人研发的在高并发场景下,提供的简单、稳定、可扩展的延迟消息队列框架,具有精准的定时任务和延迟队列处理功能。自开源半年多以来,已成功为十几家中小型企业提供了精准定时调度方案,经受住了生产环境的考验。为使更多童鞋受益,现给出开源框架地址:
冰河
2020/12/24
6K2
三万字无坑搭建基于Docker+K8S+GitLab/SVN+Jenkins+Harbor持续集成交付环境!!
基于Jenkins+Argocd+Argo Rollouts的DevOps实现并用金丝雀发布
本文主要介绍使用Jenkins配合argocd以及argo rollouts实现CI/CD。其中jenkins配合argocd做CI/CD前面已经介绍过了,这里不再赘述,不懂的地方可以移步《使用Jenkins和Argocd实现CI/CD》。
没有故事的陈师傅
2021/01/04
4.6K1
基于Jenkins+Argocd+Argo Rollouts的DevOps实现并用金丝雀发布
基于Jenkins+Gitlab+Harbor+Rancher+k8s CI/CD实现
     通常运维人员在接到代码(新项目)上线的任务前都要做大量的准备工作,包括:物理主机、虚拟机、代码运行环境、数据库安装配置、各种帐号创建,、运行后期的系统监控、应用的日志收集,性能优化等一系列的工作。
py3study
2020/06/18
4.2K0
基于Jenkins+Gitlab+Harbor+Rancher+k8s CI/CD实现
springboot配置文件加载顺序
SpringApplication loads properties from application.properties files in the following locations and adds them to the Spring Environment:
六月的雨在Tencent
2024/03/28
2870
DevOps整合Jenkins+k8s+CICD
基于现在的互联网现状,更推崇敏捷式开发,这样就导致项目的迭代速度更快,但是由于开发团队与运维团队的沟通问题,会导致新版本上线的时间成本很高。这又违背的敏捷式开发的最初的目的。 那么如果让开发团队和运维团队整合到成一个团队,协同应对一套软件呢?这就被称为DevOps。 DevOps,字面意思是Development &Operations的缩写,也就是开发&运维。 然字面意思只涉及到了开发团队和运维团队,其实QA测试团队也是参与其中的。 网上可以查看到DevOps的符号类似于一个无穷大的符号
IT运维技术圈
2022/10/24
2.9K1
SpringBoot2.x基础篇:配置文件的加载顺序以及优先级覆盖
SpringBoot约定了配置文件,默认为application.properties,通过该文件可以修改很多默认的配置,当然我们还可以在该配置文件内添加自定义的配置,该文件通过key=value的形式进行配置。
恒宇少年
2020/03/24
13.5K0
SpringBoot2.x基础篇:配置文件的加载顺序以及优先级覆盖
SpringBoot配置文件高级用法实战
Spring Boot配置文件的优先级是一个重要的概念,它决定了当存在多个配置文件时,哪个配置文件中的配置将被优先采用。
公众号:码到三十五
2024/08/06
2030
SpringBoot配置文件高级用法实战
基于 Jenkins、Gitlab、Harbor、Helm 和 Kubernetes 的 CI/CD
我们利用 Kubernetes 来动态运行 Jenkins 的 Slave 节点,可以和好的来解决传统的 Jenkins Slave 浪费大量资源的缺点。之前的示例中我们是将项目放置在 Github 仓库上的,将 Docker 镜像推送到了 Docker Hub,这节课我们来结合我们前面学习的知识点来综合运用下,使用 Jenkins、Gitlab、Harbor、Helm、Kubernetes 来实现一个完整的持续集成和持续部署的流水线作业。
jwangkun
2021/12/23
2.6K0
基于 Jenkins、Gitlab、Harbor、Helm 和 Kubernetes 的 CI/CD
springBoot学习(一)建立项目与读取配置文件
Alpha:是内部测试版,一般不向外部发布,会有很多Bug.一般只有测试人员使用。
乱敲代码
2019/05/30
1.7K0
Spring Boot 2.0.0参考手册_中英文对照_Part IV_24
文章作者:Tyan 博客:noahsnail.com  |  CSDN  |  简书
Tyan
2022/05/09
1.3K0
Spring Boot从零入门7_最新配置文件配置及优先级详细介绍
本文属于原创,转载注明出处,欢迎关注微信小程序小白AI博客 微信公众号小白AI或者网站 https://xiaobaiai.net 或者我的CSDN http://blog.csdn.net/freeape
别打名名
2019/12/23
8820
Gitlab+Jenkins+k8s+Helm 的自动化部署实践
本文从实践角度介绍如何结合我们常用的 Gitlab 与 Jenkins,通过 K8s 来实现项目的自动化部署,示例将包括基于 SpringBoot 的服务端项目与基于 Vue.js 的 Web 项目。
kubernetes中文社区
2021/11/12
3.7K0
基于 Kubernetes/Jenkins/Harbor/SonarQube 搭建微服务CI/CD系统
https://github.com/goharbor/harbor/blob/master/docs/installation_guide.md
DevOps时代
2019/07/05
1.8K0
基于 Kubernetes/Jenkins/Harbor/SonarQube 搭建微服务CI/CD系统
微服务架构之Spring Boot(二十四)
RandomValuePropertySource 对于注入随机值(例如,进入秘密或测试用例)非常有用。它可以生成整数,长整数,uuids或字符串,如以下
用户1289394
2022/04/07
1.9K0
DevOps利器- Hygieia平台开发部署
Capitalone(全美十大银行之一)开源的DevOps利器。使用Hygieia后,在整个软件开发周期中,用户可以选择VersionOne或Jira进行用户故事的追踪,选择Subversion或GitHub作为代码仓库,选择Jenkins或Hudson进行构建,选择Selenium和SonarQube用于质量检测,以及选择uDeploy或Jenkins进行部署等等,当然Hygieia不止这点,它的api基于rest风格插件设计,其他的一些软件工程组件可以很轻松的接入到Hygieia,他的dashboard大盘可以展示软件创建到交付的整个生命周期数据。
kl博主
2018/04/13
1.8K0
DevOps利器- Hygieia平台开发部署
Jenkins+Gitlab+Nginx+SonarQube+Maven编译Java项目自动发布与基于tag版本回退
 SonarQube是一个开源的代码质量管理系统,用于检测代码中的错误,漏洞和代码规范。它可以现有的Gitlab、Jenkins集成,以便在项目拉取后进行连续的代码检查。
非著名运维
2022/06/22
8320
Jenkins+Gitlab+Nginx+SonarQube+Maven编译Java项目自动发布与基于tag版本回退
DevOps平台
DevOps定义(来自维基百科): DevOps(Development和Operations的组合词)是一种重视“软件开发人员(Dev)”和“IT运维技术人员(Ops)”之间沟通合作的文化、运动或惯例。透过自动化“软件交付”和“架构变更”的流程,来使得构建、测试、发布软件能够更加地快捷、频繁和可靠。
Zephery
2019/12/06
1.3K0
推荐阅读
相关推荐
(最新 9000 字 )Spring Boot 配置特性解析
更多 >
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
本文部分代码块支持一键运行,欢迎体验
本文部分代码块支持一键运行,欢迎体验