2024-08-20 19:03:23 +00:00
|
|
|
# Always use devbox environment to run commands.
|
|
|
|
set shell := ["devbox", "run"]
|
|
|
|
# Load dotenv
|
|
|
|
set dotenv-load
|
|
|
|
|
|
|
|
export TENV_AUTO_INSTALL := "true"
|
|
|
|
|
|
|
|
default:
|
|
|
|
@just --list
|
|
|
|
|
|
|
|
lint:
|
|
|
|
@tofu fmt -check -recursive .
|
|
|
|
@tflint --recursive
|
|
|
|
|
|
|
|
build:
|
2024-08-25 15:47:41 +00:00
|
|
|
@nix build ./proxmox#vm
|
2024-08-20 19:03:23 +00:00
|
|
|
|
2024-08-22 16:16:39 +00:00
|
|
|
push:
|
|
|
|
#!/usr/bin/env sh
|
2024-08-25 15:47:41 +00:00
|
|
|
export NIXOS_IMAGE=$(nix path-info --quiet ./proxmox#vm)/nixos.qcow2
|
2024-08-22 16:16:39 +00:00
|
|
|
export VERSION=$(echo $NIXOS_IMAGE | cut -d'/' -f4 | cut -d'-' -f1)
|
|
|
|
|
|
|
|
echo "Uploading $NIXOS_IMAGE to code.tjo.space"
|
|
|
|
echo "Version: $VERSION"
|
|
|
|
|
|
|
|
curl --user $CODE_TJO_SPACE_USER:$CODE_TJO_SPACE_TOKEN \
|
|
|
|
--progress-bar \
|
|
|
|
--upload-file $NIXOS_IMAGE \
|
|
|
|
https://code.tjo.space/api/packages/tjo-cloud/generic/ingress/${VERSION}/nixos.qcow2
|
|
|
|
|
2024-08-23 20:03:47 +00:00
|
|
|
deploy: build
|
2024-08-20 19:03:23 +00:00
|
|
|
#!/usr/bin/env sh
|
2024-08-25 15:47:41 +00:00
|
|
|
export NIXOS_IMAGE=$(nix path-info --quiet ./proxmox#vm)/nixos.qcow2
|
2024-08-22 16:16:39 +00:00
|
|
|
export TF_VAR_image_path=$NIXOS_IMAGE
|
2024-08-20 19:03:23 +00:00
|
|
|
|
2024-08-23 20:03:47 +00:00
|
|
|
echo "Deploying $NIXOS_IMAGE"
|
|
|
|
|
2024-08-20 19:03:23 +00:00
|
|
|
cd {{justfile_directory()}}/terraform
|
|
|
|
tofu init
|
|
|
|
tofu apply
|
2024-08-25 15:47:41 +00:00
|
|
|
|
|
|
|
destroy:
|
|
|
|
#!/usr/bin/env sh
|
|
|
|
cd {{justfile_directory()}}/terraform
|
|
|
|
tofu destroy
|