Commit d96c9151 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Añade prefijo a variables y elimina config

Los problemas de despliegue se debían a que algunas variables que
recoge gitlab-runner afectan también al propio entorno de Docker, por
lo que ahora las que comienzan por "DOCKER_" tienen nuevo prefijo
adicional.

Además, una vez desplegado, había problemas por pasarle una config
que reemplaza a su fichero de configuración. Este último es generado
dinámicamente por gitlab-runner, y al pasarlo desde fuera se impide
que funcione correctamente.
parent eceeefb7
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -5,14 +5,14 @@ REGISTER_RUN_UNTAGGED=true
RUNNER_REQUEST_CONCURRENCY=2
RUNNER_OUTPUT_LIMIT=40960
RUNNER_EXECUTOR=docker
DOCKER_IMAGE=alpine
DOCKER_TLS_VERIFY=false
DOCKER_PRIVILEGED=true
DOCKER_DISABLE_CACHE=false
DOCKER_SHM_SIZE=1000000000
DOCKER_MEMORY=4g
DOCKER_MEMORY_RESERVATION=1g
DOCKER_CPUS=4
RUNNER_DOCKER_IMAGE=alpine
RUNNER_DOCKER_TLS_VERIFY=false
RUNNER_DOCKER_PRIVILEGED=true
RUNNER_DOCKER_DISABLE_CACHE=false
RUNNER_DOCKER_SHM_SIZE=1000000000
RUNNER_DOCKER_MEMORY=4g
RUNNER_DOCKER_MEMORY_RESERVATION=1g
RUNNER_DOCKER_CPUS=4
CACHE_TYPE=s3
CACHE_SHARED=true
CACHE_S3_BUCKET_NAME=cache
+0 −2
Original line number Diff line number Diff line
concurrent = 2
check_interval = 10
+3 −3
Original line number Diff line number Diff line
@@ -10,10 +10,10 @@ services:
        window: 1m
      resources:
        limits:
          cpus: '1'
          memory: 512M
          cpus: '0.5'
          memory: 128M
        reservations:
          memory: 410M
          memory: 103M

volumes:
  etc-vol:
+8 −15
Original line number Diff line number Diff line
@@ -20,14 +20,6 @@ services:
      - RUNNER_REQUEST_CONCURRENCY
      - RUNNER_OUTPUT_LIMIT
      - RUNNER_EXECUTOR
      - DOCKER_IMAGE
      - DOCKER_TLS_VERIFY
      - DOCKER_PRIVILEGED
      - DOCKER_DISABLE_CACHE
      - DOCKER_SHM_SIZE
      - DOCKER_MEMORY
      - DOCKER_MEMORY_RESERVATION
      - DOCKER_CPUS
      - CACHE_TYPE
      - CACHE_SHARED
      - CACHE_S3_SERVER_ADDRESS
@@ -35,20 +27,21 @@ services:
      - CACHE_S3_SECRET_KEY
      - CACHE_S3_BUCKET_NAME
      - CACHE_S3_INSECURE
      - DOCKER_IMAGE=${RUNNER_DOCKER_IMAGE}
      - DOCKER_TLS_VERIFY=${RUNNER_DOCKER_TLS_VERIFY}
      - DOCKER_PRIVILEGED=${RUNNER_DOCKER_PRIVILEGED}
      - DOCKER_DISABLE_CACHE=${RUNNER_DOCKER_DISABLE_CACHE}
      - DOCKER_SHM_SIZE=${RUNNER_DOCKER_SHM_SIZE}
      - DOCKER_MEMORY=${RUNNER_DOCKER_MEMORY}
      - DOCKER_MEMORY_RESERVATION=${RUNNER_DOCKER_MEMORY_RESERVATION}
      - DOCKER_CPUS=${RUNNER_DOCKER_CPUS}
    networks:
      - gitlab-net
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - etc-vol:/etc/gitlab-runner
      - home-vol:/home/gitlab-runner
    configs:
      - source: config-toml
        target: ${CONFIG_FILE}

networks:
  gitlab-net:
    external: true

configs:
  config-toml:
    file: ./config-local/config.toml