From 77285e8c299c61f48a9542e997094b79c11b8581 Mon Sep 17 00:00:00 2001 From: Steve McMaster Date: Sat, 5 Aug 2023 00:45:53 -0400 Subject: [PATCH] test --- .drone.star | 29 ++++++++++++++++------------- base.tf.jinja | 2 +- splunk.tf.jinja | 27 +++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 14 deletions(-) diff --git a/.drone.star b/.drone.star index 9ac0582..450f951 100644 --- a/.drone.star +++ b/.drone.star @@ -4,25 +4,25 @@ TEMPLATES = { "base": { # "android": {"image": "codercom/enterprise-android:ubuntu"}, # "kubernetes": {"image": "codercom/enterprise-base:ubuntu"}, - "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"}, + # "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"}, + "alpine": {"image": "cr.smcm.xyz/coder-images/alpine"}, # "alpine-315": {"image": "cr.smcm.xyz/coder-images/alpine-3.15:latest"}, - "alpine-317": {"image": "cr.smcm.xyz/coder-images/alpine-3.17:latest"}, - "alpine-edge": {"image": "cr.smcm.xyz/coder-images/alpine-edge:latest"}, + "alpine-317": {"image": "cr.smcm.xyz/coder-images/alpine-3.17"}, + "alpine-edge": {"image": "cr.smcm.xyz/coder-images/alpine-edge"}, }, "android": { "android-2023-06": { - "image": "cr.smcm.xyz/coder-images/android-2023.06:latest", + "image": "cr.smcm.xyz/coder-images/android-2023.06", "coder_user_uid": "1001", "coder_user_gid": "1002", }, "android-2022-09": { - "image": "cr.smcm.xyz/coder-images/android-2022.09.2:latest", + "image": "cr.smcm.xyz/coder-images/android-2022.09.2", "coder_user_uid": "3434", "coder_user_gid": "3434", } @@ -35,9 +35,12 @@ TEMPLATES = { } }, "splunk": { - "splunk": {"image": "cr.smcm.xyz/coder-images/splunk:latest"}, - "splunk-82": {"image": "cr.smcm.xyz/coder-images/splunk-8.2:latest"}, - "splunk-90": {"image": "cr.smcm.xyz/coder-images/splunk-9.0:latest"}, + "splunk": { + "image": "cr.smcm.xyz/coder-images/splunk", + "splunk_versions": "8.2,9.0" + }, + # "splunk-82": {"image": "cr.smcm.xyz/coder-images/splunk-8.2:latest"}, + # "splunk-90": {"image": "cr.smcm.xyz/coder-images/splunk-9.0:latest"}, }, # "proxychains": { # "splunk-python": {"image": "cr.smcm.xyz/coder-images/python-38:latest"}, @@ -45,7 +48,7 @@ TEMPLATES = { "jupyter": { # "jupyter-base-notebook": {"image": "cr.smcm.xyz/coder-images/jupyter-base-notebook:latest"}, # "jupyter-minimal-notebook": {"image": "cr.smcm.xyz/coder-images/jupyter-minimal-notebook:latest"}, - "jupyter-scipy-notebook": {"image": "cr.smcm.xyz/coder-images/jupyter-scipy-notebook:latest"}, + "jupyter-scipy-notebook": {"image": "cr.smcm.xyz/coder-images/jupyter-scipy-notebook"}, }, } diff --git a/base.tf.jinja b/base.tf.jinja index 2d45763..ca14bc8 100644 --- a/base.tf.jinja +++ b/base.tf.jinja @@ -280,7 +280,7 @@ resource "kubernetes_deployment" "main" { container { name = "dev" {% block kubernetes_pod_main_image %} - image = "{{image}}" + image = "{{image}}:latest" {% endblock %} {% block kubernetes_pod_main_command %} command = ["bash", "-c", coder_agent.main.init_script] diff --git a/splunk.tf.jinja b/splunk.tf.jinja index 42da99d..b4e8260 100644 --- a/splunk.tf.jinja +++ b/splunk.tf.jinja @@ -45,4 +45,31 @@ resource "coder_app" "splunk" { name = "home" read_only = false } +{% endblock %} + +{% block parameters %} +{{ super() }} + +data "coder_parameter" "splunk_version" { + name = "Splunk Version" + description = "Splunk Version" + type = "string" + default = "" + + mutable = true + option { + name = "Latest" + value = "" + } + {% for version in splunk_version.split(",") %} + option { + name = "{{ version }}" + value = "-{{ version | replace(".", "") }}" + } + {% endfor %} +} +{% endblock %} + +{% block kubernetes_pod_main_image %} + image = "{{image}}${data.coder_parameter.splunk_version.value}:latest" {% endblock %} \ No newline at end of file