A gitlab instance with a predefined user and projects.
This repository has been archived on 2026-05-06. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
  • Shell 87%
  • Dockerfile 13%
Find a file
2018-09-30 10:30:57 +00:00
.gitlab-ci.yml replaced 'curl -fsSl' by 'curl -fsSL' 2018-09-30 10:30:57 +00:00
build-image.sh Updated gitlab from 11.0.1-ce0 to 11.2.3-ce.0 2018-09-21 18:18:42 +00:00
configure.sh removed some dedundant test repos; fixed some bugs 2018-09-16 14:54:11 +02:00
Dockerfile create different types of groups and repositories 2018-09-16 13:38:59 +02:00
get-accesstoken first working version of the docker image 2018-07-25 00:53:22 +02:00
get-sshkey first working version of the docker image 2018-07-25 00:53:22 +02:00
get-userpassword first working version of the docker image 2018-07-25 00:53:22 +02:00
README.md new script: wait-until-gitlab-has-started 2018-07-25 01:33:36 +02:00
wait-until-gitlab-has-started new script: wait-until-gitlab-has-started 2018-07-25 01:33:36 +02:00

gitlab-testinstance

A gitlab instance with a predefined user and projects.

Run the container and wait until gitlab has started

docker run -d --name gitlab-testinstance -p 80:80 -p 22:22 thomass/gitlab-testinstance
docker exec gitlab-testinstance wait-until-gitlab-has-started

Get user / password to login to WebGUI

docker run --rm thomass/gitlab-testinstance get-userpassword

The output contains two lines, where the first one contains the username and the second one the password.

Get private key for git+ssh access

mkdir /path/to/store
docker run --rm thomass/gitlab-testinstance get-sshkey > /path/to/store/thekey
chmod 0700 /path/to/store
chmod 0600 /path/to/store/thekey

From a running container you could then clone the repository with:

GIT_SSH_COMMAND="ssh -i /path/to/store/thekey" git clone git@localhost:root/repo1.git

Get the access token to query the API

access_token=$(docker run --rm thomass/gitlab-testinstance get-accesstoken)

From a running container you should then be able to query the API like follows:

curl --header "Private-Token: ${access_token}" "http://localhost:8080/api/v4/projects"