-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
42 lines (29 loc) · 927 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
EXECUTABLES=git node yarn docker
_=$(foreach exec,$(EXECUTABLES), \
$(if $(shell which $(exec)), ok, $(error "No $(exec) in PATH")))
DOCKER_IMAGE_TAG=ivan1993spb/snake-lightweight-client
VERSION=$(shell git describe --tags --abbrev=0)
BUILD=$(shell git rev-parse --short HEAD)
default: build
install:
@yarn install
serve:
@yarn serve
build:
@yarn build
clean:
@rm -fr dist
test:
@yarn test:unit
lint:
@yarn lint
docker/build: build
@docker build -t $(DOCKER_IMAGE_TAG):$(VERSION) .
@docker tag $(DOCKER_IMAGE_TAG):$(VERSION) $(DOCKER_IMAGE_TAG):latest
@echo "Build $(BUILD) tagged $(DOCKER_IMAGE_TAG):$(VERSION)"
@echo "Build $(BUILD) tagged $(DOCKER_IMAGE_TAG):latest"
docker/push:
@echo "Push build $(BUILD) with tag $(DOCKER_IMAGE_TAG):$(VERSION)"
@docker push $(DOCKER_IMAGE_TAG):$(VERSION)
@echo "Push build $(BUILD) with tag $(DOCKER_IMAGE_TAG):latest"
@docker push $(DOCKER_IMAGE_TAG):latest