Robert Kaussow
244a919ef5
All checks were successful
continuous-integration/drone/push Build is passing
84 lines
3.1 KiB
Django/Jinja
84 lines
3.1 KiB
Django/Jinja
#jinja2:lstrip_blocks: True
|
||
# {{ ansible_managed }}
|
||
version: '2'
|
||
|
||
services:
|
||
droneserver:
|
||
image: {{ droneci_server_image }}
|
||
|
||
ports:
|
||
- {{ droneci_server_exposed_ip + ':' if droneci_server_exposed_ip is defined else '' }}{{ droneci_server_exposed_port }}:80
|
||
{% if not droneci_postgres_enabled %}
|
||
volumes:
|
||
- droneserver-data:/var/lib/drone/
|
||
{% if droneci_license_key is defined %}
|
||
- {{ droneci_license_key }}:/etc/drone.key
|
||
{% endif %}
|
||
{% endif %}
|
||
{% if droneci_server_extra_hosts | default([]) %}
|
||
extra_hosts:
|
||
{% for host in droneci_server_extra_hosts %}
|
||
- {{ '"' + host + '"' }}
|
||
{% endfor %}
|
||
{% endif %}
|
||
restart: {{ droneci_server_restart_policy }}
|
||
environment:
|
||
- DRONE_SERVER_HOST={{ droneci_host | urlsplit('hostname') }}
|
||
- DRONE_SERVER_PROTO={{ droneci_host | urlsplit('scheme') }}
|
||
- DRONE_RPC_SECRET={{ droneci_secret }}
|
||
- DRONE_USER_CREATE={{ droneci_admins | default(omit) | join(",") }}
|
||
- DRONE_LOGS_COLOR=true
|
||
- DRONE_LOGS_PRETTY=true
|
||
- DRONE_TLS_AUTOCERT=false
|
||
{% if droneci_postgres_enabled %}
|
||
- DRONE_DATABASE_DRIVER=postgres
|
||
- DRONE_DATABASE_DATASOURCE=postgres://{{ droneci_postgres_user.name }}:{{ droneci_postgres_user.password }}@{{ droneci_postgres_server }}/{{ droneci_postgres_db.name }}?sslmode={{ droneci_postgres_ssl_mode }}
|
||
{% endif %}
|
||
{% if droneci_gitea_enabled %}
|
||
- DRONE_GITEA_SERVER={{ droneci_gitea_server }}
|
||
- DRONE_GITEA_SKIP_VERIFY={{ droneci_gitea_skip_verify_enabled | lower }}
|
||
{% endif %}
|
||
{% if droneci_http_proxy is defined %}
|
||
- HTTP_PROXY={{ droneci_http_proxy | join(',') }}
|
||
- http_proxy={{ droneci_http_proxy | join(',') }}
|
||
{% endif %}
|
||
{% if droneci_https_proxy is defined %}
|
||
- HTTPS_PROXY={{ droneci_https_proxy | join(',') }}
|
||
- https_proxy={{ droneci_https_proxy | join(',') }}
|
||
{% endif %}
|
||
- NO_PROXY={{ droneci_no_proxy | join(',') }}
|
||
- no_proxy={{ droneci_no_proxy | join(',') }}
|
||
{% if droneci_server_memory_limit is defined %}
|
||
mem_limit: {{ droneci_server_memory_limit }}
|
||
{% endif %}
|
||
{% if droneci_server_memory_reservation is defined %}
|
||
mem_reservation: {{ droneci_server_memory_reservation }}
|
||
{% endif %}
|
||
|
||
droneagent:
|
||
image: {{ droneci_agent_image }}
|
||
|
||
command: agent
|
||
restart: {{ droneci_agent_restart_policy }}
|
||
depends_on:
|
||
- droneserver
|
||
volumes:
|
||
- {{ droneci_docker_socket_path }}:/var/run/docker.sock
|
||
environment:
|
||
- DRONE_RPC_SERVER=http://droneserver
|
||
- DRONE_RPC_SECRET={{ droneci_secret }}
|
||
- DRONE_RUNNER_CAPACITY={{ dronevi_agent_capacity }}
|
||
# TODO: temp static value, needs to be replaced by a custom fact
|
||
- DOCKER_API_VERSION=1.26
|
||
{% if droneci_agent_memory_limit is defined %}
|
||
mem_limit: {{ droneci_agent_memory_limit }}
|
||
{% endif %}
|
||
{% if droneci_agent_memory_reservation is defined %}
|
||
mem_reservation: {{ droneci_agent_memory_reservation }}
|
||
{% endif %}
|
||
|
||
{% if not droneci_postgres_enabled %}
|
||
volumes:
|
||
droneserver-data:
|
||
{% endif %}
|