forked from Blogger-Soarpenguin/open-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (48 loc) · 1.3 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
STAGING = s3://open-staging.mesosphere.com/
PROD = s3://open.mesosphere.com/
PUBLIC_DIR= _build/
DOCKER_IMAGE=thomasr/build-jekyll
DOCKER_TAG=0.5
docker: docker.build docker.push
docker.build:
docker build -t $(DOCKER_IMAGE):$(DOCKER_TAG) .
docker.push:
docker push $(DOCKER_IMAGE):$(DOCKER_TAG)
site.build:
docker run --rm=true -e "BRANCH=$(BRANCH)" -v $(CHECKOUT):/website \
$(DOCKER_IMAGE):$(DOCKER_TAG) build
deploy_bucket=$(STAGING)
ifeq ($(BRANCH),prod)
deploy_bucket=$(PROD)
endif
publish.assets:
aws s3 sync \
--region us-east-1 \
--acl public-read \
--cache-control "public,max-age=600" \
--content-type "text/html; charset=utf-8" \
--exclude "*" \
--include "*.html" \
$(PUBLIC_DIR) $(deploy_bucket)
aws s3 sync \
--region us-east-1 \
--acl public-read \
--cache-control "public,max-age=600" \
--exclude "*" \
--include "*.xml" \
$(PUBLIC_DIR) $(deploy_bucket)
aws s3 sync \
--region us-east-1 \
--acl public-read \
--cache-control "public,max-age=31536000" \
--exclude "*.html" \
--exclude "*.xml" \
$(PUBLIC_DIR) $(deploy_bucket)
build_config=-c _config.yml
ifeq ($(BRANCH),prod)
else
build_config := $(build_config),_config.staging.yml
endif
build:
bundle install
LANG="en_US.UTF-8" LC_ALL="en_US.UTF-8" bundle exec jekyll build -d _build $(build_config)