1. 安裝Java辞色、Maven和Git(略)
2. 安裝MongoDB
下載地址:https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2.6.1.zip
2.1. 安裝
##store data here
dbpath=C:\software\mongodb\data
##all output go here
logpath=C:\software\mongodb\log\mongo.log
##log read and write operations
diaglog=3
2.2. 啟動(dòng)和創(chuàng)建用戶
C:\Users\Administrator>mongod --dbpath=C:\software\mongodb
db.createUser({user: "dashboarduser",pwd: "dashboarduser123", roles: [ {role: "readWrite", db: "dashboarddb"}]})
順便提及一下無關(guān)的一個(gè)命令:
> show dbs;
admin 0.078GB
dashboard 0.078GB
dashboarddb 0.078GB
local 0.078GB
> use dashboarddb
switched to db dashboarddb
> db.collectors.find()
3. 安裝Nodejs
下載地址: https://nodejs.org/en/download/
安裝好后(沒有特殊的地方乳幸,這里略去):
- 設(shè)置path變量到安裝目錄的bin子目錄
-
依次執(zhí)行兩個(gè)npm命令喂急,可能需要設(shè)置一下代理
2.1 C:\Users\Administrator>npm install -g bower
Bower是一個(gè)客戶端技術(shù)的軟件包管理器缰贝,它可用于搜索肥印、安裝和卸載如javascript、HTML、CSS之類的網(wǎng)絡(luò)資源
2.2 C:\Users\Administrator>npm install -g gulp
也可在命令里面指明淘寶鏡像:npm install -g gulp --registry=https://registry.npm.taobao.org
4. 安裝RoboMongo (or) Admin Mongo
https://robomongo.org/download
5. 下載源碼進(jìn)行編譯
D:\gitProject>git clone https://github.com/Hygieia/hygieia-core.git
D:\gitProject>git clone https://github.com/capitalone/Hygieia.git
1.2 構(gòu)建源代碼
代碼下載地址:https://github.com/capitalone/Hygieia/releases/
D:\gitProject>cd hygieia-core
D:\gitProject\hygieia-core>mvn clean install package -Dmaven.test.skip=true -Dpmd.failOnViolation=false
D:\softwareback\devops\hygieia\Hygieia-3.0.0\mvn clean install package -Dmaven.test.skip=true -Dpmd.failOnViolation=false
接下來:
6. 啟動(dòng)
1啟動(dòng)monngodb服務(wù)
mongod --dbpath=C:\software\mongodb
2 啟動(dòng)api服務(wù)
2.1 增加一個(gè)dashboard.properties配置文件
#dashboard.properties文件內(nèi)容:
dbname=dashboarddb
dbhost=localhost
dbport=27017
2.2 啟動(dòng)API
說明:我增加了一個(gè)
D:\softwareback\devops\hygieia\Hygieia-3.0.2\api\target\classes\application.properties:
dbname=dashboard
dbhost=127.0.0.1
dbport=11500
server.contextPath=/api
server.port=8080
但是實(shí)際上根本不需要
java -jar D:\softwareback\devops\hygieia\Hygieia-3.0.2\api\target\api.jar --spring.config.location=D:\softwareback\devops\hygieia\Hygieia-3.0.2\api\dashboard.properties
3 collectors組件Feature監(jiān)控
3.1 Jira
application.properties:
#Collector schedule (required)
dbname=dashboarddb
#dbhost=localhost
#dbport=27017
feature.cron=*/30 * * * * ?
#feature.cron=0 */5 * * * *
#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
# Trending Query: Length of sprint week (not-required)
#feature.sprintEndPrior=2
#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://10.45.*.*:8080
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=MT*****************************Iz
#Start dates from which to begin collector data, if no other data is present - usually, a month back is appropriate (required)
feature.deltaStartDate=2019-02-01T00:00:00.000000
feature.masterStartDate=2019-02-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,Epic,Task,Sub-task
feature.jiraIssueTypeNames=故事,缺陷,任務(wù),子任務(wù),Epic
# 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_10001
# 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_11800
#feature.jiraEpicIdFieldName=customfield_10008
#customfield_11800
# 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_10006
# 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
feature.jiraBoardAsTeam=true
#Story,Bug,Task,Sub-Task,Epic
feature.jiraStoryIds[0]=11739
feature.jiraStoryIds[1]=11900
feature.jiraStoryIds[2]=10106
feature.jiraStoryIds[3]=10102
feature.jiraEpicId=11800
啟動(dòng):
Java -jar D:\softwareback\devops\hygieia\Hygieia-3.0.2\collectors\feature\jira\target\jira-feature-collector.jar --spring.config.name=feature --spring.config.location=D:\softwareback\devops\hygieia\Hygieia-3.0.2\collectors\feature\jira\target\classes\application.properties
3.2 Jenkins
application.properties:
#Database Name
dbname=dashboarddb
#jenkins.servers[0]=http://localhost:8181/jenkins/
jenkins.servers[0]=http://10.45.136.151:9999/
jenkins.usernames[0]=yay
jenkins.apiKeys[0]=116ed4863f449d202f58e4fa290171a2b3
#上面是API Tokens困肩,在Jenkins用戶里面可以配置
#Collector schedule (required)
jenkins.cron=0 0/5 * * * *
jenkins.saveLog=true
啟動(dòng):
java -jar D:\softwareback\devops\hygieia\Hygieia-3.0.2\collectors\build\jenkins\target\jenkins-build-collector-3.0.1.jar --spring.config.location=D:\softwareback\devops\hygieia\Hygieia-3.0.2\collectors\build\jenkins\application.properties
3.3 SCM倉庫----github
D:\softwareback\devops\hygieia\Hygieia-3.0.2\collectors\scm\github\target\classes\application.properties:
#Database Name
dbname=dashboarddb
#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=10
#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=
#github.personalAccessToken=fc5ae511dc0a8fc5cb27629ab2f6601718872610
#dbusername=dashboarduser
#dbpassword=dashboarduser123
啟動(dòng)命令(我寫了一個(gè)bat文件):
title "github collector"
java -jar D:\softwareback\devops\hygieia\Hygieia-3.0.2\collectors\scm\github\target\github-scm-collector-3.0.1.jar --spring.config.location=D:\softwareback\devops\hygieia\Hygieia-3.0.2\collectors\scm\github\target\classes\application.properties
配置如下:看到的效果為:
提示:發(fā)現(xiàn)很有必要在遇到“JWT validity cannot be asserted and should not be trusted”錯(cuò)誤時(shí)候,把瀏覽器cookie清空:
3.4 SCM倉庫----svn
# Database Name
dbname=dashboarddb
# Database HostName - default is localhost
dbhost=localhost
# Database Port - default is 27017
dbport=27017
# Logging File location
#logging.file=./logs/subversion.log
# Collector schedule (required)
subversion.cron=*/30 * * * * ?
#subversion.cron=0 0/5 * * * *
#subversion.cron=0 */15 * * * *
#注意下面這種地址不要配置脆侮,用戶和口令也不要配置
#subversion.host=https://10.45.136.230/svn/ZYN/HGARCH/branch/V1.0/code/personrecord
# Maximum number of previous days from current date, when fetching commits
subversion.commitThresholdDays=30
啟動(dòng)(我建了一個(gè)bat文件僻弹,內(nèi)容如下):
title "svn collector"
java -jar D:\softwareback\devops\hygieia\Hygieia-3.0.2\collectors\scm\subversion\target\subversion-collector-3.0.1.jar --spring.config.name=subversion --spring.config.location=D:\softwareback\devops\hygieia\Hygieia-3.0.2\collectors\scm\subversion\target\classes\application.properties
3.5 sonar
- ) 啟動(dòng)ui
cd D:\softwareback\devops\hygieia\Hygieia-3.0.2\UI\
gulp serve