Gitlab hero border pattern left svg Gitlab hero border pattern right svg

Testing Environment

Testing Environment License

For a test license you can log into the license app with your GitLab login. You can use one of the shared licenses or if you need special add-ons, such as geo, you can generate a new one.

Please keep in mind you can't generate licenses for customers only for testing purposes. To generate a new license, log in to the license app and click on the 'New License' green button on the right side of the screen. Click on "You can also manually create a license without a Zuora subscription" at the bottom of the screen and fill out all non-optional fields.

Ephemeral Testing Environments

As a member of support, you have access to a variety of ephemeral testing environments. You can build and tear down whatever resources you need to reproduce customer environments, try new features or learn about deploying a new topology.

The resources that are created in these environments are:

Digital Ocean and Docker Testing Environment

For a Digital Ocean and Docker testing environment (droplet) follow this guide. Once you've gone through all the steps excluding Usage you can skip to the below section named Creating Gitlab test instance.

GCP Testing Environment

For a GCP Testing environment, you should have access to the support-internal project as a baseline entitlement. If you do not, please create an access request and tag your manager.

AWS Testing Environment

AWS credentials and instructions are stored in the Support Vault.

Azure Testing Environment

If you need access to Azure for testing, please create an access request and tag your manager.

Persistent Local Environments

VMWare Testing Environment

This guide involves configuring and setting up VMWare and Docker locally and assumes you're using Mac OS X.

Install VMWare

Install Docker Community Edition

  1. https://www.docker.com/community-edition

Create new docker host

This command will create a new VMware fusion virtual machine called gitlab-test-env that will act as a docker host.

docker-machine create \
--vmwarefusion-cpu-count -1 \
--vmwarefusion-memory-size 4096 \
--vmwarefusion-disk-size 30000 \
--driver vmwarefusion gitlab-test-env

VirtualBox Testing Environment (free & opensource alternative to installing VMWare Fusion)

This guide involves configuring and setting up VirtualBox and Docker locally and assumes you're using Mac OS X.

Install VirtualBox

Install Docker Community Edition

  1. https://www.docker.com/community-edition

Create new docker host

This command will create a new VirtualBox virtual machine called gitlab-test-env that will act as a docker host.

docker-machine create \
--virtualbox-cpu-count -1 \
--virtualbox-memory 4096 \
--virtualbox-disk-size 30000 \
--driver virtualbox gitlab-test-env

Creating GitLab test instance

Connect your shell to the new machine

In this example we'll create a GitLab EE 11.9.9 instance.

First connect the docker client to the docker host you created previously.

eval "$(docker-machine env gitlab-test-env)"

You can add this to your ~/.bash_profile file to ensure the docker client uses the gitlab-test-env docker host

Get the available tags for GitLab

Optionally replace the ee in the URL with ce

wget -q https://registry.hub.docker.com/v1/repositories/gitlab/gitlab-ee/tags -O - | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}'

Create new GitLab container

Set up container settings
export SSH_PORT=2222
export HTTP_PORT=8888
export VERSION=11.9.9-ee.0
export NAME=gitlab-test-11.9
Create container
docker run --detach \
--env GITLAB_OMNIBUS_CONFIG="external_url 'http://$(docker-machine ip gitlab-test-env):$HTTP_PORT'; gitlab_rails['gitlab_shell_ssh_port'] = $SSH_PORT;" \
--hostname $(docker-machine ip gitlab-test-env) \
-p $HTTP_PORT:$HTTP_PORT -p $SSH_PORT:22 \
--name $NAME \
gitlab/gitlab-ee:$VERSION

Connect to the GitLab container

Retrieve the docker host IP
docker-machine ip gitlab-test-env
# example output: 192.168.151.134
Execute interactive shell/edit configuration
docker exec -it $NAME /bin/bash
# example commands
root@192:/# vi /etc/gitlab/gitlab.rb
root@192:/# gitlab-ctl reconfigure
How to update gitlab.rb values with sed

For example, to set the gitlab_shell_ssh port on a container named gitlab-ee to port 2222

docker exec -it gitlab-ee \
sed -i "s/.*gitlab_shell_ssh_port.*/gitlab_rails['gitlab_shell_ssh_port'] = 2222/g" /etc/gitlab/gitlab.rb

docker exec -it gitlab-ee gitlab-ctl reconfigure

Resources