GitLab

New Repository

To create a new repository:

  • Log into https://gitlab.com/ using our company login details.
  • Click on New Project.
  • In the Project path section select the kb group. Select the correct Visibility Level and click Create Project.
  • You should now be able to clone the repository, add a README.rst file and then push.
  • Go to the project Settings, Repository, and scroll down to Protected branches and unprotect the master branch so developers can push to it.

To move a repository from GitHub to GitLab: Migrate from GitHub

Continuous Integration

Tip

To set-up a runner see Continuous Integration.

Tip

To set-up GitLab Multi-Runner and Docker, see the following section…

GitLab Multi-Runner and Docker

From Install using official GitLab repositories

Install Docker: https://www.pkimber.net/howto/linux/apps/docker/getting-started.html

Create a Docker image, by following the instructions in the README.rst file in https://gitlab.com/kb/gitlab-pytest

Install gitlab-ci-multi-runner:

curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.deb.sh | sudo bash
apt-get install gitlab-ci-multi-runner

Tip

Register the runner using sudo because you cannot enable the service unless you are root.

Set-up:

sudo -i
gitlab-ci-multi-runner register

Sample output:

Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/ci):
https://gitlab.com/ci
Please enter the gitlab-ci token for this runner:
eaeae123ababa
Please enter the gitlab-ci description for this runner:
[master-b]: ci.kbsoftware.co.uk
Please enter the gitlab-ci tags for this runner (comma separated):
INFO[0204] eabd2c42 Registering runner... succeeded
Please enter the executor: shell, parallels, docker, docker-ssh, ssh:
docker
Please enter the Docker image (eg. ruby:2.1):
pkimber/gitlab-pytest
If you want to enable mysql please enter version (X.Y) or enter latest?
If you want to enable postgres please enter version (X.Y) or enter latest?
If you want to enable redis please enter version (X.Y) or enter latest?
If you want to enable mongo please enter version (X.Y) or enter latest?
INFO[0498] Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!

Run in debug mode:

gitlab-runner --debug run

To start the service:

gitlab-runner start

To set-up Continuous Integration for the project, see Continuous Integration.