112 lines
2.7 KiB
Django/Jinja
112 lines
2.7 KiB
Django/Jinja
{% extends "base.tf.j2" %}
|
|
|
|
{% block parameters %}
|
|
{{ super() }}
|
|
|
|
{% if coder_parameters %}
|
|
{% for param in coder_parameters %}
|
|
data "coder_parameter" "{{ param.name }}" {
|
|
name = "{{ param.display_name | default(param.name) }}"
|
|
ephemeral = {{ param.ephemeral | default("false", true) }}
|
|
mutable = {{ param.mutable | default("true", true) }}
|
|
type = "{{ param.type | default("string")}}"
|
|
|
|
{% if param.default %}
|
|
default = "{{ param.default }}"
|
|
{% endif %}
|
|
{% if param.description %}
|
|
description = "{{ param.description }}"
|
|
{% endif %}
|
|
{% if param.display_name %}
|
|
display_name = "{{ param.display_name }}"
|
|
{% endif %}
|
|
{% if param.form_type %}
|
|
form_type = "{{ param.form_type }}"
|
|
{% endif %}
|
|
{% if param.icon %}
|
|
icon = "{{ param.icon }}"
|
|
{% endif %}
|
|
{% if param.order %}
|
|
order = {{ param.order }}
|
|
{% endif %}
|
|
{% if param.styling %}
|
|
styling = "{{ param.styling }}"
|
|
{% endif %}
|
|
|
|
{% for option in param.options %}
|
|
option {
|
|
{% if hasattr(option, "items") %}
|
|
name = "{{ option.name }}"
|
|
value = "{{ option.value | default(option.name) }}"
|
|
{% if option.description %}
|
|
description = "{{ option.description }}"
|
|
{% endif %}
|
|
{% if option.icon %}
|
|
icon = "{{ option.icon }}"
|
|
{% endif %}
|
|
{% else %}
|
|
name = "{{ option }}"
|
|
value = "{{ option }}"
|
|
{% endif %}
|
|
}
|
|
{% endfor %}
|
|
|
|
{% if param.validation %}
|
|
|
|
{% endif %}
|
|
}
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% endblock %}
|
|
|
|
{% block coder_apps %}
|
|
{% if coder_apps %}
|
|
{% for app in coder_apps %}
|
|
resource "coder_app" "jupyter" {
|
|
agent_id = coder_agent.main.id
|
|
display_name = {{ app.display_name }}
|
|
slug = {{ app.slug }}
|
|
icon = {{ app.icon }}
|
|
url = {{ app.url }}
|
|
subdomain = true
|
|
share = "owner"
|
|
|
|
{% if app.healthcheck %}
|
|
healthcheck {
|
|
url = {{ app.healthcheck.url }}
|
|
interval = {{ app.healthcheck.interval | default(3) }}
|
|
threshold = {{ app.healthcheck.threshold | default (10) }}
|
|
}
|
|
{% endif %}
|
|
}
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% endblock %}
|
|
|
|
{% block kubernetes_pod_extra_env %}
|
|
{% if envvars %}
|
|
{% for envvar in envvars %}
|
|
env {
|
|
name = "{{ envvar.name | upper() }}"
|
|
value = "{{ envvar.value }}"
|
|
}
|
|
{{ super() }}
|
|
{% endblock %}
|
|
|
|
{% block kubernetes_pod_main_volume_mount %}
|
|
{% if main_volume_mount_path %}
|
|
volume_mount {
|
|
mount_path = "{{ main_volume_mount_path }}"
|
|
name = "home"
|
|
read_only = false
|
|
}
|
|
{% else %}
|
|
{{ super() }}
|
|
{% endif %}
|
|
{% endblock %}
|
|
|
|
{% block post_startup_script_setup_home %}
|
|
{% if startup_script %}
|
|
{{ startup_script }}
|
|
{% endif %}
|
|
{% endblock %} |