-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
52 lines (40 loc) · 1.22 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
set positional-arguments
# default action: list actions
default:
@just --list
# encode secrets
@encode *args='':
sops -e secrets.yaml $@ > secrets.enc.yaml
sops --output-type yaml -e .auto.tfvars.json $@ > .auto.tfvars.enc.yaml
# decode secrets
@decode *args='':
sops -d secrets.enc.yaml $@ > secrets.yaml
sops --output-type json -d .auto.tfvars.enc.yaml $@ > .auto.tfvars.json
# log in to the Terraform Cloud backend
@login *args='':
tofu login app.terraform.io -- $@
# build a main.tf.json
@convert:
nix run .#convert
# clean the local working state,
# fixes error: backend initialization required: please run "tofu init"
@clean *args='':
nix run .#clean -- $@
# run CI test locally
ci:
woodpecker-cli exec --env "SOPS_AGE_KEY=$SOPS_AGE_KEY"
# test thru a VM locally
@vm *args='':
nix run .#vm -- $@
# generate an [`age`](https://age-encryption.org/) key pair
keygen:
rage-keygen -o keys.txt
# remove local state and derived credentials
@destroy *args='':
nix run .#destroy -- $@
# update dependencies
update:
nix flake update && rm -f .terraform.lock.hcl && tofu init && tofu providers lock
# import lost state - works only once local state has been created
import:
nix run .#import