-
Notifications
You must be signed in to change notification settings - Fork 315
/
Copy pathMakefile
52 lines (44 loc) · 1.17 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
build: clean
bundle install
bundle exec middleman build --no-parallel
.PHONY: build
clean:
rm -rf build
run: build
bundle exec middleman serve
sync: build check-env
bundle exec middleman s3_sync
.PHONY: sync
purge_cache: check-env
curl -H "Fastly-Key: ${FASTLY_API_KEY}" -X POST "https://api.fastly.com/service/${FASTLY_SERVICE_KEY}/purge_all"
prep:
sed -i '/^Disallow:/ s/$$/ \//' build/robots.txt
zip -r website.zip build
deploy: build sync purge_cache
acceptance: build prep
curl -H "Content-Type: application/zip" \
-H "Authorization: Bearer $(NETLIFYKEY)" \
--data-binary "@website.zip" \
--url "https://api.netlify.com/api/v1/sites/habitat-acceptance.netlify.com/deploys"
check-env:
ifndef AWS_ACCESS_KEY_ID
$(error AWS_ACCESS_KEY_ID is undefined)
endif
ifndef AWS_BUCKET
$(error AWS_BUCKET is undefined)
endif
ifndef AWS_DEFAULT_REGION
$(error AWS_DEFAULT_REGION is undefined)
endif
ifndef AWS_SECRET_ACCESS_KEY
$(error AWS_SECRET_ACCESS_KEY is undefined)
endif
ifndef FASTLY_API_KEY
$(error FASTLY_API_KEY is undefined)
endif
ifndef FASTLY_SERVICE_KEY
$(error FASTLY_SERVICE_KEY is undefined)
endif
ifndef NETLIFYKEY
$(error NETLIFYKEY is undefined)
endif