# automatically generated by auxilium
{% for job, opts in aux.ci.jobs.items() -%}
{%- if opts.run -%}
run:{{ job }}:
    extends:
    - .template-run
    {%- if opts["run-stage"] %}
    stage: {{ opts["run-stage"] }}
    {%- endif %}
    rules:
    {%- for rule in opts["run-rules"] or opts.rules %}
    -   !reference [.r-{{ rule }}]
    {%- endfor%}
    -   when: never
    {%- if opts["run-deps"] %}
    needs:
        {%- for dep in opts["run-deps"] %}
    -   job: build:{{ dep }}
        optional: true
        {%- endfor %}
    {%- endif %}
    variables:
    {%- if aux.ci.mechanism == "gitlab"%}
        SERVICES: {% for service in opts.services %}{{ aux.project.slug }}-{{ service }}{% endfor %}
    {%- elif aux.ci.mechanism == "mixed"%}
        SERVICE_NAME: {{ opts.services[0] }}
    {%- endif %}
        {%- if opts["run-deps"] | reject('in', opts.services) | list | length and aux.ci.mechanism == "gitlab" %}
        BUILD_DEPS: {% for dep in opts["run-deps"] | reject('in', opts.services) %}{{ aux.project.slug }}-{{ dep }}{% endfor %}
        {%- endif %}
        {%- if opts.overwrite %}
        OVERWRITE_COMPOSE: {% for over in opts.overwrite %}$DOCKER_DIR/overwrite-{{ over }}.yml{% endfor %}
        {%- endif %}
{% include 'coverage.jinja2' %}
{% endif -%}
{%- endfor %}
