-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
41 lines (31 loc) · 827 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
IMAGE := mongrelion/blog
TAG := $$(git log -1 --pretty=%H)
NAME := $(IMAGE):$(TAG)
LATEST := $(IMAGE):latest
dev:
@hugo server
site:
./scripts/build.sh
image: site
@echo "-> building container image $(NAME)"
@docker build \
-t $(NAME) \
.
dist: image latest push push-latest
@./scripts/deploy.sh
push:
@echo "-> pusing container image $(NAME) to dockerhub"
@docker push $(NAME)
latest:
@echo "-> aliasing container image $(NAME) to $(LATEST)"
@docker tag $(NAME) $(LATEST)
push-latest:
@echo "-> pusing container image $(LATEST) to dockerhub"
@docker push $(LATEST)
login:
@echo "-> logging into DockerHUB"
@docker login -u=$(DOCKER_USER) -p=$(DOCKER_PASS)
test:
@docker run --rm -it -p 1313:1313 -v ${PWD}:/usr/share/hugo mongrelion/hugo:0.20.1 server --bind 0.0.0.0
clean:
@rm -rf public/