2016-12-22 15:09:40 +00:00
|
|
|
SUBMODULES = build_utils
|
|
|
|
SUBTARGETS = $(patsubst %,%/.git,$(SUBMODULES))
|
|
|
|
|
|
|
|
UTILS_PATH := build_utils
|
|
|
|
TEMPLATES_PATH := .
|
|
|
|
|
|
|
|
# Name of the service
|
|
|
|
SERVICE_NAME := koffing
|
|
|
|
# Service image default tag
|
|
|
|
SERVICE_IMAGE_TAG ?= $(shell git rev-parse HEAD)
|
|
|
|
# The tag for service image to be pushed with
|
|
|
|
SERVICE_IMAGE_PUSH_TAG ?= $(SERVICE_IMAGE_TAG)
|
|
|
|
|
|
|
|
# Base image for the service
|
|
|
|
BASE_IMAGE_NAME := service-fe
|
2017-11-03 12:52:42 +00:00
|
|
|
BASE_IMAGE_TAG := 768cf0f40600e290060502e047dd2e86d4fd6020
|
2016-12-22 15:09:40 +00:00
|
|
|
|
2019-03-05 15:16:28 +00:00
|
|
|
BUILD_IMAGE_TAG := 1862224e600e34a9bd04327db7b3186fa4d31ceb
|
2016-12-22 15:09:40 +00:00
|
|
|
|
|
|
|
CALL_W_CONTAINER := init build clean submodules
|
|
|
|
|
|
|
|
.PHONY: $(CALL_W_CONTAINER)
|
|
|
|
|
|
|
|
all: build
|
|
|
|
|
|
|
|
-include $(UTILS_PATH)/make_lib/utils_image.mk
|
|
|
|
-include $(UTILS_PATH)/make_lib/utils_container.mk
|
|
|
|
|
|
|
|
$(SUBTARGETS): %/.git: %
|
|
|
|
git submodule update --init $<
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
submodules: $(SUBTARGETS)
|
|
|
|
|
|
|
|
init:
|
|
|
|
npm install
|
|
|
|
|
2019-01-30 13:31:56 +00:00
|
|
|
build: check
|
2016-12-22 15:09:40 +00:00
|
|
|
npm run build
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf dist
|
2017-11-03 12:52:42 +00:00
|
|
|
|
|
|
|
.state: build_image
|
|
|
|
echo $(SERVICE_IMAGE_TAG) > $@
|
|
|
|
|
|
|
|
test: .state
|
|
|
|
docker run --rm $(SERVICE_IMAGE_NAME):$(shell cat .state) nginx -T -c /etc/nginx/nginx.conf
|
2019-01-30 13:31:56 +00:00
|
|
|
|
|
|
|
check:
|
2019-03-05 15:16:28 +00:00
|
|
|
npm run check
|