# Always use devbox environment to run commands. set shell := ["devbox", "run"] # Load dotenv set dotenv-load default: @just --list lint: @tofu fmt -check -recursive . @tflint --recursive deploy: #!/usr/bin/env sh cd {{justfile_directory()}}/terraform tofu init tofu apply destroy: #!/usr/bin/env sh cd {{justfile_directory()}}/terraform tofu destroy configure: #!/usr/bin/env sh set -euo pipefail for node in $(ls configs/node.*.yaml | cut -d '.' -f 2) do echo "Configuring ${node}.network.tjo.cloud" for file in {{justfile_directory()}}/openwrt/etc/config/* do echo "Deploying /etc/config/$(basename $file)" gomplate --file $file \ --datasource common=configs/common.yaml \ --datasource node=configs/node.${node}.yaml \ | tailscale ssh "root@${node}-network-tjo-cloud" "cat > /etc/config/$(basename $file)" done echo "Reboot router in 5 seconds..." sleep 5 echo "Rebooting router..." tailscale ssh "root@${node}-network-tjo-cloud" "reboot" done