2024-08-28 08:05:11 +00:00
|
|
|
FRONT_END_BINARY=frontApp
|
|
|
|
BROKER_BINARY=brokerApp
|
2024-08-28 12:24:16 +00:00
|
|
|
AUTH_BINARY=authApp
|
2024-08-29 11:57:16 +00:00
|
|
|
LOGGER_BINARY=loggerApp
|
2024-09-02 18:48:30 +00:00
|
|
|
MAIL_BINARY=mailApp
|
2024-09-06 16:54:35 +00:00
|
|
|
LISTENER_BINARY=listenerApp
|
2024-08-28 08:05:11 +00:00
|
|
|
|
|
|
|
## up: starts all containers in the background without forcing build
|
|
|
|
up:
|
|
|
|
@echo "Starting Docker images..."
|
2024-08-28 12:24:16 +00:00
|
|
|
docker compose up -d
|
2024-08-28 08:05:11 +00:00
|
|
|
@echo "Docker images started!"
|
|
|
|
|
|
|
|
## up_build: stops docker-compose (if running), builds all projects and starts docker compose
|
2024-09-06 16:54:35 +00:00
|
|
|
up_build: build_broker build_auth build_logger build_mail build_listener
|
2024-08-28 08:05:11 +00:00
|
|
|
@echo "Stopping docker images (if running...)"
|
2024-08-28 12:24:16 +00:00
|
|
|
docker compose down
|
2024-08-28 08:05:11 +00:00
|
|
|
@echo "Building (when required) and starting docker images..."
|
2024-08-28 12:24:16 +00:00
|
|
|
docker compose up --build -d
|
2024-08-28 08:05:11 +00:00
|
|
|
@echo "Docker images built and started!"
|
|
|
|
|
|
|
|
## down: stop docker compose
|
|
|
|
down:
|
|
|
|
@echo "Stopping docker compose..."
|
2024-08-28 12:24:16 +00:00
|
|
|
docker compose down
|
2024-08-28 08:05:11 +00:00
|
|
|
@echo "Done!"
|
|
|
|
|
|
|
|
## build_broker: builds the broker binary as a linux executable
|
|
|
|
build_broker:
|
|
|
|
@echo "Building broker binary..."
|
|
|
|
cd ../broker-service && env GOOS=linux CGO_ENABLED=0 go build -o ${BROKER_BINARY} ./cmd/api
|
|
|
|
@echo "Done!"
|
|
|
|
|
2024-08-28 12:24:16 +00:00
|
|
|
## build_auth: builds the auth binary as a linux executable
|
|
|
|
build_auth:
|
|
|
|
@echo "Building auth binary..."
|
|
|
|
cd ../authentication-service && env GOOS=linux CGO_ENABLED=0 go build -o ${AUTH_BINARY} ./cmd/api
|
|
|
|
@echo "Done!"
|
|
|
|
|
2024-08-29 11:57:16 +00:00
|
|
|
## build_logger: builds the logger binary as a linux executable
|
|
|
|
build_logger:
|
|
|
|
@echo "Building logger binary..."
|
|
|
|
cd ../logger-service && env GOOS=linux CGO_ENABLED=0 go build -o ${LOGGER_BINARY} ./cmd/api
|
|
|
|
@echo "Done!"
|
|
|
|
|
2024-09-02 18:48:30 +00:00
|
|
|
## build_mail: builds the mail binary as a linux executable
|
|
|
|
build_mail:
|
|
|
|
@echo "Building mail binary..."
|
|
|
|
cd ../mail-service && env GOOS=linux CGO_ENABLED=0 go build -o ${MAIL_BINARY} ./cmd/api
|
|
|
|
@echo "Done!"
|
|
|
|
|
2024-09-06 16:54:35 +00:00
|
|
|
## build_listener: builds the listener binary as a linux executable
|
|
|
|
build_listener:
|
|
|
|
@echo "Building listener binary..."
|
|
|
|
cd ../listener-service && env GOOS=linux CGO_ENABLED=0 go build -o ${LISTENER_BINARY} .
|
|
|
|
@echo "Done!"
|
|
|
|
|
2024-08-28 08:05:11 +00:00
|
|
|
## build_front: builds the frone end binary
|
|
|
|
build_front:
|
|
|
|
@echo "Building front end binary..."
|
|
|
|
cd ../front-end && env CGO_ENABLED=0 go build -o ${FRONT_END_BINARY} ./cmd/web
|
|
|
|
@echo "Done!"
|
|
|
|
|
|
|
|
## start: starts the front end
|
|
|
|
start: build_front
|
|
|
|
@echo "Starting front end"
|
|
|
|
cd ../front-end && ./${FRONT_END_BINARY} &
|
|
|
|
|
|
|
|
## stop: stop the front end
|
|
|
|
stop:
|
|
|
|
@echo "Stopping front end..."
|
|
|
|
@-pkill -SIGTERM -f "./${FRONT_END_BINARY}"
|
|
|
|
@echo "Stopped front end!"
|