infrastructure/justfile

50 lines
930 B
Makefile
Raw Normal View History

2024-07-21 10:27:40 +00:00
# Always use devbox environment to run commands.
set shell := ["devbox", "run"]
# Load dotenv
set dotenv-load
2024-08-31 17:48:38 +00:00
mod k8s 'k8s.tjo.cloud'
mod network 'network.tjo.cloud'
mod ingress 'ingress.tjo.cloud'
dot-env-encrypt:
sops \
--encrypt \
--input-type=dotenv \
--output-type=dotenv \
.env > .env.encrypted
dot-env-decrypt:
sops \
--decrypt \
--input-type=dotenv \
--output-type=dotenv \
.env.encrypted > .env
tofu-state-encrypt:
#!/bin/bash
for file in $(find tofu.tfstate); do
sops \
--encrypt \
--input-type=json \
--output-type=json \
$file > ${file}.encrypted
done
tofu-state-decrypt:
#!/bin/bash
for file in $(find tofu.tfstate.encrypted); do
sops \
--decrypt \
--input-type=json \
--output-type=json \
$file > ${file%.encrypted}
done
2024-08-31 17:48:38 +00:00
2024-08-02 20:10:21 +00:00
default:
@just --list
2024-07-25 15:42:08 +00:00
lint:
@tofu fmt -check -recursive .
@tflint --recursive