71 lines
2.5 KiB
Plaintext
71 lines
2.5 KiB
Plaintext
|
#jinja2:lstrip_blocks: True
|
|||
|
# {{ ansible_managed }}
|
|||
|
version: '2'
|
|||
|
|
|||
|
services:
|
|||
|
droneserver:
|
|||
|
image: {{ droneci_server_image }}
|
|||
|
|
|||
|
ports:
|
|||
|
- {{ droneci_server_exposed_port }}:8000
|
|||
|
- 9000
|
|||
|
{% if not droneci_postgres_persistence_enabled %}
|
|||
|
volumes:
|
|||
|
- droneserver-data:/var/lib/drone/
|
|||
|
{% endif %}
|
|||
|
restart: {{ droneci_server_restart_policy }}
|
|||
|
environment:
|
|||
|
- DRONE_OPEN=true
|
|||
|
- DRONE_HOST={{ droneci_host }}
|
|||
|
- DRONE_SECRET={{ droneci_secret }}
|
|||
|
- DRONE_ADMIN={{ droneci_admins | default(omit) | join(",") }}
|
|||
|
{% if droneci_pass_ca_enabled %}
|
|||
|
- DRONE_VOLUME={{ droneci_ca_path }}:/etc/ssl/certs/ca-certificates.crt
|
|||
|
{% endif %}
|
|||
|
{% if droneci_postgres_persistence_enabled %}
|
|||
|
- DRONE_DATABASE_DRIVER=postgres
|
|||
|
- DRONE_DATABASE_DATASOURCE=postgres://{{ droneci_postgres_user.name }}:{{ droneci_postgres_user.password }}@{{ droneci_postgres_server }}/{{ droneci_postgres_db.name }}{% if not droneci_postgres_tls_enabled %}?sslmode=disable{% endif %}
|
|||
|
{% endif %}
|
|||
|
{% if droneci_gitea_enabled %}
|
|||
|
- DRONE_GITEA=true
|
|||
|
- DRONE_GITEA_URL={{ droneci_gitea_host }}
|
|||
|
{% if droneci_gitea_git_user is defined %}
|
|||
|
- DRONE_GITEA_GIT_USERNAME={{ droneci_gitea_git_user }}
|
|||
|
{% endif %}
|
|||
|
{% if droneci_gitea_git_password is defined %}
|
|||
|
- DRONE_GITEA_GIT_PASSWORD={{ droneci_gitea_git_password }}
|
|||
|
{% endif %}
|
|||
|
- DRONE_GITEA_PRIVATE_MODE={{ droneci_gitea_private_mode_enabled | lower }}
|
|||
|
- 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(',') }}
|
|||
|
|
|||
|
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_SERVER=droneserver:9000
|
|||
|
- DRONE_SECRET={{ droneci_secret }}
|
|||
|
# TODO: temp static value, needs to be replaced by a custom fact
|
|||
|
- DOCKER_API_VERSION=1.26
|
|||
|
|
|||
|
{% if not droneci_postgres_persistence_enabled %}
|
|||
|
volumes:
|
|||
|
droneserver-data:
|
|||
|
{% endif %}
|