Cleaned up justfile a bit

This commit is contained in:
Imbus 2023-10-20 00:56:57 +02:00
parent fd068ebcbc
commit 3a3003be7e

View file

@ -1,54 +1,64 @@
runtime := "podman"
# Builds a debug container and runs it # Builds a debug container and runs it
# Starts the client in dev mode
dev: start-debug dev: start-debug
@echo "Cd into client and run 'npm run dev' to start the client in dev mode." @echo "Cd into client and run 'npm run dev' to start the client in dev mode."
# Builds the client with npm (result in client/distt # Builds the client with npm (result in client/dist
npm-install: npm-install directory:
cd client && npm install cd {{directory}} && npm install
# Builds the client with npm (result in client/dist) # Builds the client with npm (result in client/dist)
npm-build: npm-install [private]
npm-build: (npm-install "client-solid")
cd client && npm run build cd client && npm run build
# Builds a debug container # Builds a debug container
[private]
build-container-server-debug: build-container-server-debug:
podman build -t fb-server-debug -f ContainerfileDebug . {{runtime}} build -t fb-server-debug -f ContainerfileDebug .
# Builds a debug container and runs it # Builds a debug container and runs it
start-debug: build-container-server-debug [private]
podman container rm -f frostbyte-debug start-debug: build-container-server-debug remove-podman-containers
podman run -d -p 8080:8080 --name frostbyte-debug fb-server-debug {{runtime}} run -d -p 8080:8080 --name frostbyte-debug fb-server-debug
@echo "Debug server started." @echo "Debug server started."
# Builds a release container # Builds a release container
[private]
build-container-release: build-container-release:
podman build -t fb-server . {{runtime}} build -t fb-server .
# Builds a release container and runs it # Builds a release container and runs it
start-release: build-container-release start-release: build-container-release remove-podman-containers
podman container rm -f frostbyte {{runtime}} run -d -p 8080:8080 --name frostbyte fb-server
podman run -d -p 8080:8080 --name frostbyte fb-server
# Removes and stops any containers related to the project
[private]
remove-podman-containers:
{{runtime}} container rm -f frostbyte
{{runtime}} container rm -f frostbyte-debug
# Deletes everything podman related (even unrelated to the project) # Deletes everything podman related (even unrelated to the project)
[private]
prune-podman: prune-podman:
podman stop -a {{runtime}} stop -a
podman rm -af {{runtime}} rm -af
podman system prune -af {{runtime}} image rm -af
podman image rm -af {{runtime}} system prune -af
podman system reset --force {{runtime}} system reset --force
# Cleans up everything related to the project # Cleans up everything related to the project
clean: clean:
podman container rm -f frostbyte {{runtime}} container rm -f frostbyte
podman container rm -f frostbyte-debug {{runtime}} container rm -f frostbyte-debug
podman image rm -f fb-server {{runtime}} image rm -f fb-server
podman image rm -f fb-server-debug {{runtime}} image rm -f fb-server-debug
rm -rf client/dist rm -rf client/dist
rm -rf client/node_modules rm -rf client/node_modules
rm -rf server/public rm -rf server/public
rm -rf server/target rm -rf server/target
@echo "Cleaned up! Make sure to run 'just prune-podman' to nuke everything podman related." @echo "Cleaned up! Make sure to run 'just nuke' to nuke everything podman related."
# Nukes everything. No mercy. Leave no trace. # Nukes everything. No mercy. Leave no trace.
nuke: clean prune-podman nuke: clean prune-podman