-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJustfile
More file actions
100 lines (79 loc) · 3.62 KB
/
Copy pathJustfile
File metadata and controls
100 lines (79 loc) · 3.62 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
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
set shell := ["bash", "-uc"]
# Migrate to local DB
migrate *args:
dotenvx run -- ./mvnw flyway:migrate -Dflyway.locations=filesystem:./db {{args}}
# Drop local DB
drop *args:
dotenvx run -- ./mvnw flyway:clean -Dflyway.locations=filesystem:./db -Dflyway.cleanDisabled=false {{args}}
# Run the backend Spring server
backend-dev *args:
dotenvx run -f .env -- ./mvnw -Dspring-boot.run.profiles=dev spring-boot:run {{args}}
# Run the backend Spring server with an exposed debugger at :5005
backend-dev-debug *args:
dotenvx run -- ./mvnw \
-Dspring-boot.run.profiles=dev \
-Dspring-boot.run.jvmArguments="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005" \
spring-boot:run {{args}}
# Builds and installs Spring backend
backend-install *args:
./mvnw install -DskipTests=true {{args}}
# Run backend formatter (check only)
backend-spotless *args:
./mvnw spotless:check
# Run backend formatter (check & write)
backend-spotless-fix *args:
./mvnw spotless:apply
# Run backend linter, formatter, & tests
backend-test *args:
just backend-spotless && dotenvx run -f .env -- ./mvnw checkstyle:check verify -Dspring.profiles.active=ci {{args}}
# Run backend tests with a debugger
backend-testd *args:
just backend-spotless && dotenvx run -f .env -- ./mvnw checkstyle:check verify -Dspring.profiles.active=ci -Dmaven.surefire.debug {{args}}
# Run the frontend
frontend-dev *args:
cd js && pnpm i && pnpm run dev {{args}}
# Builds and installs frontend packages
frontend-install *args:
cd js && pnpm i
# Frontend tests
frontend-test *args:
cd js && pnpm run test
## Generate types through OpenAPI
#type-gen *args:
# cd js && pnpm run generate {{args}}
#
## Run the react-email development server
#email-dev *args:
# cd email && pnpm i && pnpm email dev --dir emails {{args}}
#
## Generate HTML output of react-email and copy to backend static folder
#email-gen *args:
# cd email && bash email.sh {{args}}
# Run the dev servers (backend & frontend)
dev *args:
just install-pre-scripts
npx concurrently "just backend-dev" "just frontend-dev" {{args}}
# Run the dev servers (backend & frontend) but the backend will launch a debugger server.
devd *args:
npx concurrently "just backend-dev-debug" "just frontend-dev" {{args}}
### Secret management
# sops is a library that handles the encryption and decryption of files (primarily used for secrets).
# Our secrets are encrypted & stored inside of secrets.yaml.
# The reason why our secrets are checked into version control is so we can
# programmatically change them, track & diff them (similar to what we do with regular source code).
# Use if you created a new secret file and need to encrypt it with SOPS
# If you are editing a file that has already been encrypted, see `just edit`
encrypt file *args:
just install-pre-scripts && sops --encrypt --in-place {{ file }} {{ args }}
# Securely edit any secret file that is encrypted with SOPS
# You can change the editor it will call on by changing the $EDITOR environment variable
#
# you can choose to set it one time for the scope of the command: `EDITOR="nvim" just edit secrets.yaml`
# or you can put `export EDITOR=nvim` inside of your `~/.zshrc`, then restart your terminal & run: `just edit secrets.yaml`
#
# if you would like to use VSCode, `EDITOR="code --wait"` (You may have to follow this first: https://code.visualstudio.com/docs/setup/mac#_launch-vs-code-from-the-command-line)
edit file *args:
just install-pre-scripts && sops edit {{ file }} {{ args }}
# Configure Git to use the .githooks directory (idempotent)
install-pre-scripts:
[ "$(git config core.hooksPath)" = ".githooks" ] || git config core.hooksPath .githooks