-
Notifications
You must be signed in to change notification settings - Fork 9
/
justfile
124 lines (97 loc) · 2.67 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
set dotenv-load
lint: clippy fmt
unit: lint test test-all test-single-tenant lint-tf
devloop: unit fmt-imports
test := ""
test:
RUST_BACKTRACE=1 cargo test --all-targets -- {{test}}
test-all:
RUST_BACKTRACE=1 cargo test --all-targets --features=multitenant,analytics,geoblock,functional_tests -- {{test}}
test-all-providers:
RUST_BACKTRACE=1 cargo test --all-targets --features=multitenant,analytics,geoblock,functional_tests,apns_tests,fcm_tests,fcmv1_tests -- {{test}}
test-single-tenant:
RUST_BACKTRACE=1 cargo test --features=functional_tests -- {{test}}
clippy:
#!/bin/bash
set -euo pipefail
if command -v cargo-clippy >/dev/null; then
echo '==> Running clippy'
cargo clippy --all-features --tests -- -D warnings
else
echo '==> clippy not found in PATH, skipping'
fi
fmt:
#!/bin/bash
set -euo pipefail
if command -v cargo-fmt >/dev/null; then
echo '==> Running rustfmt'
cargo fmt
else
echo '==> rustfmt not found in PATH, skipping'
fi
if command -v terraform -version >/dev/null; then
echo '==> Running terraform fmt'
terraform -chdir=terraform fmt -recursive
else
echo '==> terraform not found in PATH, skipping'
fi
fmt-imports:
#!/bin/bash
set -euo pipefail
if command -v cargo-fmt >/dev/null; then
echo '==> Running rustfmt'
cargo +nightly fmt -- --config group_imports=StdExternalCrate,imports_granularity=One
else
echo '==> rustfmt not found in PATH, skipping'
fi
lint-tf: tf-validate tf-fmt tfsec tflint tfdocs
tf-fmt:
#!/bin/bash
set -euo pipefail
if command -v terraform >/dev/null; then
echo '==> Running terraform fmt'
terraform -chdir=terraform fmt -recursive
else
echo '==> Terraform not found in PATH, skipping'
fi
tf-validate:
#!/bin/bash
set -euo pipefail
if command -v terraform >/dev/null; then
echo '==> Running terraform fmt'
terraform -chdir=terraform validate
else
echo '==> Terraform not found in PATH, skipping'
fi
tfsec:
#!/bin/bash
set -euo pipefail
if command -v tfsec >/dev/null; then
echo '==> Running tfsec'
cd terraform
tfsec
else
echo '==> tfsec not found in PATH, skipping'
fi
tflint:
#!/bin/bash
set -euo pipefail
if command -v tflint >/dev/null; then
echo '==> Running tflint'
cd terraform; tflint
cd ecs; tflint
cd ../monitoring; tflint
cd ../private_zone; tflint
cd ../redis; tflint
else
echo '==> tflint not found in PATH, skipping'
fi
tfdocs:
#!/bin/bash
set -euo pipefail
if command -v terraform-docs >/dev/null; then
echo '==> Running terraform-docs'
terraform-docs terraform
else
echo '==> terraform-docs not found in PATH, skipping'
fi