2023-10-20 00:56:57 +02:00
|
|
|
runtime := "podman"
|
|
|
|
|
2023-10-18 20:52:51 +02:00
|
|
|
# Builds a debug container and runs it
|
2023-10-19 02:31:54 +02:00
|
|
|
dev: start-debug
|
|
|
|
@echo "Cd into client and run 'npm run dev' to start the client in dev mode."
|
2023-10-17 19:43:26 +02:00
|
|
|
|
2023-10-21 05:11:42 +02:00
|
|
|
[private]
|
2023-10-20 00:56:57 +02:00
|
|
|
npm-install directory:
|
|
|
|
cd {{directory}} && npm install
|
2023-10-18 20:52:51 +02:00
|
|
|
|
|
|
|
# Builds the client with npm (result in client/dist)
|
2023-10-20 00:56:57 +02:00
|
|
|
[private]
|
2023-10-21 05:11:42 +02:00
|
|
|
npm-build directory: (npm-install directory)
|
|
|
|
cd {{directory}} && npm run build
|
|
|
|
@echo "Built client at {{directory}}/dist"
|
2023-10-17 19:43:26 +02:00
|
|
|
|
2023-10-18 20:52:51 +02:00
|
|
|
# Builds a debug container
|
2023-10-20 00:56:57 +02:00
|
|
|
[private]
|
2023-10-18 20:52:51 +02:00
|
|
|
build-container-server-debug:
|
2023-10-20 03:28:22 +02:00
|
|
|
{{runtime}} build -t fb-server-debug -f container/ContainerfileDebug .
|
2023-10-18 20:52:51 +02:00
|
|
|
|
|
|
|
# Builds a debug container and runs it
|
2023-10-20 00:56:57 +02:00
|
|
|
[private]
|
|
|
|
start-debug: build-container-server-debug remove-podman-containers
|
2023-11-06 00:23:44 +01:00
|
|
|
{{runtime}} run -d -e DATABASE_URL=sqlite:debug.db -p 8080:8080 --name frostbyte-debug fb-server-debug
|
2023-10-19 02:31:54 +02:00
|
|
|
@echo "Debug server started."
|
2023-10-18 20:52:51 +02:00
|
|
|
|
|
|
|
# Builds a release container
|
2023-10-20 00:56:57 +02:00
|
|
|
[private]
|
2023-10-18 20:52:51 +02:00
|
|
|
build-container-release:
|
2023-10-20 03:28:22 +02:00
|
|
|
{{runtime}} build -t fb-server -f container/Containerfile .
|
2023-10-17 19:43:26 +02:00
|
|
|
|
2023-10-18 20:52:51 +02:00
|
|
|
# Builds a release container and runs it
|
2023-10-20 00:56:57 +02:00
|
|
|
start-release: build-container-release remove-podman-containers
|
2023-11-06 00:23:44 +01:00
|
|
|
{{runtime}} network create fb_network --ignore
|
2023-11-05 20:13:52 +01:00
|
|
|
{{runtime}} run -d --network fb_network -e DATABASE_URL=sqlite:release.db -p 8080:8080 --name frostbyte fb-server
|
2023-10-20 00:56:57 +02:00
|
|
|
|
2023-10-21 00:02:58 +02:00
|
|
|
init-sqlx:
|
|
|
|
echo "DATABASE_URL=sqlite:debug.db" > server/.env
|
|
|
|
cd server && sqlx database create
|
|
|
|
cd server && sqlx migrate run
|
|
|
|
cd server && cargo sqlx prepare
|
|
|
|
|
2023-10-20 00:56:57 +02:00
|
|
|
# Removes and stops any containers related to the project
|
|
|
|
[private]
|
|
|
|
remove-podman-containers:
|
2023-11-06 00:23:44 +01:00
|
|
|
{{runtime}} network rm -f fb_network
|
2023-10-20 00:56:57 +02:00
|
|
|
{{runtime}} container rm -f frostbyte
|
|
|
|
{{runtime}} container rm -f frostbyte-debug
|
2023-10-17 19:43:26 +02:00
|
|
|
|
2023-10-18 20:52:51 +02:00
|
|
|
# Deletes everything podman related (even unrelated to the project)
|
2023-10-20 00:56:57 +02:00
|
|
|
[private]
|
2023-10-18 20:52:51 +02:00
|
|
|
prune-podman:
|
2023-10-20 00:56:57 +02:00
|
|
|
{{runtime}} stop -a
|
|
|
|
{{runtime}} rm -af
|
|
|
|
{{runtime}} image rm -af
|
|
|
|
{{runtime}} system prune -af
|
|
|
|
{{runtime}} system reset --force
|
2023-10-18 20:52:51 +02:00
|
|
|
|
|
|
|
# Cleans up everything related to the project
|
2023-10-17 19:43:26 +02:00
|
|
|
clean:
|
2023-10-20 00:56:57 +02:00
|
|
|
{{runtime}} container rm -f frostbyte
|
|
|
|
{{runtime}} container rm -f frostbyte-debug
|
|
|
|
{{runtime}} image rm -f fb-server
|
|
|
|
{{runtime}} image rm -f fb-server-debug
|
2023-10-17 19:43:26 +02:00
|
|
|
rm -rf client/dist
|
|
|
|
rm -rf client/node_modules
|
2023-11-01 15:47:51 +01:00
|
|
|
rm -rf client-solid/dist
|
|
|
|
rm -rf client-solid/node_modules
|
2023-10-17 19:43:26 +02:00
|
|
|
rm -rf server/public
|
2023-10-18 20:52:51 +02:00
|
|
|
rm -rf server/target
|
2023-10-20 00:56:57 +02:00
|
|
|
@echo "Cleaned up! Make sure to run 'just nuke' to nuke everything podman related."
|
2023-10-18 20:52:51 +02:00
|
|
|
|
|
|
|
# Nukes everything. No mercy. Leave no trace.
|
|
|
|
nuke: clean prune-podman
|
|
|
|
@echo "Nuked everything! You're starting from scratch now."
|