Commit 7284f65f authored by nimrod's avatar nimrod
Browse files

Working deployment on host01.shore.co.il.

Can be easily deployed on different hosts by setting different
environment variables (need to document them). No testing/ linting of
any kind (need to do that as well).
parent 533cd04a
Loading
Loading
Loading
Loading

.env

0 → 100644
+3 −0
Original line number Diff line number Diff line
COMPOSE_PROJECT_NAME=gitlab-runner
DOCKER_HOST=ssh://host01.shore.co.il
RUNNER_NAME=host01.shore.co.il

Dockerfile

0 → 100644
+9 −0
Original line number Diff line number Diff line
FROM gitlab/gitlab-runner:alpine-v13.6.0-rc1
RUN apk add --no-cache --update docker
COPY --chown=root:root entrypoint /entrypoint0
ENV DOCKER_VOLUMES=/var/run/docker.sock:/var/run/docker.sock \
    RUNNER_EXECUTOR=docker \
    DOCKER_PULL_POLICY=if-not-present
ENTRYPOINT [ "/entrypoint0" ]
CMD [ "run", "--user=gitlab-runner", "--working-directory=/home/gitlab-runner" ]
HEALTHCHECK CMD gitlab-runner list 2>&1 | grep -qF "$CI_SERVER_URL"

docker-compose.yml

0 → 100644
+23 −0
Original line number Diff line number Diff line
---
version: '3.7'
services:
  runner:
    build:
      context: ./
    environment:
      CI_SERVER_URL: "${CI_SERVER_URL:-https://git.shore.co.il}"
      DOCKER_IMAGE: docker:19.03
      REGISTRATION_TOKEN: "${REGISTRATION_TOKEN}"
      RUNNER_NAME: "${RUNNER_NAME}"
    image: adarnimrod/gitlab-runner
    restart: always
    volumes:
      - config:/etc/gitlab-runner
      - /var/run/docker.sock:/var/run/docker.sock

volumes:
  config:

networks:
  default:
    name: shore

entrypoint

0 → 100755
+5 −0
Original line number Diff line number Diff line
#!/bin/sh
set -eux

gitlab-runner register --non-interactive
eval exec /entrypoint "$@"