feat(id.tjo.space): changes

This commit is contained in:
Tine 2025-03-06 20:35:20 +01:00
parent 0864eedc9e
commit 7e2485bdbf
Signed by: mentos1386
SSH key fingerprint: SHA256:MNtTsLbihYaWF8j1fkOHfkKNlnN1JQfxEU/rBU8nCGw
4 changed files with 47 additions and 47 deletions

View file

@ -2,7 +2,7 @@
set -euo pipefail
echo "== Fetch Source Code (from git)"
cd "$HOME/service"
cd "/root/service"
# Clone if not yet cloned
if [ ! -d .git ]; then
git clone \

View file

@ -1,52 +1,6 @@
default:
@just --list
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 -name tofu.tfstate -o -name terraform.tfstate)
do
echo "Encrypting $file"
sops \
--encrypt \
--input-type=json \
--output-type=json \
$file > ${file}.encrypted
done
tofu-state-decrypt:
#!/bin/bash
for file in $(find -name tofu.tfstate.encrypted -o -name terraform.tfstate.encrypted)
do
echo "Decrypting $file"
sops \
--decrypt \
--input-type=json \
--output-type=json \
$file > ${file%.encrypted}
done
lint:
@tofu fmt -check -recursive .
@tflint --recursive
format:
@tofu fmt -recursive .
@tflint --recursive
apply:
#!/usr/bin/env sh
cd {{source_directory()}}/terraform

View file

@ -7,3 +7,49 @@ mod id 'id.tjo.space'
default:
@just --list
lint:
@tofu fmt -check -recursive .
@tflint --recursive
format:
@tofu fmt -recursive .
@tflint --recursive
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 -name tofu.tfstate -o -name terraform.tfstate)
do
echo "Encrypting $file"
sops \
--encrypt \
--input-type=json \
--output-type=json \
$file > ${file}.encrypted
done
tofu-state-decrypt:
#!/bin/bash
for file in $(find -name tofu.tfstate.encrypted -o -name terraform.tfstate.encrypted)
do
echo "Decrypting $file"
sops \
--decrypt \
--input-type=json \
--output-type=json \
$file > ${file%.encrypted}
done