forked from scratchfoundation/scratch-www
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
96 lines (68 loc) · 2.27 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
ESLINT=./node_modules/.bin/eslint
NODE= NODE_OPTIONS=--max_old_space_size=8000 node
SCRATCH_DOCKER_CONFIG=./node_modules/.bin/docker_config.sh
S3CMD=s3cmd sync -P --delete-removed --add-header=Cache-Control:no-cache,public,max-age=3600
TAP=./node_modules/.bin/tap
WATCH= NODE_OPTIONS=--max_old_space_size=8000 ./node_modules/.bin/watch
WEBPACK= NODE_OPTIONS=--max_old_space_size=8000 ./node_modules/.bin/webpack
# ------------------------------------
$(SCRATCH_DOCKER_CONFIG):
npm install scratch-docker
docker-up: $(SCRATCH_DOCKER_CONFIG)
$(SCRATCH_DOCKER_CONFIG) network create
docker-compose up
docker-down:
docker-compose down
# ------------------------------------
build:
@make clean
@make translations
@make webpack
clean:
rm -rf ./build
rm -rf ./intl
mkdir -p build
mkdir -p intl
deploy:
@make build
@make sync
translations:
./bin/get-localized-urls localized-urls.json
./bin/build-locales node_modules/scratch-l10n/www intl
webpack:
$(WEBPACK) --bail
sync-s3:
$(S3CMD) --exclude '.DS_Store' --exclude '*.svg' --exclude '*.js' ./build/ s3://$(S3_BUCKET_NAME)/
$(S3CMD) --exclude '*' --include '*.svg' --mime-type 'image/svg+xml' ./build/ s3://$(S3_BUCKET_NAME)/
$(S3CMD) --exclude '*' --include '*.js' --mime-type 'application/javascript' ./build/ s3://$(S3_BUCKET_NAME)/
sync-fastly:
$(NODE) ./bin/configure-fastly.js
sync:
@make sync-s3
@make sync-fastly
# ------------------------------------
start:
$(NODE) ./dev-server/index.js
# ------------------------------------
test:
@make lint
@make build
@make tap
lint:
$(ESLINT) . --ext .js,.jsx,.json
unit:
$(TAP) ./test/unit/*.js --no-coverage -R classic
integration:
$(TAP) ./test/integration/*.js --no-coverage -R classic
smoke:
$(TAP) ./test/integration/smoke-testing/*.js --timeout=3600 --no-coverage -R classic
smoke-verbose:
$(TAP) ./test/integration/smoke-testing/*.js --timeout=3600 -R spec --no-coverage -R classic
localization:
$(TAP) ./test/localization/*.js --no-coverage -R classic
tap:
$(TAP) ./test/{unit,localization}/*.js --no-coverage -R classic
coverage:
$(TAP) ./test/{unit,localization}/*.js --coverage --coverage-report=lcov
# ------------------------------------
.PHONY: build clean deploy translations webpack start test lint unit functional integration localization tap coverage