-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
48 lines (34 loc) · 1.25 KB
/
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
43
44
45
46
47
48
.DEFAULT_GOAL := dev
HUGO=.bin/hugo
HUGO_VERSION=0.140.0
FUNCTIONS := functions/_deploy/hello
functions/_deploy/hello : functions/src/hello functions/src/hello/**
cd functions/ && \
go build -o $@ github.com/eternal-flame-ad/yumechi.jp/$(firstword $^)
functions: $(FUNCTIONS)
.bin/gimme:
wget -O.bin/gimme https://raw.githubusercontent.com/travis-ci/gimme/master/gimme
chmod +x .bin/gimme
download-static: .bin/gimme
download-sub:
git submodule update --init
.bin/hugo:
($(value HUGO) version | grep v$(value HUGO_VERSION)) || \
(wget -O- https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz \
| tar xzf - hugo && mv hugo .bin/)
download: download-static download-sub .bin/hugo
dev: download
$(value HUGO) server -DF
build-dev: download
$(value HUGO) -DF
build: download functions
rm -rf public/** || true
if [ "${URL}" != "" ]; then \
sed -i 's/yumechi.jp/$(URL:https://%=%)/g' config/_default/config.toml ; \
fi
$(value HUGO) --minify
clean:
rm -rf functions/_deploy/** || true
rm -rf resources/_gen/** || true
rm -rf public/** || true
.PHONY: dev build-dev build download-sub download-static download .bin/hugo clean functions