ingress/justfile

46 lines
1 KiB
Makefile
Raw Normal View History

# 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
push:
#!/usr/bin/env sh
2024-08-25 15:47:41 +00:00
export NIXOS_IMAGE=$(nix path-info --quiet ./proxmox#vm)/nixos.qcow2
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
#!/usr/bin/env sh
2024-08-25 15:47:41 +00:00
export NIXOS_IMAGE=$(nix path-info --quiet ./proxmox#vm)/nixos.qcow2
export TF_VAR_image_path=$NIXOS_IMAGE
2024-08-23 20:03:47 +00:00
echo "Deploying $NIXOS_IMAGE"
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