Skip to content

Commit 42a1c84

Browse files
committed
chore: allow overriding docker-compose env vars for tag
1 parent 29488e6 commit 42a1c84

File tree

4 files changed

+12
-19
lines changed

4 files changed

+12
-19
lines changed

.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
GITLAB_IMAGE=gitlab/gitlab-ce
2+
GITLAB_TAG=13.3.5-ce.0

.renovaterc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
],
55
"regexManagers": [
66
{
7-
"fileMatch": ["^tools/build_test_env.sh$"],
8-
"matchStrings": ["DEFAULT_GITLAB_TAG=(?<currentValue>.*?)\n"],
7+
"fileMatch": ["^.env$"],
8+
"matchStrings": ["GITLAB_TAG=(?<currentValue>.*?)\n"],
99
"depNameTemplate": "gitlab/gitlab-ce",
1010
"datasourceTemplate": "docker",
1111
"versioningTemplate": "loose"

README.rst

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ You need to install ``tox`` to run unit tests and documentation builds locally:
166166
Running integration tests
167167
-------------------------
168168

169-
Two scripts run tests against a running gitlab instance, using a docker
169+
Integration tests run against a running gitlab instance, using a docker
170170
container. You need to have docker installed on the test machine, and your user
171171
must have the correct permissions to talk to the docker daemon.
172172

@@ -180,9 +180,9 @@ To run these tests:
180180
# run the python API tests:
181181
tox -e py_func_v4
182182
183-
By default, the tests run against the ``gitlab/gitlab-ce:latest`` image. You can
184-
override both the image and tag with the ``-i`` and ``-t`` options, or by providing
185-
either the ``GITLAB_IMAGE`` or ``GITLAB_TAG`` environment variables.
183+
By default, the tests run against the latest version of the ``gitlab/gitlab-ce``
184+
image. You can override both the image and tag by providing either the
185+
``GITLAB_IMAGE`` or ``GITLAB_TAG`` environment variables.
186186

187187
This way you can run tests against different versions, such as ``nightly`` for
188188
features in an upcoming release, or an older release (e.g. ``12.8.0-ce.0``).
@@ -191,20 +191,11 @@ The tag must match an exact tag on Docker Hub:
191191
.. code-block:: bash
192192
193193
# run tests against `nightly` or specific tag
194-
./tools/py_functional_tests.sh -t nightly
195-
./tools/py_functional_tests.sh -t 12.8.0-ce.0
194+
GITLAB_TAG=nightly tox -e py_func_v4
195+
GITLAB_TAG=12.8.0-ce.0 tox -e py_func_v4
196196
197197
# run tests against the latest gitlab EE image
198-
./tools/py_functional_tests.sh -i gitlab/gitlab-ee
199-
200-
# override tags with environment variables
201-
GITLAB_TAG=nightly ./tools/py_functional_tests.sh
202-
203-
You can also build a test environment using the following command:
204-
205-
.. code-block:: bash
206-
207-
./tools/build_test_env.sh
198+
GITLAB_IMAGE=gitlab/gitlab-ee tox -e py_func_v4
208199
209200
A freshly configured gitlab container will be available at
210201
http://localhost:8080 (login ``root`` / password ``5iveL!fe``). A configuration

tools/functional/fixtures/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '3'
22
services:
33
gitlab:
4-
image: 'gitlab/gitlab-ce:latest'
4+
image: '${GITLAB_IMAGE}:${GITLAB_TAG}'
55
container_name: 'gitlab-test'
66
hostname: 'gitlab.test'
77
privileged: true # Just in case https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/1350

0 commit comments

Comments
 (0)