akkoma-fe/Makefile
2023-09-16 07:15:14 +09:00

30 lines
602 B
Makefile

RUNTIME ?= docker
BUILD_DIR ?= ./dist/
OUTFILE_ZIP ?= ./akkoma-fe.zip
NODE_ENV ?= production
.PHONY: all
all: build-docker build-fe package
.PHONY: build-docker
build-docker:
$(RUNTIME) build -t akkoma-fe-builder .
.PHONY: build-fe
build-fe:
ifeq ("$(wildcard $(BUILD_DIR))","")
mkdir $(BUILD_DIR)
else
rm -rf $(BUILD_DIR)
mkdir $(BUILD_DIR)
endif
$(RUNTIME) run -e NODE_ENV=$(NODE_ENV) -v ${PWD}/dist/:/app/dist/:Z akkoma-fe-builder build
.PHONY: package
package:
ifneq ("$(wildcard $(OUTFILE_ZIP))","")
rm $(OUTFILE_ZIP)
endif
zip -r -9 $(OUTFILE_ZIP) $(BUILD_DIR)
# vim:set noexpandtab: