mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix(dogfood/contents): fix resource metadata under nix (#16349)
Co-authored-by: Thomas Kosiewski <tk@coder.com>
This commit is contained in:
co-authored by
Thomas Kosiewski
parent
a15f06a7e3
commit
6b3e14f3fa
@@ -249,7 +249,7 @@ resource "coder_agent" "dev" {
|
||||
key = "swap_usage_host"
|
||||
order = 4
|
||||
script = <<EOT
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
echo "$(free -b | awk '/^Swap/ { printf("%.1f/%.1f", $3/1024.0/1024.0/1024.0, $2/1024.0/1024.0/1024.0) }') GiB"
|
||||
EOT
|
||||
interval = 10
|
||||
@@ -262,7 +262,7 @@ resource "coder_agent" "dev" {
|
||||
order = 5
|
||||
# get load avg scaled by number of cores
|
||||
script = <<EOT
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
echo "`cat /proc/loadavg | awk '{ print $1 }'` `nproc`" | awk '{ printf "%0.2f", $1/$2 }'
|
||||
EOT
|
||||
interval = 60
|
||||
@@ -283,7 +283,7 @@ resource "coder_agent" "dev" {
|
||||
key = "word"
|
||||
order = 7
|
||||
script = <<EOT
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
curl -o - --silent https://www.merriam-webster.com/word-of-the-day 2>&1 | awk ' $0 ~ "Word of the Day: [A-z]+" { print $5; exit }'
|
||||
EOT
|
||||
interval = 86400
|
||||
@@ -291,6 +291,7 @@ resource "coder_agent" "dev" {
|
||||
}
|
||||
|
||||
startup_script = <<-EOT
|
||||
#!/usr/bin/env bash
|
||||
set -eux -o pipefail
|
||||
|
||||
# Allow synchronization between scripts.
|
||||
|
||||
Reference in New Issue
Block a user