Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

**1.1.4-6**
- added docker executor

**1.1.4**
- gitlab-ci-multi-runner: upgrade to 1.1.4

Expand Down
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![Docker Repository on Quay.io](https://quay.io/repository/sameersbn/gitlab-ci-multi-runner/status "Docker Repository on Quay.io")](https://quay.io/repository/sameersbn/gitlab-ci-multi-runner)

# sameersbn/gitlab-ci-multi-runner:1.1.4-5
# sameersbn/gitlab-ci-multi-runner:1.1.4-6

- [Introduction](#introduction)
- [Contributing](#contributing)
Expand Down Expand Up @@ -51,7 +51,7 @@ Automated builds of the image are available on [Dockerhub](https://hub.docker.co
> **Note**: Builds are also available on [Quay.io](https://quay.io/repository/sameersbn/gitlab-ci-multi-runner)

```bash
docker pull sameersbn/gitlab-ci-multi-runner:1.1.4-5
docker pull sameersbn/gitlab-ci-multi-runner:1.1.4-6
```

Alternatively you can build the image yourself.
Expand All @@ -69,21 +69,29 @@ docker run --name gitlab-ci-multi-runner -d --restart=always \
--volume /srv/docker/gitlab-runner:/home/gitlab_ci_multi_runner/data \
--env='CI_SERVER_URL=http://git.example.com/ci' --env='RUNNER_TOKEN=xxxxxxxxx' \
--env='RUNNER_DESCRIPTION=myrunner' --env='RUNNER_EXECUTOR=shell' \
sameersbn/gitlab-ci-multi-runner:1.1.4-5
sameersbn/gitlab-ci-multi-runner:1.1.4-6
```

*Alternatively, you can use the sample [docker-compose.yml](docker-compose.yml) file to start the container using [Docker Compose](https://docs.docker.com/compose/)*

Update the values of `CI_SERVER_URL`, `RUNNER_TOKEN` and `RUNNER_DESCRIPTION` in the above command. If these enviroment variables are not specified, you will be prompted to enter these details interactively on first run.

## Using docker executor

You can use the docker executor by using `RUNNER_EXECUTOR=docker`. You must provide a docker image to use in `RUNNER_DOCKER_IMAGE` (e.g. docker:latest)

If `RUNNER_DOCKER_MODE` is set to `socket`, the docker socket is shared between the runner and the build container. If it is not, you must use docker in docker service in your .gitlabci.yml definitions.

See https://docs.gitlab.com/ce/ci/docker/using_docker_build.html for more info.

## Command-line arguments

You can customize the launch command by specifying arguments to `gitlab-ci-multi-runner` on the `docker run` command. For example the following command prints the help menu of `gitlab-ci-multi-runner` command:

```bash
docker run --name gitlab-ci-multi-runner -it --rm \
--volume /srv/docker/gitlab-runner:/home/gitlab_ci_multi_runner/data \
sameersbn/gitlab-ci-multi-runner:1.1.4-5 --help
sameersbn/gitlab-ci-multi-runner:1.1.4-6 --help
```

## Persistence
Expand Down Expand Up @@ -131,7 +139,7 @@ To upgrade to newer releases:
1. Download the updated Docker image:

```bash
docker pull sameersbn/gitlab-ci-multi-runner:1.1.4-5
docker pull sameersbn/gitlab-ci-multi-runner:1.1.4-6
```

2. Stop the currently running image:
Expand All @@ -151,7 +159,7 @@ To upgrade to newer releases:
```bash
docker run -name gitlab-ci-multi-runner -d \
[OPTIONS] \
sameersbn/gitlab-ci-multi-runner:1.1.4-5
sameersbn/gitlab-ci-multi-runner:1.1.4-6
```

## Shell Access
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.4-5
1.1.4-6
10 changes: 9 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,17 @@ grant_access_to_docker_socket() {
configure_ci_runner() {
if [[ ! -e ${GITLAB_CI_MULTI_RUNNER_DATA_DIR}/config.toml ]]; then
if [[ -n ${CI_SERVER_URL} && -n ${RUNNER_TOKEN} && -n ${RUNNER_DESCRIPTION} && -n ${RUNNER_EXECUTOR} ]]; then
if [[ "${RUNNER_EXECUTOR}" == "docker" ]];then
if [[ -n ${RUNNER_DOCKER_IMAGE} ]];then
RUNNER_DOCKER_ARGS="--docker-privileged --docker-image ${RUNNER_DOCKER_IMAGE}"
fi
if [[ "${RUNNER_DOCKER_MODE}" == "socket" ]];then
RUNNER_DOCKER_ARGS="$RUNNER_DOCKER_ARGS --docker-volumes /var/run/docker.sock:/var/run/docker.sock"
fi
fi
sudo -HEu ${GITLAB_CI_MULTI_RUNNER_USER} \
gitlab-ci-multi-runner register --config ${GITLAB_CI_MULTI_RUNNER_DATA_DIR}/config.toml \
-n -u "${CI_SERVER_URL}" -r "${RUNNER_TOKEN}" --name "${RUNNER_DESCRIPTION}" --executor "${RUNNER_EXECUTOR}"
-n -u "${CI_SERVER_URL}" -r "${RUNNER_TOKEN}" --name "${RUNNER_DESCRIPTION}" --executor "${RUNNER_EXECUTOR}" ${RUNNER_DOCKER_ARGS}
else
sudo -HEu ${GITLAB_CI_MULTI_RUNNER_USER} \
gitlab-ci-multi-runner register --config ${GITLAB_CI_MULTI_RUNNER_DATA_DIR}/config.toml
Expand Down