xoxys.droneci/templates/services/droneci_compose.yml.j2

101 lines
3.8 KiB
Plaintext
Raw Normal View History

2018-12-13 23:09:22 +01:00
#jinja2:lstrip_blocks: True
2019-08-27 22:04:33 +02:00
{{ ansible_managed | comment }}
2020-06-17 21:20:54 +02:00
version: "2.4"
2018-12-13 23:09:22 +01:00
services:
droneci:
container_name: {{ droneci_container_name }}
image: {{ droneci_image }}
2020-06-16 22:04:08 +02:00
restart: {{ droneci_restart_policy }}
{% if droneci_exposed_ports | default([]) %}
2018-12-13 23:09:22 +01:00
ports:
{% for port in droneci_exposed_ports %}
- {{ port | quote }}
{% endfor %}
{% endif %}
{% if droneci_volumes | default([]) %}
2018-12-13 23:09:22 +01:00
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([]) %}
2018-12-14 01:27:46 +01:00
extra_hosts:
{% for host in droneci_extra_hosts %}
- {{ host | quote }}
{% endfor %}
2018-12-14 01:23:33 +01:00
{% endif %}
privileged: {{ droneci_privileged | bool | lower }}
2018-12-13 23:09:22 +01:00
environment:
2019-01-11 21:27:47 +01:00
- DRONE_SERVER_HOST={{ droneci_host | urlsplit('hostname') }}
- DRONE_SERVER_PROTO={{ droneci_host | urlsplit('scheme') }}
- DRONE_AGENTS_ENABLED=true
2019-01-11 21:27:47 +01:00
- DRONE_RPC_SECRET={{ droneci_secret }}
- DRONE_USER_CREATE=username:{{ droneci_admin_user }},admin:true
2021-01-14 10:50:32 +01:00
{% if droneci_user_filter is defined and droneci_user_filter | length > 0 %}
- DRONE_USER_FILTER={{ droneci_user_filter | join(",") }}
{% endif %}
2021-01-15 11:15:15 +01:00
{% if droneci_repository_filter is defined and droneci_repository_filter | length > 0 %}
2021-01-15 11:21:19 +01:00
- DRONE_REPOSITORY_FILTER={{ droneci_repository_filter | join(",") }}
2021-01-15 11:19:17 +01:00
{% endif %}
2019-01-11 21:27:47 +01:00
- DRONE_LOGS_COLOR=true
- DRONE_LOGS_PRETTY=true
- DRONE_TLS_AUTOCERT=false
2020-09-25 09:43:04 +02:00
- DRONE_DATADOG_ENABLED=false
2020-09-25 11:14:01 +02:00
- DRONE_DATADOG_ENDPOINT=dummy
- DRONE_DATADOG_TOKEN=dummy
2020-09-25 09:43:04 +02:00
- DRONE_PROMETHEUS_ANONYMOUS_ACCESS={{ droneci_prometheus_anonymous_access | bool | lower }}
{% if droneci_db_secret is defined %}
- DRONE_DATABASE_SECRET={{ droneci_db_secret }}
{% endif %}
2019-10-27 16:04:40 +01:00
{% if droneci_db_type == "pgsql" %}
2018-12-13 23:09:22 +01:00
- DRONE_DATABASE_DRIVER=postgres
2019-10-27 16:04:40 +01:00
- DRONE_DATABASE_DATASOURCE=postgres://{{ droneci_db_user }}:{{ droneci_db_password }}@{{ droneci_db_server }}/{{ droneci_db_name }}?sslmode={{ droneci_db_ssl_mode }}
2018-12-13 23:09:22 +01:00
{% endif %}
2021-01-14 10:50:32 +01:00
{% if droneci_scm_provider | lower == "gitea" %}
2019-01-11 21:27:47 +01:00
- DRONE_GITEA_SERVER={{ droneci_gitea_server }}
2019-05-19 01:44:23 +02:00
- DRONE_GITEA_SKIP_VERIFY={{ droneci_gitea_skip_verify | lower }}
2019-05-19 02:04:31 +02:00
- DRONE_GITEA_CLIENT_ID={{ droneci_gitea_oauth_client_id }}
- DRONE_GITEA_CLIENT_SECRET={{ droneci_gitea_oauth_client_secret }}
2021-01-14 10:50:32 +01:00
{% elif droneci_scm_provider | lower == "github" %}
- DRONE_GITHUB_CLIENT_ID={{ droneci_github_client_id }}
- DRONE_GITHUB_CLIENT_SECRET={{ droneci_github_client_secret }}
2018-12-13 23:09:22 +01:00
{% 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 }}
2018-12-16 17:22:49 +01:00
{% endif %}
2020-06-16 21:46:28 +02:00
{% if droneci_volumes | default([]) | rejectattr("bind") | list | length > 0 %}
2018-12-13 23:09:22 +01:00
volumes:
{% for volume in droneci_volumes | rejectattr("bind") %}
{{ volume.name }}:
{% endfor %}
{% endif %}
2020-06-16 21:46:28 +02:00
{% if droneci_networks | default([]) | length > 0 %}
networks:
{% for network in droneci_networks %}
{{ network.name }}:
driver: {{ network.backend | default("bridge") }}
{% endfor %}
2018-12-13 23:09:22 +01:00
{% endif %}