2021-04-06 07:35:15 +08:00
|
|
|
.PHONY: assets go_binary build docker
|
|
|
|
|
|
|
|
NODE_MODULES_PATH = $(PWD)/ui/node_modules
|
|
|
|
|
|
|
|
# Checking for a node_modules folder before building.
|
2021-01-06 07:24:11 +08:00
|
|
|
assets:
|
2021-04-06 07:35:15 +08:00
|
|
|
@if [ -d "$(NODE_MODULES_PATH)" ]; then cd ./ui && yarn install; fi
|
2021-01-06 07:24:11 +08:00
|
|
|
cd ./ui && yarn build
|
|
|
|
|
2021-04-06 07:35:15 +08:00
|
|
|
# Build go binary.
|
|
|
|
go_binary: assets
|
|
|
|
go build -o asynqmon .
|
2021-01-06 07:24:11 +08:00
|
|
|
|
|
|
|
# Target to build a release binary.
|
2021-04-06 07:35:15 +08:00
|
|
|
build: go_binary
|
2021-01-06 07:24:11 +08:00
|
|
|
|
2021-04-06 07:35:15 +08:00
|
|
|
# Build image and run Asynqmon server (with default settings).
|
|
|
|
docker:
|
|
|
|
docker build -t asynqmon .
|
|
|
|
docker run --rm \
|
|
|
|
--name asynqmon \
|
|
|
|
-p 8080:8080 \
|
2021-04-06 12:42:15 +08:00
|
|
|
asynqmon --redis_addr=host.docker.internal:6379
|
2021-01-06 07:24:11 +08:00
|
|
|
|