Studenten Net Twente offers free GitLab Runners students and staff at the University of Twente. There runners can be used as you want, in a reasonably manner. See the rules of GitLab, which apply.
We currently offer Docker and Virtualbox based runners.
Docker
Docker runners are the default, and using them is simple:
specify the image you want to use with image
, eg:
image: ruby:latest
The default is debian:latest
.
Also see the .gitlab-ci.yml
documentation.
Virtualbox
The virtualbox runner is mainly meant for building Docker images so they can be published on the GitLab Container Registry.
The virtualbox runner can be used by specifying the docker-build
or virtualbox
tag.
Note that there is no root (or sudo) access inside the virtual machine.
The following .gitlab-ci.yml
builds a docker image and uploads it to the GitLab Container Registry:
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
build-master:
stage: build
tags: [docker-build]
script:
- docker build --pull -t "$CI_REGISTRY_IMAGE" .
- docker push "$CI_REGISTRY_IMAGE"
only:
- master
build:
stage: build
tags: [docker-build]
script:
- docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" .
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
except:
- master
This creates images as follows:
- From branch
master
:
registry.snt.utwente.nl/<group>/<project>:latest
- From branch
develop
:
registry.snt.utwente.nl/<group>/<project>:develop
- From tag
v1.1.2
:
registry.snt.utwente.nl/<group>/<project>:v1.1.2
Also see the .gitlab-ci.yml
documentation,
and the Container Registry documentation.