2021-09-18 17:56:00 +05:30
|
|
|
.PHONY: assets sync go_binary build docker
|
2021-04-06 02:35:15 +03:00
|
|
|
|
2021-09-18 17:56:00 +05:30
|
|
|
NODE_PATH ?= $(PWD)/ui/node_modules
|
2021-04-06 02:35:15 +03:00
|
|
|
|
2021-01-05 15:24:11 -08:00
|
|
|
assets:
|
2021-09-18 17:56:00 +05:30
|
|
|
@if [ ! -d "$(NODE_PATH)" ]; then cd ./ui && yarn install --modules-folder $(NODE_PATH); fi
|
|
|
|
cd ./ui && yarn build --modules-folder $(NODE_PATH)
|
|
|
|
|
|
|
|
sync:
|
|
|
|
rsync -avu --delete "./ui/build/" "./cmd/asynqmon/ui-assets"
|
2021-01-05 15:24:11 -08:00
|
|
|
|
2021-04-06 02:35:15 +03:00
|
|
|
# Build go binary.
|
2021-09-18 17:56:00 +05:30
|
|
|
go_binary: assets sync
|
2021-09-18 17:55:59 +05:30
|
|
|
go build -o asynqmon ./cmd/asynqmon
|
2021-01-05 15:24:11 -08:00
|
|
|
|
|
|
|
# Target to build a release binary.
|
2021-04-06 02:35:15 +03:00
|
|
|
build: go_binary
|
2021-01-05 15:24:11 -08:00
|
|
|
|
2021-04-06 02:35:15 +03:00
|
|
|
# Build image and run Asynqmon server (with default settings).
|
|
|
|
docker:
|
|
|
|
docker build -t asynqmon .
|
|
|
|
docker run --rm \
|
|
|
|
--name asynqmon \
|
|
|
|
-p 8080:8080 \
|
2021-06-07 19:09:14 +08:00
|
|
|
asynqmon --redis-addr=host.docker.internal:6379
|