Setup

Installation

The platform connector is supplied as a Docker image. You can retrieve it from Docker hub with:

docker login
docker pull diffblue/cover-gitlab-release

To run it, you will need to set some environment variables. You can retrieve the variables to set in .env file format with the command:

docker run diffblue/cover-gitlab-release cat .env.example > diffblue-gitlab-connector.env

You can either customize this file and pass it to Docker with the --env-file option, or use it as a guide to setting up variables for Kubernetes or whatever system you use to orchestrate Docker machines.

The simplest way to run the connector locally with Docker is as follows:

docker run -it --env-file diffblue-gitlab-connector.env docker run -p 80:8084 diffblue/cover-gitlab-release

Global configuration

  1. Create a user on GitLab for Diffblue (e.g. called Diffblue-cover-bot). Set an icon etc.
  2. Create a Personal access token for the above user
  3. Set the env var DIFFBLUE_GITLAB_TOKEN to the above
  4. Set the env var DIFFBLUE_GITLAB_ADDR to the GitLab API root (e.g. https://gitlab.com/api)

SSL setup

If the env vars DIFFBLUE_PERMISSIVE_SSL_PLATFORM or DIFFBLUE_PERMISSIVE_SSL_GITLAB are set to true, requests to the respective server will accept bad SSL certificates.

To serve SSL, ensure you set the DIFFBLUE_GITLAB_EXPOSE_SSL_PORT environment variable to a port number. To use a certificate and key, put them in files named certificate.crt and private.key and mount them as a volume called ssl, e.g. docker run -v ${PWD}/ssl:ssl [container name]. If you do not provide a certificate and key, a self-signed one will be generated at start up and used.

3rd party library licenses

Licenses are written to LICENSES.txt at Docker build time, so they can be viewed with:

docker run eu.gcr.io/diffblue-cr/gitlab cat LICENSES.txt

This file is also shared at the /LICENSES route.

Config env var reference

DIFFBLUE_GITLAB_IMAGEPATH

Optional URL path to folder containing spinner.svg. Passed to GitLab message templates as imagePath so you can do <image src="{{imagePath}}/spinner.svg" /> or similar.

DIFFBLUE_API_ADDR

Address of the Diffblue platform. If talking to the front end, ends in API. If talking directly to an API server, it does not.

DIFFBLUE_GITLAB_ADDR

Address of GitLab service, e.g. https://gitlab.com/api

DIFFBLUE_GITLAB_EXPOSE_PORT

Port that service should listen on with http, e.g. 80. Defaults to 8084.

DIFFBLUE_GITLAB_EXPOSE_SSL_PORT

Port that service should listen on with https. Defaults to not listening on https.

DIFFBLUE_GITLAB_TOKEN

Token to log in to GitLab

DIFFBLUE_GIT_AUTHOR

Author name to use for committing tests, e.g. "Diffblue cover bot"

DIFFBLUE_GIT_EMAIL

Email address to use for committing tests, e.g. "cover-bot@diffblue.com"

DIFFBLUE_PERMISSIVE_SSL_PLATFORM

If set to "true" don't verify ssl certificate when connecting to Diffblue platform

DIFFBLUE_PERMISSIVE_SSL_GITLAB

If set to "true" don't verify ssl certificate when connecting to GitLab instance

LOGFILE

(optional) filename to save logs to. If not specified, logs will only be displayed on the console. Note that if you do specify a filename, it will be inside the Docker container, so you will want to share a volume or otherwise handle the logs.

LOGLEVEL

Log level to show. Set to "info" for a normal amount of logs, "error" to only log errors, or "debug" to get more logging information that you can send to support.

© 2019 Diffblue Limited. All Rights Reserved.

results matching ""

    No results matching ""