This commit is contained in:
Steve McMaster 2023-08-05 00:28:15 -04:00
parent 3a467b5c55
commit 964994fc4c
3 changed files with 47 additions and 3 deletions

View File

@ -1,11 +1,13 @@
CODER_URL = "https://github.com/coder/coder/releases/download/v0.24.1/coder_0.24.1_linux_amd64.tar.gz"
CODER_URL = "https://github.com/coder/coder/releases/download/v2.0.0/coder_2.0.0_linux_amd64.tar.gz"
TEMPLATES = {
"base": {
# "android": {"image": "codercom/enterprise-android:ubuntu"},
# "kubernetes": {"image": "codercom/enterprise-base:ubuntu"},
"python-38": {"image": "cr.smcm.xyz/coder-images/python-38:latest"},
"python-311": {"image": "cr.smcm.xyz/coder-images/python-311:latest"},
"python-38": {"image": "cr.smcm.xyz/coder-images/python-3.8:latest"},
"python-38-alpine3.18": {"image": "cr.smcm.xyz/coder-images/python-3.8-alpine3.18:latest"},
"python-311": {"image": "cr.smcm.xyz/coder-images/python-3.11:latest"},
"python-311-alpine3.18": {"image": "cr.smcm.xyz/coder-images/python-3.11-alpine3.18:latest"},
},
"alpine": {
"alpine": {"image": "cr.smcm.xyz/coder-images/alpine:latest"},
@ -25,6 +27,13 @@ TEMPLATES = {
"coder_user_gid": "3434",
}
},
"python": {
"python": {
"image": "cr.smcm.xyz/coder-images/python${data.coder_parameter.python_version.value}${locals.alpine}:latest",
"python_versions": "3.8,3.11",
"alpine_version": "3.18"
}
}
"splunk": {
"splunk": {"image": "cr.smcm.xyz/coder-images/splunk:latest"},
"splunk-82": {"image": "cr.smcm.xyz/coder-images/splunk-8.2:latest"},

View File

@ -13,6 +13,11 @@ terraform {
}
{% endblock %}
locals {
{% block locals %}
{% endblock %}
}
{% block parameters %}
{% block cpu_parameter %}
data "coder_parameter" "cpu" {
@ -274,7 +279,9 @@ resource "kubernetes_deployment" "main" {
{% block kubernetes_pod_main_container %}
container {
name = "dev"
{% block kubernetes_pod_main_image %}
image = "{{image}}"
{% endblock %}
{% block kubernetes_pod_main_command %}
command = ["bash", "-c", coder_agent.main.init_script]
{% endblock %}

28
python.jinja Normal file
View File

@ -0,0 +1,28 @@
{% extends "base.tf.jinja" %}
{% block locals %}
alpine = $data.coder_parameter.use_alpine.value ? "-alpine{{ alpine_version | replace(".", ",") }}" : ""
{% endblock %}
{% block parameters %}
{{ super() }}
data "coder_parameter" "python_version" {
name = "Python Version"
description = "Python Version"
type = "string"
default = ""
mutable = true
option {
name = "Latest"
value = ""
}
{% for version in python_versions.split(",") %}
option {
name = "{{ version }}"
value = "-{{ version | replace(".", "") }}"
}
{% endfor %}
}
{% endblock %}