Hygieia 安装与配置

Hygieia是CapitalOne在2015年推出的DevOps又一开源利器,它是一个可配置的易于使用的Dashboard,用于实现DevOps的整个流水线的可视化。

本文主要提供简单的指引为方便开始使用Hygieia

下载编译Hygieia

从Github上克隆代码

git clone https://github.com/capitalone/Hygieia.git

编译jar包

1.      cd Hygieia 

2.      mvn clean install package

编译成功后,可以看到相应目录下生成对应组件的jar包


配置与部署

组件的部署需要顺序进行,配置前要预先安装MongoDB 否则API组件无法正常运行。

Windows 环境 MongoDB 安装

1、 在安装目录创建文件夹 ,在data文件夹下创建db,log文件夹,在log文件夹下创建空白文件MongoDB.log。


2、以管理员权限运行dos命令:

进入mongodb的bin目录下,运行下图命令:


 成功后另开一个控制台,在bin目录下运行mongo命令,选择dashboard,创建用户:


创建用户命令如下:

db.createUser( {

user: "db",         

pwd: "dbpass",         

roles: [  {role: "readWrite", db: "dashboard"} ]         

})

3、 为避免每次都要开两个控制台启动mongodb,我们可以将mongodb安装为windows服务:

成功后,运行

NET START MongoDB 开启服务。

Hygieia 组件配置

API 组件

每个组件是基于Spring Boot,需要配置api.properties文件用于初始化配置。

启动方式:java -jar api.jar --spring.config.location=/path/to/api.properties

spring.config.location 是api.properties 保存的位置

aip.properites 参数配置如下例子:    

#Database Name - default is test 

dbname= test 

#Database HostName - default is localhost 

dbhost=mongodb 

#Database Port - default is 27017 

dbport=27017 

#Database Username - default is blank 

dbusername= dashboard

#Database Password - default is blank 

dbpassword=dbpassword 

logRequest=false 

logSplunkRequest=false 

corsEnabled=false 

corsWhitelist=http://domain1.com:port,http://domain2.com:port 

feature.dynamicPipeline=enabled 

#Authentication Settings 

# JWT expiration time in milliseconds 

auth.expirationTime=3600000 

# Secret Key used to validate the JWT tokens 

auth.secret=secret 

auth.authenticationProviders= 

server.contextPath=/api

server.port=8080


UI组件安装

需预先安装nodejs。

执行命令:

npm install -g bower

npm install -g gulp

进入UI目录,执行(时间稍长,耐心等待)

npm install

bower install

成功后,执行

gulp serve 启动服务

collectors组件配置

1. Feature 监控

先配置好properties文件,在命令窗口执行:

Java -jar jira-feature-collector.jar --spring.config.location=\Hygieia\collectors\feature\jira\src\main\resources\application.properties

#Collector schedule (required)

feature.cron=0 */15 * * * *

#Page size for data calls (Jira maxes at 1000)

feature.pageSize=100

#In-built folder housing prepared REST queries (required)

feature.queryFolder=jiraapi-queries

#Jira API Query file names (String template requires the files to have .st extension) (required)

feature.storyQuery=story

feature.epicQuery=epic

feature.projectQuery=projectinfo

feature.memberQuery=memberinfo

feature.sprintQuery=sprintinfo

feature.teamQuery=teaminfo

feature.trendingQuery=trendinginfo

#Jira Connection Details

feature.jiraProxyUrl=

feature.jiraProxyPort=

# Trending Query: Number of days in a sprint (not-required)

feature.sprintDays=60

# Trending Query: Length of sprint week (not-required)

feature.sprintEndPrior=7

#Scheduled Job prior minutes to recover data created during execution time (usually, 2 minutes is enough)

feature.scheduledPriorMin=2

#Delta change date that modulates the collector item task - should be about as far back as possible, in ISO format (required)

feature.deltaCollectorItemStartDate=2018-01-01T00:00:00.000000

#Jira Connection Details

feature.jiraBaseUrl=http://localhost:8088

feature.jiraQueryEndpoint=rest/api/2/

#64-bit encoded credentials with the pattern username:password

#on a mac you con create them with : echo "username:password" | base64

#reference: https://www.base64decode.org/

feature.jiraCredentials=YWRtaW46ZGV2b==

#Start dates from which to begin collector data, if no other data is present - usually, a month back is appropriate (required) feature.deltaStartDate=2018-01-01T00:00:00.000000

feature.masterStartDate=2018-01-01T00:00:00.000000

# In Jira, general IssueType IDs are associated to various "issue"

# attributes. However, there is one attribute which this collector's

# queries rely on that change between different instantiations of Jira.

# Please provide a String Name reference to your instance's IssueType for

# the lowest level of Issues (e.g., "user story") specific to your Jira

# instance. Note: You can retrieve your instance's IssueType Name

# listings via the following URI: https://[your-jira-domain-name]/rest/api/2/issuetype/

# Multiple comma-separated values can be specified.

feature.jiraIssueTypeNames=Story,Task,Sub-task

# In Jira, your instance will have its own custom field created for "sprint" or "timebox" details,

# which includes a list of information. This field allows you to specify that data field for your

# instance of Jira. Note: You can retrieve your instance's sprint data field name

# via the following URI, and look for a package name com.atlassian.greenhopper.service.sprint.Sprint;

