User Guide: CI/CD Integration: GitLab
DV8 User Guide 4.0 - GitLab CI/CD Integration
GitLab CI/CD Integration
There are two ways to integrate DV8 with GitLab for CI/CD: the manual approach and using Docker. Both methods allow you to run DV8’s archreport
on each commit of your repository.
Option 1: Manual
This approach will run the DV8 job on a machine within your organization.
- Install DV8 on a machine within your organization using the directions available here. Ensure that the PATH is updated so
dv8-console
is available from the terminal/command prompt. - Install GitLab Runner on that same machine using the directions available here.
- From your GitLab repository, navigate to Settings > CI/CD > Runners and click "New project runner".

- Enter a single tag:
dv8
and leave everything else to their default settings. Click "Create runner". - Follow the directions to register your runner.
- Add an
.archreport-ci.properties
file to the root of your repository. A full sample version of this file is included in the installation package, located in thedv8-explorer/sample-configurations
folder. Below is a minimal example:
outputFolder: archreport
projectName: <YOUR_PROJECT_NAME_HERE>
sourceType: code
sourceCodePath: .
sourceCodeLanguage: java
dsmOutputFormat: json
clusteringOutputFormat: json
revisionHistoryType: git
- Add a
.gitlab-ci.yml
to the root of your repository if it does not already exist. Below is a minimal example:
dv8:
script:
- dv8-console arch-report -paramsFile .archreport-ci.properties
tags:
- dv8
artifacts:
name: "archreport-${CI_COMMIT_SHORT_SHA}"
paths:
- archreport/
expire_in: never
- After your next commit, you will be able to download the archreport for your GitLab project in Build > Jobs > Download artifacts.
Option 2: Docker
This approach can run the DV8 job on a machine within your organization or on GitLab's cloud. Currently, this requires a running license server. You can contact us at support@archdia.com for more information.
- From your GitLab repository, navigate to Settings > CI/CD > Variables. Add a new variable called
DV8_RELAY_URL
containing the URL to your DV8 license server. - Add an
.archreport-ci.properties
file to the root of your repository. A full sample version of this file is included in the installation package, located in thedv8-explorer/sample-configurations
folder. Below is a minimal example:
outputFolder: archreport
projectName: <YOUR_PROJECT_NAME_HERE>
sourceType: code
sourceCodePath: .
sourceCodeLanguage: java
dsmOutputFormat: json
clusteringOutputFormat: json
revisionHistoryType: git
- Add a
.gitlab-ci.yml
to the root of your repository if it does not already exist. Below is the recommended way to specify the DV8 job. This will run archreport on your repository using the dv8-console image.
dv8:
image: archdia/dv8-console:5.1.0
script:
- dv8-console arch-report -paramsFile .archreport-ci.properties
artifacts:
name: "archreport-${CI_COMMIT_SHORT_SHA}"
paths:
- archreport/
expire_in: never
- After your next commit, you will be able to download the archreport for your GitLab project in Build > Jobs > Download artifacts.