This commit is contained in:
parent
9411a5080c
commit
4bda1e0226
33
.drone.star
33
.drone.star
@ -32,6 +32,14 @@ TEMPLATES = {
|
||||
"image": "cr.smcm.xyz/coder-images/coder-devops",
|
||||
# "startup_scripts": ["gcloud", "terraform"],
|
||||
},
|
||||
"ollama-quantize": {
|
||||
"distro_name": "Debian Linux",
|
||||
"distro_shortname": "debian",
|
||||
"distro_icon": "/icons/debian.svg",
|
||||
"distro_package_manager": "apt",
|
||||
"distro_releases": [],
|
||||
"image": "cr.smcm.xyz/coder-images/coder-ollama-quantize",
|
||||
},
|
||||
"ubuntu": {
|
||||
"distro_name": "Ubuntu Linux",
|
||||
"distro_shortname": "ubuntu",
|
||||
@ -48,7 +56,7 @@ TEMPLATES = {
|
||||
"lang_icon": "/icon/java.svg",
|
||||
"versions": ["11-jdk", "17-jdk", "21-jdk"],
|
||||
"distro_choices": [
|
||||
{"label": "Ubuntu", "suffix": ""},
|
||||
{"label": "Ubuntu Jammy", "suffix": "-jammy"},
|
||||
{"label": "Alpine Linux", "suffix": "-alpine"},
|
||||
],
|
||||
},
|
||||
@ -57,7 +65,7 @@ TEMPLATES = {
|
||||
"lang_icon": "/icon/go.svg",
|
||||
"versions": ["1.21"],
|
||||
"distro_choices": [
|
||||
{"label": "Debian", "suffix": ""},
|
||||
{"label": "Debian Bookworm", "suffix": "-bookworm"},
|
||||
{"label": "Alpine Linux", "suffix": "-alpine"},
|
||||
],
|
||||
},
|
||||
@ -72,9 +80,10 @@ TEMPLATES = {
|
||||
],
|
||||
},
|
||||
"maven": {
|
||||
"lang": "eclipse-temurin-maven",
|
||||
"lang": "maven",
|
||||
"lang_icon": "/icon/java.svg",
|
||||
"versions": ["11", "17", "21"],
|
||||
"tag_prefix": "3-eclipse-temurin-",
|
||||
"distro_choices": [
|
||||
{"label": "Ubuntu", "suffix": ""},
|
||||
{"label": "Alpine Linux", "suffix": "-alpine"},
|
||||
@ -86,7 +95,7 @@ TEMPLATES = {
|
||||
"versions": ["18", "20"],
|
||||
"coder_user": "node",
|
||||
"distro_choices": [
|
||||
{"label": "Debian", "suffix": ""},
|
||||
{"label": "Debian Bookworm", "suffix": "-bookworm"},
|
||||
{"label": "Alpine Linux", "suffix": "-alpine"},
|
||||
],
|
||||
},
|
||||
@ -95,7 +104,7 @@ TEMPLATES = {
|
||||
"lang_icon": "/icon/python.svg",
|
||||
"versions": ["3.8", "3.11"],
|
||||
"distro_choices": [
|
||||
{"label": "Debian", "suffix": ""},
|
||||
{"label": "Debian Bookworm", "suffix": "-bookworm"},
|
||||
{"label": "Alpine Linux", "suffix": "-alpine"},
|
||||
],
|
||||
},
|
||||
@ -104,14 +113,14 @@ TEMPLATES = {
|
||||
"lang_icon": "/icon/rust.svg",
|
||||
"versions": ["1.71"],
|
||||
"distro_choices": [
|
||||
{"label": "Debian", "suffix": ""},
|
||||
{"label": "Debian Bookworm", "suffix": "-bookworm"},
|
||||
{"label": "Alpine Linux", "suffix": "-alpine"},
|
||||
],
|
||||
},
|
||||
},
|
||||
"android": {
|
||||
"android-2023-06": {
|
||||
"image": "cr.smcm.xyz/coder-images/android-2023.06",
|
||||
"image": "cr.smcm.xyz/coder-images/android:2023.06",
|
||||
"coder_user": "circleci",
|
||||
"coder_user_uid": "1001",
|
||||
"coder_user_gid": "1002",
|
||||
@ -120,7 +129,7 @@ TEMPLATES = {
|
||||
},
|
||||
"jupyter": {
|
||||
"jupyter-scipy-notebook": {
|
||||
"image": "cr.smcm.xyz/coder-images/jupyter-scipy-notebook",
|
||||
"image": "cr.smcm.xyz/coder-images/jupyter:scipy-notebook",
|
||||
"coder_user": "jovyan",
|
||||
"coder_user_gid": "100",
|
||||
},
|
||||
@ -128,7 +137,7 @@ TEMPLATES = {
|
||||
"splunk": {
|
||||
"splunk": {
|
||||
"image": "cr.smcm.xyz/coder-images/splunk",
|
||||
"splunk_versions": ["8.2", "9.0", "9.1"],
|
||||
"splunk_versions": ["8.2", "9.0", "9.1", "9.2"],
|
||||
"coder_user": "splunk",
|
||||
"coder_user_home": "/opt/splunk/etc",
|
||||
"coder_user_uid": "41812",
|
||||
@ -136,12 +145,6 @@ TEMPLATES = {
|
||||
"vs_code_root": "/opt/splunk",
|
||||
},
|
||||
},
|
||||
"terraform": {
|
||||
"terraform": {
|
||||
"image": "cr.smcm.xyz/coder-images/terraform",
|
||||
"terraform_versions": ["1.6"],
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
def main(ctx):
|
||||
|
||||
@ -7,25 +7,21 @@ data "coder_parameter" "distro_release" {
|
||||
name = "{{ distro_name }} Release"
|
||||
description = "{{ distro_name }} Release"
|
||||
type = "string"
|
||||
default = ""
|
||||
default = "{{ distro_releases[-1] }}"
|
||||
{% if distro_icon %}
|
||||
icon = "{{ distro_icon }}"
|
||||
{% endif %}
|
||||
|
||||
mutable = true
|
||||
option {
|
||||
name = "Latest"
|
||||
value = ""
|
||||
}
|
||||
{% for version in distro_releases %}
|
||||
option {
|
||||
name = "{{ version }}"
|
||||
value = "-{{ version }}"
|
||||
value = "{{ version }}"
|
||||
}
|
||||
{% endfor %}
|
||||
}
|
||||
{% endblock %}
|
||||
|
||||
{% block kubernetes_pod_main_image %}
|
||||
image = "{{image}}${data.coder_parameter.distro_release.value}:latest"
|
||||
image = "{{image}}:${data.coder_parameter.distro_release.value}"
|
||||
{% endblock %}
|
||||
16
_lang.tf.j2
16
_lang.tf.j2
@ -1,5 +1,9 @@
|
||||
{% extends "base.tf.j2" %}
|
||||
|
||||
{% if tag_prefix is not defined %}
|
||||
{% set tag_prefix = "" %}
|
||||
{% endif %}
|
||||
|
||||
{% block parameters %}
|
||||
{{ super() }}
|
||||
|
||||
@ -7,7 +11,7 @@ data "coder_parameter" "version" {
|
||||
name = "{{lang}} Version"
|
||||
description = "{{lang}} Version"
|
||||
type = "string"
|
||||
default = ""
|
||||
default = "{{ versions[-1] }}"
|
||||
{% if lang_icon %}
|
||||
icon = "{{ lang_icon }}"
|
||||
{% endif %}
|
||||
@ -20,11 +24,12 @@ data "coder_parameter" "version" {
|
||||
{% for version in versions %}
|
||||
option {
|
||||
name = "{{ version }}"
|
||||
value = "-{{ version }}"
|
||||
value = "{{ version }}"
|
||||
}
|
||||
{% endfor %}
|
||||
}
|
||||
|
||||
{% if distro_choices %}
|
||||
data "coder_parameter" "container_base" {
|
||||
name = "Container Base"
|
||||
description = "Container Base"
|
||||
@ -38,8 +43,13 @@ data "coder_parameter" "container_base" {
|
||||
}
|
||||
{% endfor %}
|
||||
}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block kubernetes_pod_main_image %}
|
||||
image = "cr.smcm.xyz/coder-images/{{lang}}${data.coder_parameter.version.value}${data.coder_parameter.container_base.value}:latest"
|
||||
{% 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 %}
|
||||
@ -411,7 +411,7 @@ resource "kubernetes_deployment" "main" {
|
||||
container {
|
||||
name = "dev"
|
||||
{% block kubernetes_pod_main_image %}
|
||||
image = "{{image}}:latest"
|
||||
image = "{{image}}"
|
||||
{% endblock %}
|
||||
{% block kubernetes_pod_main_command %}
|
||||
command = ["bash", "-c", coder_agent.main.init_script]
|
||||
|
||||
@ -45,14 +45,10 @@ data "coder_parameter" "splunk_version" {
|
||||
name = "Splunk Version"
|
||||
description = "Splunk Version"
|
||||
type = "string"
|
||||
default = ""
|
||||
default = "{{ splunk_versions[-1] }}"
|
||||
icon = "https://s3.mcmaster.io/images/Splunk.webp"
|
||||
|
||||
mutable = true
|
||||
option {
|
||||
name = "Latest"
|
||||
value = ""
|
||||
}
|
||||
{% for version in splunk_versions %}
|
||||
option {
|
||||
name = "{{ version }}"
|
||||
@ -79,5 +75,5 @@ resource "coder_script" "splunk_ansible" {
|
||||
{% endblock %}
|
||||
|
||||
{% block kubernetes_pod_main_image %}
|
||||
image = "{{image}}${data.coder_parameter.splunk_version.value}:latest"
|
||||
image = "{{image}}:${data.coder_parameter.splunk_version.value}"
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user