-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathjustfile
More file actions
65 lines (55 loc) · 1.51 KB
/
justfile
File metadata and controls
65 lines (55 loc) · 1.51 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
set shell := ["bash", "-c"]
set positional-arguments
set dotenv-load
set working-directory := "enterprise"
default: all
all: instructions
prep: version start
install: deploy status test
clean-all: clean
[group('enterprise')]
@instructions:
echo ">> running $0"
echo "1. run 'just prep'"
echo "2. export the VAULT_CACERT variable"
echo "3. run 'just install'"
[group('enterprise')]
@version:
echo ">> running $0"
vault version
terraform version
docker version
[group('enterprise')]
clean: stop
echo ">> running $0"
rm -rf .terraform .terraform.lock.hcl terraform.tfstate tf.plan terraform.tfstate.backup vault.log
[group('enterprise')]
@deploy:
echo ">> running $0"
terraform apply -auto-approve
[group('enterprise')]
@status:
echo ">> running $0"
vault status
docker ps --filter "name=learn-postgres"
[group('enterprise')]
@start: clean
echo ">> running $0"
terraform init
nohup $(brew --prefix vault-enterprise)/bin/vault server -dev -dev-root-token-id root -dev-tls > vault.log 2>&1 &
echo "go into vault.log and find the value for VAULT_CACERT and export it"
sleep 5
-cat vault.log | grep VAULT_CACERT=
[group('enterprise')]
@test:
echo ">> running $0"
cat terraform.tfstate | grep data_json_wo
[group('enterprise')]
@stop:
echo ">> running $0"
-docker stop $(docker ps -f name=learn-postgres -q)
-pkill vault # ignore if vault is not running
[group('enterprise')]
@connect-postgres:
echo ">> running $0"
docker exec -it learn-postgres psql -U postgres