TTime/Justfile
2024-02-12 19:09:21 +01:00

31 lines
No EOL
1 KiB
Makefile

# Builds a release container
[private]
build-container-release:
podman build -t ttime-server -f container/Containerfile .
# Builds a release container and runs it
start-release: build-container-release remove-podman-containers
podman run -d -e DATABASE_URL=sqlite:release.db -p 8080:8080 --name ttime ttime-server
@echo "Started production ttime-server on http://localhost:8080"
# Removes and stops any containers related to the project
[private]
remove-podman-containers:
podman container rm -f ttime
# Saves the release container to a tarball, pigz is just gzip but multithreaded
save-release: build-container-release
podman save --format=oci-archive ttime-server | pigz -9 > ttime-server.tar.gz
# Loads the release container from a tarball
load-release file:
podman load --input {{file}}
# Cleans up everything related to the project
clean: remove-podman-containers
podman image rm -f ttime-server
rm -rf frontend/dist
rm -rf frontend/node_modules
rm -f ttime-server.tar.gz
cd backend && make clean
@echo "Cleaned up!"