-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
98 lines (63 loc) · 2.36 KB
/
makefile
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
INSPECTOR = npx graphql-inspector introspect
LINTER = npx graphql-schema-linter
TESTS = npx jest tests/*.test.ts tests/**/*.test.ts --coverage
AWS_FILE = "[default]\naws_access_key_id=$AWS_ACCESS_KEY_ID\naws_secret_access_key=$AWS_SECRET_ACCESS_KEY
tests: test
test: rm-build
npx jest tests/ --coverage
line-count:
npx ts-node -P ./node.tsconfig.json tools/linecount.ts -- server/**/*.ts
rm-build:
rm -rf build/
build-code:
pwd; npx tsc
build-cloud:
cd cloud; pwd; npm ci; npm run build; npx cdk synth;
build: build-code build-cloud
@echo Built Application Code And Cloud Comps
viewEnv:
@echo printenv
cloud-install:
cd cloud; npm i
deploy: preflight build test rm-build postflight
cd cloud; pwd; npm run cdk deploy
plopCreds:
@echo "Only for CI envs"
@echo "[default]\naws_access_key_id=$(AWS_ACCESS_KEY_ID)\naws_secret_access_key=$(AWS_SECRET_ACCESS_KEY)" > ~/.aws/credentials
@echo "[default]\naws_access_key_id=$(AWS_ACCESS_KEY_ID)\naws_secret_access_key=$(AWS_SECRET_ACCESS_KEY)" > /home/runner/.aws/credentials
@echo "Wrote credential files"
preflight: build show-extras rm-build test line-count
postflight: post-deploy-tests
@echo "Post Deployment Tests Concluded"
schema-gen:
npx ts-node server/models/mergeSchemas.ts
schema-lint: schema-gen
${LINTER} server/models/merged.gen.graphql
schema-inspect: schema-gen
${INSPECTOR} server/models/merged.gen.graphql --comments true
schema-check: schema-lint schema-inspect
@echo Schema Linted and Introspected
show-extras: code-show-todos tests-show-todo tests-show-skip
code-show-todos:
find ./server -name "*.ts" -exec grep -Hin "@todo" {} \;
find ./server -name "*.ts" -exec grep -Hin "@todo" {} \; | wc -l
tests-show-todo:
@echo "##TODOs"
find ./tests -name "*.test.ts" -exec grep -Hin "test.todo" {} \;
find ./tests -name "*.test.ts" -exec grep -Hin "test.todo" {} \; | wc -l;
tests-show-skip:
@echo "##Skipped"
find ./tests -name "*.test.ts" -exec grep -Hin "test.skip" {} \;
find ./tests -name "*.test.ts" -exec grep -Hin "test.skip" {} \; | wc -l;
tests-show-more: tests-show-todo tests-show-skip
@echo ""
@echo "> #Showing All Unfinished Tests"
post-deploy-tests:
npx esbuild client/post-deploy-test.ts --platform=node --target=node14 --bundle | node
list:
@echo
@echo Available sub-commands...
@echo
@cat makefile | grep ":" | tail -r | awk 'NR>1{ print }' | tail -r
@echo
@echo