forked from sabre-io/sabre.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
70 lines (51 loc) · 1.84 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# sabre.io
#
# vim: set fileencoding=utf-8:
DOMAIN = sabre.io
URL = http://${DOMAIN}
# SOURCE_MD_FILES = $(shell find source/ -type f -name "*.md")
SOURCE_MD_FILES = $(shell find source/ -type f -name "*.md" -or -name "*.html")
.PHONY: all, generate, do-deploy, server, output_dev, output_prod
all: do-deploy
generate: composer.lock output_prod
do-deploy: generate
cd deploy && \
echo "Fetching latest changes" && \
git checkout master && \
git pull && \
echo "Copying over the latest website version" && \
rm -r * && \
cp -r ../output_prod/* . && \
touch .nojekkyl && \
echo $(DOMAIN) > CNAME && \
git add -A && \
git commit -m "Automatic deployment `date -u`" && \
echo "Pushing changes" && \
git push origin master && \
echo "Deploy complete"
server:
vendor/bin/sculpin generate --watch --server
composer.lock: composer.json
composer install
vendor/autoload.php:
composer install
output_dev: output_dev/atom.xml
output_prod: output_prod/atom.xml
output_dev/atom.xml: source/css/sabre.css $(SOURCE_MD_FILES)
# atom.xml always changes to the latest date and time, so we can use this
# as the main target to figure out if the source changed at all.
vendor/bin/sculpin generate --env=dev --url=$(URL)
output_prod/atom.xml: source/css/sabre.css $(SOURCE_MD_FILES)
# atom.xml always changes to the latest date and time, so we can use this
# as the main target to figure out if the source changed at all.
vendor/bin/sculpin generate --env=prod --url=$(URL)
YUI = $(shell which yuicompressor || which yui-compressor)
LESSC = $(shell which lessc)
source/css/sabre.css: source/less/*.less vendor/autoload.php
@which $(YUI) > /dev/null
@which $(LESSC) > /dev/null
$(LESSC) --ru source/less/sabre.less | $(YUI) --type css > source/css/sabre.css
foo:
echo $(SOURCE_MD_FILES)
clean:
rm -Rvf output_dev/ source/components/* vendor/ source/*.css