ingress/justfile
2024-08-25 17:47:41 +02:00

45 lines
1 KiB
Makefile

# 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:
@nix build ./proxmox#vm
push:
#!/usr/bin/env sh
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
deploy: build
#!/usr/bin/env sh
export NIXOS_IMAGE=$(nix path-info --quiet ./proxmox#vm)/nixos.qcow2
export TF_VAR_image_path=$NIXOS_IMAGE
echo "Deploying $NIXOS_IMAGE"
cd {{justfile_directory()}}/terraform
tofu init
tofu apply
destroy:
#!/usr/bin/env sh
cd {{justfile_directory()}}/terraform
tofu destroy