This repository has been archived by the owner on Aug 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathMakefile
56 lines (44 loc) · 1.82 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
#
# Make -- the OG build tool.
# Add any build tasks here and abstract complex build scripts into `lib` that can
# be run in a Makefile task like `coffee lib/build_script`.
#
# Remember to set your text editor to use 4 size non-soft tabs.
#
BIN = node_modules/.bin
# CloudFront distributions for flare-production and flare-staging buckets
CDN_DOMAIN_production = d2j4e4qugepns1
CDN_DOMAIN_staging = d346buv1lzfvg9
# Start the server
s:
$(BIN)/coffee index.coffee
# Run all of the tests
test: assets
$(BIN)/mocha $(shell find test -name '*.coffee' -not -path 'test/helpers/*')
$(BIN)/mocha $(shell find apps/*/test -name '*.coffee' -not -path 'test/helpers/*')
public/assets:
mkdir -p $@
# Quickly compile assets to public/assets for development
assets: public/assets
$(BIN)/stylus assets/all.styl -o public/assets
$(BIN)/browserify assets/all.coffee -t caching-coffeeify -t jadeify > public/assets/all.js
# Compiles assets for production (minifying, embeddeding, gzipping)
assets-production: assets
$(BIN)/sqwish public/assets/all.css -o public/assets/all.min.css
$(BIN)/coffee lib/assets/embed_datauri.coffee public/assets/all.min.css
$(BIN)/uglifyjs public/assets/all.js > public/assets/all.min.js
gzip -f public/assets/all.min.js public/assets/all.min.css
rm public/assets/*.js public/assets/*.css
# Uploads assets to S3
assets-to-cdn: assets-production
$(BIN)/coffee lib/assets/to_cdn.coffee public/assets
# Runs all the necessary build tasks to push to staging or production
deploy: assets-production
APPLICATION_NAME=flare-$(env) make assets-to-cdn
heroku config:add ASSET_PATH=//$(CDN_DOMAIN_$(env)).cloudfront.net/assets/$(shell git rev-parse --short HEAD)/ --app=flare-$(env)
git push -f [email protected]:flare-$(env).git master
deploy-staging:
make deploy env=staging
deploy-production:
make deploy env=production
.PHONY: test