xoxys.droneci/templates/services/droneci_compose.yml.j2
Robert Kaussow 24a4886148
All checks were successful
continuous-integration/drone/push Build is passing
set dummy values for datadog
2020-09-25 11:14:01 +02:00

91 lines
3.3 KiB
Django/Jinja
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#jinja2:lstrip_blocks: True
{{ ansible_managed | comment }}
version: "2.4"
services:
droneci:
container_name: {{ droneci_container_name }}
image: {{ droneci_image }}
restart: {{ droneci_restart_policy }}
{% if droneci_exposed_ports | default([]) %}
ports:
{% for port in droneci_exposed_ports %}
- {{ port | quote }}
{% endfor %}
{% endif %}
{% if droneci_volumes | default([]) %}
volumes:
{% for volume in droneci_volumes %}
- "{{ volume.name }}:{{ volume.dest }}"
{% endfor %}
{% endif %}
{% if droneci_networks_applied | default([]) %}
networks:
{% for network in droneci_networks_applied %}
- {{ network }}
{% endfor %}
{% endif %}
{% if droneci_extra_hosts | default([]) %}
extra_hosts:
{% for host in droneci_extra_hosts %}
- {{ host | quote }}
{% endfor %}
{% endif %}
privileged: true
environment:
- DRONE_SERVER_HOST={{ droneci_host | urlsplit('hostname') }}
- DRONE_SERVER_PROTO={{ droneci_host | urlsplit('scheme') }}
- DRONE_AGENTS_ENABLED=true
- DRONE_RPC_SECRET={{ droneci_secret }}
- DRONE_USER_CREATE=username:{{ droneci_admin_user }},admin:true
- DRONE_LOGS_COLOR=true
- DRONE_LOGS_PRETTY=true
- DRONE_TLS_AUTOCERT=false
- DRONE_DATADOG_ENABLED=false
- DRONE_DATADOG_ENDPOINT=dummy
- DRONE_DATADOG_TOKEN=dummy
- DRONE_PROMETHEUS_ANONYMOUS_ACCESS={{ droneci_prometheus_anonymous_access | bool | lower }}
{% if droneci_db_type == "pgsql" %}
- DRONE_DATABASE_DRIVER=postgres
- DRONE_DATABASE_DATASOURCE=postgres://{{ droneci_db_user }}:{{ droneci_db_password }}@{{ droneci_db_server }}/{{ droneci_db_name }}?sslmode={{ droneci_db_ssl_mode }}
{% endif %}
{% if droneci_gitea_enabled %}
- DRONE_GITEA_SERVER={{ droneci_gitea_server }}
- DRONE_GITEA_SKIP_VERIFY={{ droneci_gitea_skip_verify | lower }}
{% if droneci_gitea_oauth_client_id is defined and droneci_gitea_oauth_client_secret is defined %}
- DRONE_GITEA_CLIENT_ID={{ droneci_gitea_oauth_client_id }}
- DRONE_GITEA_CLIENT_SECRET={{ droneci_gitea_oauth_client_secret }}
{% endif %}
{% 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_memory_limit is defined %}
mem_limit: {{ droneci_memory_limit }}
{% endif %}
{% if droneci_memory_reservation is defined %}
mem_reservation: {{ droneci_memory_reservation }}
{% endif %}
{% if droneci_volumes | default([]) | rejectattr("bind") | list | length > 0 %}
volumes:
{% for volume in droneci_volumes | rejectattr("bind") %}
{{ volume.name }}:
{% endfor %}
{% endif %}
{% if droneci_networks | default([]) | length > 0 %}
networks:
{% for network in droneci_networks %}
{{ network.name }}:
driver: {{ network.backend | default("bridge") }}
{% endfor %}
{% endif %}