UNCLASSIFIED

README.md 3.31 KB
Newer Older
Chris Byrd's avatar
Init  
Chris Byrd committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
---
title: Gitlab Collector
tags:
keywords:
summary:
sidebar: hygieia_sidebar
permalink: gitlab.html
---
Configure the Gitlab Collector to display and monitor information (related to code contribution activities) on the Hygieia Dashboard, from the Gitlab repository. Collect source code details from Gitlab based on the repository URL.

This project uses Spring Boot to package the collector as an executable JAR file with dependencies.

### Setup Instructions

*   **Set Parameters via environment variables to create the Application Properties File or reference existing properties file**

Environment Variables:

There are two added properties to assist configuration:

```
    SKIP_PROPERTIES_BUILDER: Boolean (true or false).  Defaults to true.  For creating the application.properties file from environment variables.
    PROP_FILE: Location of the properties file.  Default: /app/config/application.properties
```
The remaining properties map as such to the below sample configuration:

```
GITLAB_USE_PROJECT_ID: gitlab.useProjectId
DB_NAME: dbname
DB_HOST: dbhost
DB_PORT: dbport
DB_REPLICA_SET: Boolean ('true' or 'false')
DB_HOST_PORT: dbhostport
DB_USERNAME: dbusername
DB_PASSWORD: dbpassword
LOGS_PATH: logging.file
COLLECTOR_CRON : gitlab.cron
GITLAB_HOST: gitlab.host
GITLAB_PROTOCOL: gitlab.protocol
GITLAB_PORT: gitlab.port
GITLAB_PATH: gitlab.path
GITLAB_SELF_SIGNED_CERT: gitlab.selfSignedCertificate
GITLAB_API_TOKEN: gitlab.apiToken
GITLAB_COMMIT_THREASHOLD_DAYS: gitlab.commitThresholdDays
GITLAB_KEY: gitlab.key
```

### Sample Application Properties File

The sample `application.properties` file lists parameter values to configure the Gitlab Collector. Set the parameters based on your environment setup.
``` 
		# Database Name
		dbname=dashboarddb

		# Database HostName - default is localhost
		dbhost=localhost

		# Database Port - default is 27017
		dbport=27017

		# MongoDB replicaset
		dbreplicaset=[false if you are not using MongoDB replicaset]
		dbhostport=[host1:port1,host2:port2,host3:port3]

		# Database Username - default is blank
		dbusername=dashboarduser

		# Database Password - default is blank
		dbpassword=dbpassword

		# Logging File location
		logging.file=./logs/gitlab.log

		#Collector schedule (required)
		gitlab.cron=0 0/1 * * * *

		#Gitlab host (optional, defaults to 'gitlab.com')
		gitlab.host=gitlab.company.com

		#Gitlab protocol (optional, defaults to 'http')
		gitlab.protocol=http

        #If enabled, dashboard URL configured in UI follows this example <gitlab.protocol>://<gitlab.host>/<gitlab_project_id>
		#gitlab.useProjectId (optional, defaults to false)

		#Gitlab port (optional, defaults to protocol default port)
		gitlab.port=80

		#Gitlab path (optional, if your instance of gitlab requires a path)
		gitlab.path=/gitlab/resides/here

		#If your instance of Gitlab is using a self-signed certificate, set to true, default is false
		gitlab.selfSignedCertificate=false

		#Gitlab API Token (required, user token the collector will use by default, can be overridden on a per repo basis from the UI. API token provided by Gitlab)
		gitlab.apiToken=

		#Maximum number of previous days from current date, when fetching commits
		gitlab.commitThresholdDays=15
		
		# Gitlab key for private repos
		gitlab.key=<your-generated-key>
```

For more information visit: https://hygieia.github.io/Hygieia/gitlab.html
Joshua Eason's avatar
Joshua Eason committed
106