fix: correct free disk space reported by agent metadata in fly.io example (#7592)

This commit is contained in:
Muhammad Atif Ali
2023-05-18 11:42:04 +03:00
committed by GitHub
parent ec5ef51b49
commit 63a9e34381
+4 -3
View File
@@ -284,10 +284,11 @@ resource "coder_agent" "main" {
code-server --auth none >/tmp/code-server.log 2>&1 &
# Set the hostname to the workspace name
sudo hostname -b "${data.coder_workspace.me.name}-fly"
echo "127.0.0.1 ${data.coder_workspace.me.name}-fly" | sudo tee -a /etc/hosts
# Install the Fly CLI and add it to the PATH
curl -L https://fly.io/install.sh | sh
echo "export PATH=$PATH:/home/coder/.fly/bin" >> ~/.bashrc
source ~/.bashrc
echo "export PATH=$PATH:/home/coder/.fly/bin" >> /home/coder/.bashrc
source /home/coder/.bashrc
EOT
metadata {
@@ -320,7 +321,7 @@ resource "coder_agent" "main" {
script = <<-EOT
#!/bin/bash
set -e
df /home/coder | awk '$NF=="/"{printf "%s", $5}'
df | awk '$NF=="/home/coder" {printf "%s", $5}'
EOT
}
}