Skip to content
Open
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
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ ENV RUNNER_DOCKER_PRIVATE_REGISTRY_TOKEN=''
ENV RUNNER_DOCKER_ADDITIONAL_VOLUME=''
ENV RUNNER_OUTPUT_LIMIT='4096'
ENV RUNNER_AUTOUNREGISTER='false'
ENV RUNNER_KUBERNETES_NAMESPACE=''

RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv E1DD270288B4E6030699E45FA1715D88E1DF1F24 \
&& echo "deb http://ppa.launchpad.net/git-core/ppa/ubuntu trusty main" >> /etc/apt/sources.list \
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,15 @@ You can increase the log maximum size by setting the RUNNER_OUTPUT_LIMIT variabl

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


## Using kubernetes executor

You can use the docker executor by using `RUNNER_EXECUTOR=kubernetes`. It will autodiscover the kubernetes server and credentials.
You can precise the default docker image used and the namespace using RUNNER_DOCKER_IMAGE and RUNNER_KUBERNETES_NAMESPACE. Else if will use the IMAGE provided in CI file and default namespace.




## Concurrent jobs
You an setup your runner to start multiple job in parallel by setting the environment variable `RUNNER_CONCURRENT` to the number of jobs you want to run concurrently.

Expand Down
11 changes: 9 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,18 @@ configure_ci_runner() {
fi
if [[ -n ${RUNNER_DOCKER_ADDITIONAL_VOLUME} ]];then
RUNNER_DOCKER_ARGS="$RUNNER_DOCKER_ARGS --docker-volumes ${RUNNER_DOCKER_ADDITIONAL_VOLUME}"
fi
fi
elif [[ "${RUNNER_EXECUTOR}" == "kubernetes" ]];then
if [[ -n ${RUNNER_DOCKER_IMAGE} ]];then
RUNNER_DOCKER_ARGS="--kubernetes-image ${RUNNER_DOCKER_IMAGE}"
fi
if [[ -n ${RUNNER_KUBERNETES_NAMESPACE} ]]; then
RUNNER_DOCKER_ARGS="$RUNNER_DOCKER_ARGS --kubernetes-namespace ${RUNNER_KUBERNETES_NAMESPACE}"
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}" --output-limit "${RUNNER_OUTPUT_LIMIT}" ${RUNNER_DOCKER_ARGS}
-n -u "${CI_SERVER_URL}" -r "${RUNNER_TOKEN}" --name "${RUNNER_DESCRIPTION}" --executor "${RUNNER_EXECUTOR}" --output-limit "${RUNNER_OUTPUT_LIMIT}" ${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