#jinja2: variable_start_string: '[%', variable_end_string: '%]'
apiVersion: unfurl/v1alpha1
kind: Project

# The presence of this YAML file indicates that this directory contains an Unfurl project.

# These "?include" directives merge these files so secret and local-only settings can be managed separately.
[%include | default("") %]

# The primary thing configured here is the environment that ensembles are deployed in.
# An ensemble's environment is assembled by merging settings that appear in the project
# where it is located, the project that manages it (if different), and the project specified in UNFURL_HOME.

# An environment has various settings to set the context on an ensemble, including
# environment variables, connections, secrets, locals, repositories, imports and inputs
# It can also can include a "defaultProject" key, which specifies the location
# of an ensemble created with a matching "--use-environment" argument
# See https://docs.unfurl.run/environments.html

# environments:
#   defaults:
      # There can multiple environment with different names but they will merge with the defaults specified here.
      # variables:
      # connections:
      # (etc.)
{%- if default_context | default("") %}
#   [%default_context%]:
      # variables:
      # connections:
      # (etc.)
{% endif %}

{%- if default_context | default("") %}
# This sets the default environment to use for new ensembles created in this project.
default_environment: [%default_context%]
{% endif %}

{%- if manifestPath %}
# these are the ensembles managed by this project
# (note that they can be located in a different project)
ensembles:
  - file: [%manifestPath%]
    default: true
    {%- if external | default("") %}
    # the ensemble is located in a different project
    project: [%external%]
    {% endif -%}
    {% if context | default("") %}
    environment: [%context%]
    {% else %}
    # uncomment to associate this ensemble with an environment
    # environment: your_environment
    {% endif %}
{% endif %}
