# automatically generated by auxilium
{%- for job, opts in aux.ci.jobs.items() -%}
{%- if opts.build -%}
build:{{ job }}:
    extends: .template-build
    {%-if opts["build-stage"]%}
    stage: {{ opts["build-stage"] }}
    {%- endif %}
    {%-if opts["build-deps"] %}
    needs:
        {%- for dep in opts["build-deps"] %}
    -   job: build:{{ dep }}
        optional: true
        {%- endfor%}
    {%- endif %}
    variables:
    {%- if aux.ci.mechanism == "gitlab"%}
        SERVICE_NAME: {{ aux.project.slug }}-{{ job }}
    {%- elif aux.ci.mechanism == "mixed"%}
        SERVICE_NAME: {{ job }}
    {%- endif %}
        {%-if opts["build-deps"] and aux.ci.mechanism == "gitlab"%}
        BUILD_DEPS: {{ aux.project.slug }}-{{ opts["build-deps"][0] }}
        {%- endif %}
    rules:
    {%- for rule in opts["build-rules"] or opts.rules %}
    -   !reference [.r-{{ rule }}]
    {%- endfor%}
    -   changes:
        -   devops/docker/{{ aux.project.slug }}-{{ job }}.dockerfile
        {%- for file in opts.files %}
        -   {{ file }}
        {%- endfor%}
    -   when: never

{% endif -%}
{%- endfor %}
