Run the following command to build all components for Hygieia.

mvn clean install package

The following components are required to run Hygieia℠

Hygieia uses MongoDB 3.0 + version. We recommend that you download MongoDB clients(RoboMongo etc) to connect to your local running Database and make sure that database: dashboard is created and you are successfully able to connect to it.

  • MongoDB Download and Install instructions
  • Configure MongoDB
    • Go to the bin directory of your mongodb installation and run the following command to start the mongodb do make sure that data directory should pre-exist at the target location
    •   mongod --dbpath [ path to the data directory] 

      for e.g

        /usr/bin/mongodb-linux-x86_64-2.6.3/bin/mongod --dbpath /dev/data/db 

    • Run the following commands as shown below at mongodb command prompt /usr/bin/mongodb-linux-x86_64-2.6.3/bin/mongo
    •     $ mongo
          MongoDB shell version: 3.0.4
          connecting to: test
      
          > use dashboard
          switched to db dashboard
          > db.createUser(
          {
            user: "db",
            pwd: "dbpass",
            roles: [
            {role: "readWrite", db: "dashboard"}
            ]
          })
          Successfully added user: {
            "user" : "dbuser",
            "roles" : [
            {
              "role" : "readWrite",
              "db" : "dashboard"
            }
            ]
            }

Please click on this link to learn about how to build and run the UI layer.

Please click on this link to learn about the API Layer set-up.

In general all the collectors can be run using the following command:

    java -jar  --spring.config.name= --spring.config.location=

For each individual collector setup click on the links below:

You can pick and choose which collectors are applicable for your DevOps toolset or you can write your own collector and plug it in.

You can use Jenkins - Hygieia plugin to publish data from Jenkins to Hygieia. Currently, you can publish build, artifact info, sonar results, deployment results and cucumber test results. You may not need to run corresponding collectors if you use Jenkins for build, deploy, sonar analysis and running cucumber tests.

You can use GitHub webhook to publish commit information to Hygieia. If you use webhook, you will not need to run github collector. Your Github webhook's payload url should be set to: http://hygieia-base-url/api/commit/github/v3
  • Select to publish just the "push" events
  • Configure Proxy

Hygieia supports proxy authentication for working behind corporate firewalls. For development, please refer to the following configuration differences; for deployment/operations, please refer to the subsequent sub-section:

  1. Proxy Config: Developer / Operations

  2. Update your Maven settings.xml file:

          ...
          
                 ...
                 
                         your-proxy-id
                         true
                         http
                         your.proxy.domain.name
                         8080
                         
                         companyId999
                         yourPassword
                         *.local
                 
                 ...
           
          ...

    Additionally, set the following export variables:

        export HTTP_PROXY=http://companyId999:yourPassword@your.proxy.domain.name:8080
        export HTTPS_PROXY=http://companyId999:yourPassword@your.proxy.domain.name:8080
        export JAVA_OPTS="$JAVA_OPTS -Dhttp.proxyHost=your.proxy.domain.name -Dhttp.proxyPort=8080 -Dhttp.proxyUser=companyId999 -Dhttp.proxyPassword=yourPassword"
    
        # This option may be duplicative if you have already updated your
        # Maven settings.xml file, but will only help:
        export MAVEN_OPTS="$MAVEN_OPTS -Dhttp.proxyHost=your.proxy.domain.name -Dhttp.proxyPort=8080 -Dhttp.proxyUser=companyId999 -Dhttp.proxyPassword=yourPassword"
        Tests should now run/pass when built from behind a corporate proxy, even if it is an authenticated proxy
  3. Proxy Config: Deployment / Operations

  4. Only the above proxy settings (non authentication) may required to be set on your deployment instance. Additionally, please updated all property files for each collector/API configuration with their specific proxy setting property.

  • Execute the following command to build the containers.
    mvn docker:build
  • Execute the following command to bring up the container images.
    docker-compose up -d
  • Create user in mongo (if you log into the container then you dont have to install mongo locally)
    docker exec -t -i mongodb2 bash
    mongo 192.168.64.2/admin  --eval 'db.getSiblingDB("dashboard").createUser({user: "db", pwd: "dbpass", roles: [{role: "readWrite", db: "dashboard"}]})'
  
  • Create a docker-compose.override.yml to configure your environment

These are the most common entries, the uncommented ones are mandatory if you want the collector to work. For dev/testing you will find it useful to change the CRON entries to "0 * * * * *" hygieia-github-scm-collector:

      environment:
      - GITHUB_HOST=github.com
      - GITHUB_CRON=0 * * * * *
      - GITHUB_COMMIT_THRESHOLD_DAYS=300
    hygieia-jira-feature-collector:
      environment:
      - JIRA_BASE_URL=https://mycompany.atlassian.net/
      - JIRA_CREDENTIALS=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
      - JIRA_ISSUE_TYPE_ID=10200
      - JIRA_SPRINT_DATA_FIELD_NAME=customfield_10007
      - JIRA_EPIC_FIELD_NAME=customfield_10008
    hygieia-jenkins-build-collector:
      environment:
      - JENKINS_CRON=0 * * * * *
      - JENKINS_MASTER=http://192.168.99.100:9100
      - JENKINS_USERNAME=XXXXXXXXXXXXXXXXXXXXXX
      - JENKINS_API_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXX
    hygieia-jenkins-cucumber-test-collector:
      environment:
      - JENKINS_CRON=0 * * * * *
      - JENKINS_MASTER=http://192.168.99.100:9100
      - JENKINS_USERNAME=XXXXXXXXXXXXXXXXXXXXXX
      - JENKINS_API_KEY=XXXXXXXXXXXXXXXXX
      - JENKINS_CUCUMBER_JSON_FILENAME=cucumber-report.json
    hygieia-sonar-codequality-collector:
      environment:
      - SONAR_URL=http://192.168.99.100:9000
      - SONAR_CRON=0 * * * * *
    Make sure everything is restarted it may fail if the user doesn't exist at start up time
    docker-compose restart
    Get the port for the UI
    docker port hygieia-ui
  
  1. Setup Git

  2. Configure it to point to the github master branch for Hygieia

      a. In the SCM panel, select 'git'
      b. Enter the URL: 'https://github.com/capitalone/Hygieia.git' (without the quotes)
      c. Set the branch to 'master' (without the quotes)
      Note: For this to work you will need to have set your credentials on the ID that the collectors is running under, the best way to do this is first clone the repo to set your credentials.
      
  3. Setup SONAR

  4. Run a test instance of SONAR

        a. docker-compose -f test-servers/sonar/sonar.yml up -d
        b. Fill it with data from the Hygieia project
        mvn sonar:sonar -Dsonar.host.url=http://$(docker-machine ip default):9000 -Dsonar.jdbc.url="jdbc:h2:tcp://$(docker-machine ip default)/sonar"
        c. You can now go in and configure the quality panel in the UI.
  5. Setup Jenkins

  6. Start a test Jenkins Master
    Output will be in cucumber.

        a. docker-compose -f test-servers/jenkins/jenkins.yml up -d
        b. Run the job: http://192.168.99.100:9100/job/Hygieia_Example_Job/build
        c. Configure the Jenkins Build and Jenkins Cucumber panels using this jobs output.