Commit 4e6053bd authored by Pedro Pombeiro's avatar Pedro Pombeiro Committed by Suzanne Selhorn

Remove support for --docker-services flag on register command

Related to https://gitlab.com/gitlab-org/gitlab-runner/-/merge_requests/2036
parent 1d2259fd
......@@ -26,7 +26,20 @@ test them on a dedicated CI server.
To use GitLab Runner with Docker you need to [register a new Runner](https://docs.gitlab.com/runner/register/)
to use the `docker` executor.
A one-line example can be seen below:
An example can be seen below. First we set up a temporary template to supply the services:
```shell
cat > /tmp/test-config.template.toml << EOF
[[runners]]
[runners.docker]
[[runners.docker.services]]
name = "postgres:latest"
[[runners.docker.services]]
name = "mysql:latest"
EOF
```
Then we register the runner using the template that was just created:
```shell
sudo gitlab-runner register \
......@@ -34,9 +47,8 @@ sudo gitlab-runner register \
--registration-token "PROJECT_REGISTRATION_TOKEN" \
--description "docker-ruby:2.6" \
--executor "docker" \
--docker-image ruby:2.6 \
--docker-services postgres:latest \
--docker-services mysql:latest
--template-config /tmp/test-config.template.toml \
--docker-image ruby:2.6
```
The registered runner will use the `ruby:2.6` Docker image and will run two
......
......@@ -76,14 +76,21 @@ To build this project you also need to have [GitLab Runner](https://docs.gitlab.
You can use public runners available on `gitlab.com` or you can register your own:
```shell
cat > /tmp/test-config.template.toml << EOF
[[runners]]
[runners.docker]
[[runners.docker.services]]
name = "postgres:latest"
EOF
gitlab-runner register \
--non-interactive \
--url "https://gitlab.com/" \
--registration-token "PROJECT_REGISTRATION_TOKEN" \
--description "python-3.5" \
--executor "docker" \
--docker-image python:3.5 \
--docker-services postgres:latest
--template-config /tmp/test-config.template.toml \
--docker-image python:3.5
```
With the command above, you create a runner that uses the [`python:3.5`](https://hub.docker.com/_/python) image and uses a [PostgreSQL](https://hub.docker.com/_/postgres) database.
......
......@@ -64,7 +64,19 @@ You can do this through the [Heroku Dashboard](https://dashboard.heroku.com/).
First install [Docker Engine](https://docs.docker.com/installation/).
To build this project you also need to have [GitLab Runner](https://docs.gitlab.com/runner/).
You can use public runners available on `gitlab.com` or register your own:
You can use public runners available on `gitlab.com` or register your own. Start by
creating a template configuration file in order to pass complex configuration:
```shell
cat > /tmp/test-config.template.toml << EOF
[[runners]]
[runners.docker]
[[runners.docker.services]]
name = "mysql:latest"
EOF
```
Finally, register the runner, passing the newly-created template configuration file:
```shell
gitlab-runner register \
......@@ -73,8 +85,8 @@ gitlab-runner register \
--registration-token "PROJECT_REGISTRATION_TOKEN" \
--description "ruby:2.6" \
--executor "docker" \
--docker-image ruby:2.6 \
--docker-services latest
--template-config /tmp/test-config.template.toml \
--docker-image ruby:2.6
```
With the command above, you create a Runner that uses the [`ruby:2.6`](https://hub.docker.com/_/ruby) image and uses a [PostgreSQL](https://hub.docker.com/_/postgres) database.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment