From 37fe2f8c81e5991609f62acccd5c5cfdf7d429b8 Mon Sep 17 00:00:00 2001 From: Steve McMaster Date: Wed, 13 Dec 2023 20:44:34 -0500 Subject: [PATCH] Icons --- .drone.star | 13 ++++++++++++- _distro.tf.j2 | 3 +++ _lang.tf.j2 | 3 +++ android.tf.j2 | 1 + base.tf.j2 | 26 ++++++++++++++++++++++++-- jupyter.tf.j2 | 1 + splunk.tf.j2 | 19 ++++++++++++++++++- startup_scripts/splunk_ansible.sh.j2 | 2 -- terraform.tf.j2 | 1 + 9 files changed, 63 insertions(+), 6 deletions(-) delete mode 100644 startup_scripts/splunk_ansible.sh.j2 diff --git a/.drone.star b/.drone.star index 369913e..e99df17 100644 --- a/.drone.star +++ b/.drone.star @@ -3,6 +3,7 @@ TEMPLATES = { "alpine": { "distro_name": "Alpine Linux", "distro_shortname": "alpine", + "distro_icon": "https://s3.mcmaster.io/images/Alpine_Linux_logo.png", "distro_package_manager": "apk", "distro_releases": ["3.17", "3.18", "edge"], "image": "cr.smcm.xyz/coder-images/alpine", @@ -10,6 +11,7 @@ TEMPLATES = { "aports": { "distro_name": "Alpine Linux", "distro_shortname": "alpine", + "distro_icon": "https://s3.mcmaster.io/images/Alpine_Linux_logo.png", "distro_package_manager": "apk", "distro_releases": ["edge"], "image": "cr.smcm.xyz/coder-images/alpine", @@ -18,6 +20,7 @@ TEMPLATES = { "gcloud-terraform": { "distro_name": "Ubuntu Linux", "distro_shortname": "ubuntu", + "distro_icon": "/icons/ubuntu.svg", "distro_package_manager": "apt", "distro_releases": [], "image": "cr.smcm.xyz/coder-images/coder-devops", @@ -26,7 +29,8 @@ TEMPLATES = { "ubuntu": { "distro_name": "Ubuntu Linux", "distro_shortname": "ubuntu", - "distro_package_manager": "apk", + "distro_icon": "/icons/ubuntu.svg", + "distro_package_manager": "apt", "distro_releases": ["20.04", "22.04", "23.04", "23.10"], "image": "cr.smcm.xyz/coder-images/ubuntu", }, @@ -34,6 +38,7 @@ TEMPLATES = { "_lang": { "eclipse-temurin": { "lang": "eclipse-temurin", + "lang_icon": "/icons/java.svg", "versions": ["11-jdk", "17-jdk", "21-jdk"], "distro_choices": [ {"label": "Ubuntu", "suffix": ""}, @@ -42,6 +47,7 @@ TEMPLATES = { }, "golang": { "lang": "golang", + "lang_icon": "/icons/go.svg", "versions": ["1.21"], "distro_choices": [ {"label": "Debian", "suffix": ""}, @@ -50,6 +56,7 @@ TEMPLATES = { }, "gradle": { "lang": "gradle", + "lang_icon": "/icons/java.svg", "versions": ["8.3-jdk17"], "coder_user": "gradle", "distro_choices": [ @@ -59,6 +66,7 @@ TEMPLATES = { }, "maven": { "lang": "eclipse-temurin-maven", + "lang_icon": "/icons/java.svg", "versions": ["11", "17", "21"], "distro_choices": [ {"label": "Ubuntu", "suffix": ""}, @@ -67,6 +75,7 @@ TEMPLATES = { }, "node": { "lang": "node", + "lang_icon": "/icons/node.svg", "versions": ["18", "20"], "coder_user": "node", "distro_choices": [ @@ -76,6 +85,7 @@ TEMPLATES = { }, "python": { "lang": "python", + "lang_icon": "/icons/python.svg", "versions": ["3.8", "3.11"], "distro_choices": [ {"label": "Debian", "suffix": ""}, @@ -84,6 +94,7 @@ TEMPLATES = { }, "rust": { "lang": "rust", + "lang_icon": "/icons/rust.svg", "versions": ["1.71"], "distro_choices": [ {"label": "Debian", "suffix": ""}, diff --git a/_distro.tf.j2 b/_distro.tf.j2 index bc97a6b..6b95b28 100644 --- a/_distro.tf.j2 +++ b/_distro.tf.j2 @@ -8,6 +8,9 @@ data "coder_parameter" "distro_release" { description = "{{ distro_name }} Release" type = "string" default = "" + {% if distro_icon %} + icon = "{{ distro_icon }}" + {% endif %} mutable = true option { diff --git a/_lang.tf.j2 b/_lang.tf.j2 index 26e3de0..4888f13 100644 --- a/_lang.tf.j2 +++ b/_lang.tf.j2 @@ -8,6 +8,9 @@ data "coder_parameter" "version" { description = "{{lang}} Version" type = "string" default = "" + {% if lang_icon %} + icon = "{{ lang_icon }}" + {% endif %} mutable = true option { diff --git a/android.tf.j2 b/android.tf.j2 index 2f8bf2c..f8d5288 100644 --- a/android.tf.j2 +++ b/android.tf.j2 @@ -10,6 +10,7 @@ data "coder_parameter" "android_ndk_version" { description = "Android NDK version" type = "string" default = "21.4.7075529" + icon = "/icons/android-studio.svg" } {% endblock %} diff --git a/base.tf.j2 b/base.tf.j2 index 8ab0262..83ac94f 100644 --- a/base.tf.j2 +++ b/base.tf.j2 @@ -116,7 +116,7 @@ data "coder_parameter" "home_disk_size" { display_name = "Home disk size" description = "The size of the home disk in GB" default = "{{ coder_home_disk_size|default("10", true) }}" - type = "number" + type = "string" icon = "/emojis/1f4be.png" mutable = false validation { @@ -125,6 +125,28 @@ data "coder_parameter" "home_disk_size" { } } {% endblock %} + +{% block git_user_config %} +data "coder_parameter" "git_user_name" { + name = "git_user_name" + display_name = "Git user.name" + description = "Name used for git commits" + default = "${data.coder_workspace.me.owner}" + type = "string" + icon = "https://s3.mcmaster.io/images/programmer.png" + mutable = true +} + +data "coder_parameter" "git_email" { + name = "git_email" + display_name = "Git user.email" + description = "Email used for git commits" + default = "${data.coder_workspace.me.owner_email}" + type = "string" + icon = "https://s3.mcmaster.io/images/email.png" + mutable = true +} +{% endblock %} {% endblock %} {% block kubernetes %} @@ -186,7 +208,7 @@ resource "coder_agent" "main" { {% endfor %} {% endif %} {% endif %} - {% endblock %}+ + {% endblock %} {% block post_startup_script_install_packages %} {% endblock %} diff --git a/jupyter.tf.j2 b/jupyter.tf.j2 index a5441f8..d3619a6 100644 --- a/jupyter.tf.j2 +++ b/jupyter.tf.j2 @@ -9,6 +9,7 @@ resource "coder_app" "jupyter" { url = "http://localhost:8888/" subdomain = true share = "owner" + icon = "/icons/jupyter.svg" healthcheck { url = "http://localhost:8888/api" diff --git a/splunk.tf.j2 b/splunk.tf.j2 index 10c80f4..53af860 100644 --- a/splunk.tf.j2 +++ b/splunk.tf.j2 @@ -5,7 +5,7 @@ resource "coder_app" "splunk" { agent_id = coder_agent.main.id display_name = "Splunk Web" slug = "splunkweb" - icon = "https://avatars.githubusercontent.com/u/651467?s=120&v=4" + icon = "https://s3.mcmaster.io/images/Splunk.webp" url = "http://localhost:8000/" subdomain = true share = "public" @@ -46,6 +46,7 @@ data "coder_parameter" "splunk_version" { description = "Splunk Version" type = "string" default = "" + icon = "https://s3.mcmaster.io/images/Splunk.webp" mutable = true option { @@ -61,6 +62,22 @@ data "coder_parameter" "splunk_version" { } {% endblock %} +{% block coder_scripts %} +{{ super() }} + +resource "coder_script" "splunk_ansible" { + agent_id = coder_agent.main.id + display_name = "splunk_ansible" + run_on_start = true + run_on_stop = false + script = <