This repository has been archived on 2026-01-10. You can view files and clone it, but cannot push or open issues or pull requests.
coder-templates/_lang.tf.j2
Steve McMaster 4bda1e0226
Some checks failed
continuous-integration/drone/push Build is failing
update
2024-02-03 14:23:08 -05:00

55 lines
1.3 KiB
Django/Jinja

{% extends "base.tf.j2" %}
{% if tag_prefix is not defined %}
{% set tag_prefix = "" %}
{% endif %}
{% block parameters %}
{{ super() }}
data "coder_parameter" "version" {
name = "{{lang}} Version"
description = "{{lang}} Version"
type = "string"
default = "{{ versions[-1] }}"
{% if lang_icon %}
icon = "{{ lang_icon }}"
{% endif %}
mutable = true
option {
name = "Latest"
value = ""
}
{% for version in versions %}
option {
name = "{{ version }}"
value = "{{ version }}"
}
{% endfor %}
}
{% if distro_choices %}
data "coder_parameter" "container_base" {
name = "Container Base"
description = "Container Base"
type = "string"
default = "{{ distro_choices[0]["suffix"] }}"
mutable = false
{% for distro_choice in distro_choices %}
option {
name = "{{ distro_choice["label"] }}"
value = "{{ distro_choice["suffix"] }}"
}
{% endfor %}
}
{% endif %}
{% endblock %}
{% block kubernetes_pod_main_image %}
{% if distro_choices %}
image = "cr.smcm.xyz/coder-images/{{lang}}:{{tag_prefix}}${data.coder_parameter.version.value}${data.coder_parameter.container_base.value}"
{% else %}
image = "cr.smcm.xyz/coder-images/{{lang}}:{{tag_prefix}}${data.coder_parameter.version.value}"
{% endif %}
{% endblock %}