A gitlab instance with a predefined user and projects.
- Shell 87%
- Dockerfile 13%
| .gitlab-ci.yml | ||
| build-image.sh | ||
| configure.sh | ||
| Dockerfile | ||
| get-accesstoken | ||
| get-sshkey | ||
| get-userpassword | ||
| README.md | ||
| wait-until-gitlab-has-started | ||
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"