Skip to content

Working with GitLab

The DTaaS platform uses GitLab for two purposes:

  1. OAuth 2.0 authorization service
  2. DevOps service

The admin documentation covers the OAuth 2.0 authorization configuration. This guide covers the git commands and project structure for the GitLab DevOps service within the DTaaS.

Preparation

First, create a GitLab project named after your username in the GitLab group named dtaas.

GitLab project create

The user must have ownership permissions over the project.

Project ownership

Warning

By default, the DTaaS website expects a branch named master to exist and performs all git operations on it. A different branch can be set in the Branch Name field of the settings page.

Git commands

Use the standard git commands and workflows. A GitLab project can be used as a remote git server in two ways:

  1. Over SSH using a personal SSH key
  2. Over HTTPS using personal access tokens (PAT)

This tutorial uses a PAT to work with the GitLab server.

First, create a PAT under User settings > Access > Personal access tokens with Generate token > Legacy token, and tick the write_repository scope.

Create PAT

Copy the token and use it to clone the git repository.

Library Assets

GitLab stores the reusable Library assets of all users. Library assets, including digital twins, must follow a mandatory structure. A properly initialized GitLab project has the following structure.

Project structure

Pay special attention to .gitlab-ci.yml. It must be a valid GitLab DevOps configuration. The example repo has a sample structure.

For example, with PAT1 as the PAT for the dtaas/user1 repository, the command to clone the repository is:

1
2
3
$git clone \
  https://user1:PAT1@dtaas-digitaltwin.com/gitlab/dtaas/user1.git
$cd user1

After adding the required Library assets:

$git push origin

Next Steps

A GitLab runner must be linked to the project repository. Some runners may already be installed with the DTaaS platform; check the runners page of the GitLab project. You can also install custom runners and link them to the repository.

You can then use the Digital Twins Page to access the DevOps features of the DTaaS platform.