# your custom field name describes the values in this field:

# https://[your-jira-domain-name]/rest/api/2/issue/[some-issue-name]

feature.jiraSprintDataFieldName=customfield_10104

# In Jira, your instance will have its own custom field created for "super story" or "epic" back-end ID,

# which includes a list of information. This field allows you to specify that data field for your instance

# of Jira. Note: You can retrieve your instance's epic ID field name via the following URI where your

# queried user story issue has a super issue (e.g., epic) tied to it; your custom field name describes the

# epic value you expect to see, and is the only field that does this for a given issue:

# https://[your-jira-domain-name]/rest/api/2/issue/[some-issue-name]

feature.jiraEpicIdFieldName=customfield_10400

# In Jira, your instance will have its own custom field created for "story points"

# This field allows you to specify that data field for your instance

# of Jira. Note: You can retrieve your instance's storypoints ID field name via the following URI where your

# queried user story issue has story points set on it; your custom field name describes the

# story points value you expect to see:

# https://[your-jira-domain-name]/rest/api/2/issue/[some-issue-name]

feature.jiraStoryPointsFieldName=customfield_10002

# In Jira, your instance will have its own custom field created for "team"

# This field allows you to specify that data field for your instance

# of Jira. Note: You can retrieve your instance's team ID field name via the following URI where your

# queried user story issue has team set on it; your custom field name describes the

# team value you expect to see:

# https://[your-jira-domain-name]/rest/api/2/issue/[some-issue-name]

feature.jiraTeamFieldName=

# Set this to true if you use boards as team

feature.jiraBoardAsTeam=false



2. Code Repo配置

先配置好properties文件,在命令窗口执行:

java -jargithub-scm-collector-2.0.5-SNAPSHOT.jar --spring.config.location=\Hygieia\collectors\scm\github\src\main\resources\application.properties

#Database Name

dbname=dashboard

#Database HostName - default is localhost

dbhost=localhost

 #Database Port - default is 27017

dbport=27017

#Database Username - default is blank

dbusername=db

#Database Password - default is blank

dbpassword=dbpwd

#Collector schedule (required)

github.cron=0 */15 * * * *

github.host=github.com

#Maximum number of days to go back in time when fetching commits

github.commitThresholdDays=60

#Optional: Error threshold count after which collector stops collecting for a collector item. Default is 2.

github.errorThreshold=3

#This is the key generated using the Encryption class in core

github.key=

#personal access token generated from github and used for making authentiated calls

github.personalAccessToken=6dXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


3. Quality 配置

先配置好properties文件,在命令窗口执行:

java -jar sonar-codequality-collector-2.0.5-SNAPSHOT.jar --spring.config.location=\Hygieia\collectors\build\sonar\src\main\resources\application.properties

#Database Name

dbname=dashboard

#Database HostName - default is localhost

dbhost=localhost

#Database Port - default is 27017

dbport=27017

#Database Username - default is blank

dbusername=db

#Database Password - default is blank

dbpassword=dbpwd

#Collector schedule (required)

sonar.cron=0 */5 * * * *

sonar.servers[0]=http://localhost:9000

#Sonar Authentication Username - default is blank

sonar.username=username

#Sonar Authentication Password - default is blank

sonar.password=pwd

#Sonar Metrics

sonar.metrics[0]=ncloc,line_coverage,violations,critical_violations,major_violations,blocker_violations,sqale_index,test_success_density,test_failures,test_errors,tests

#Sonar Version - see above for semantics between version/metrics

sonar.versions[0]=6.6


4. Build 配置

先配置好properties文件,在命令窗口执行:

java -jar jenkins-build-collector-2.0.5-SNAPSHOT.jar --spring.config.location=\Hygieia\collectors\build\jenkins\src\main\resources\application.properties

#Database Name

dbname=dashboard

# Database HostName - default is localhost

dbhost=localhost

# Database Port - default is 27017

dbport=27017

#Database Username - default is blank

dbusername=db

#Database Password - default is blank

dbpassword=dbpwd

#Collector schedule (required)

jenkins.cron=0 */5 * * * *

#The page size

jenkins.pageSize=1000

# The folder depth - default is 10

jenkins.folderDepth=10

#Jenkins server (required) - Can provide multiple

#jenkins.servers[0]=http://jenkins.company.com

#jenkins.niceNames[0]=[YourJenkins]

#jenkins.environments[0]=[DEV,QA,INT,PERF,PROD]

#Another option: If using same username/password Jenkins auth - set username/apiKey to use HTTP Basic Auth (blank=no auth)

jenkins.servers[0]=http://localhost:8080/jenkins

jenkins.usernames[0]=username

jenkins.apiKeys[0]=pwd

jenkins.niceNames[0]=

#Determines if build console log is collected - defaults to false

jenkins.saveLog=true



©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 215,245评论 6 497
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 91,749评论 3 391
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 160,960评论 0 350
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 57,575评论 1 288
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 66,668评论 6 388
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 50,670评论 1 294
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,664评论 3 415
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,422评论 0 270
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,864评论 1 307
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,178评论 2 331
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,340评论 1 344
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,015评论 5 340
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,646评论 3 323
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,265评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,494评论 1 268
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,261评论 2 368
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,206评论 2 352

推荐阅读更多精彩内容