2015-09-02 15:08:58 -04:00
|
|
|
ESLINT=./node_modules/.bin/eslint
|
2018-05-02 15:27:49 -04:00
|
|
|
NODE= NODE_OPTIONS=--max_old_space_size=8000 node
|
2018-08-21 13:09:38 -04:00
|
|
|
SCRATCH_DOCKER_CONFIG=./node_modules/.bin/docker_config.sh
|
2016-10-14 14:24:28 -04:00
|
|
|
S3CMD=s3cmd sync -P --delete-removed --add-header=Cache-Control:no-cache,public,max-age=3600
|
2015-11-09 11:40:36 -05:00
|
|
|
TAP=./node_modules/.bin/tap
|
2018-05-02 15:27:49 -04:00
|
|
|
WATCH= NODE_OPTIONS=--max_old_space_size=8000 ./node_modules/.bin/watch
|
|
|
|
WEBPACK= NODE_OPTIONS=--max_old_space_size=8000 ./node_modules/.bin/webpack
|
2015-09-02 15:08:58 -04:00
|
|
|
|
2018-08-21 13:09:38 -04:00
|
|
|
|
|
|
|
# ------------------------------------
|
|
|
|
|
|
|
|
$(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
|
|
|
|
|
2015-09-02 15:08:58 -04:00
|
|
|
# ------------------------------------
|
|
|
|
|
|
|
|
build:
|
|
|
|
@make clean
|
2016-01-08 13:50:58 -05:00
|
|
|
@make translations
|
2015-09-02 15:08:58 -04:00
|
|
|
@make webpack
|
|
|
|
|
|
|
|
clean:
|
2018-07-31 15:00:56 -04:00
|
|
|
rm -rf ./build
|
|
|
|
rm -rf ./intl
|
2015-09-02 15:08:58 -04:00
|
|
|
mkdir -p build
|
2016-01-06 14:09:32 -05:00
|
|
|
mkdir -p intl
|
2015-09-02 15:08:58 -04:00
|
|
|
|
2015-11-03 12:51:45 -05:00
|
|
|
deploy:
|
|
|
|
@make build
|
2016-04-19 16:35:51 -04:00
|
|
|
@make sync
|
2015-11-03 12:51:45 -05:00
|
|
|
|
2015-10-15 23:01:58 -04:00
|
|
|
translations:
|
2017-06-21 16:20:18 -04:00
|
|
|
./bin/get-localized-urls localized-urls.json
|
2019-03-27 06:36:22 -04:00
|
|
|
./bin/build-locales node_modules/scratch-l10n/www intl
|
2015-10-15 23:01:58 -04:00
|
|
|
|
2015-09-02 15:08:58 -04:00
|
|
|
webpack:
|
2015-10-20 19:45:01 -04:00
|
|
|
$(WEBPACK) --bail
|
2015-09-02 15:08:58 -04:00
|
|
|
|
2016-04-19 16:35:51 -04:00
|
|
|
sync-s3:
|
2016-09-08 17:46:58 -04:00
|
|
|
$(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)/
|
2016-04-19 16:35:51 -04:00
|
|
|
|
|
|
|
sync-fastly:
|
2016-04-15 19:42:57 -04:00
|
|
|
$(NODE) ./bin/configure-fastly.js
|
|
|
|
|
2016-04-19 16:35:51 -04:00
|
|
|
sync:
|
|
|
|
@make sync-s3
|
|
|
|
@make sync-fastly
|
|
|
|
|
2015-09-02 15:08:58 -04:00
|
|
|
# ------------------------------------
|
|
|
|
|
2015-09-09 16:24:50 -04:00
|
|
|
start:
|
2016-04-18 14:07:11 -04:00
|
|
|
$(NODE) ./dev-server/index.js
|
2015-09-09 16:24:50 -04:00
|
|
|
|
|
|
|
# ------------------------------------
|
|
|
|
|
2015-09-02 15:08:58 -04:00
|
|
|
test:
|
|
|
|
@make lint
|
2015-11-09 15:22:49 -05:00
|
|
|
@make build
|
2016-10-28 17:56:41 -04:00
|
|
|
@make tap
|
2015-09-02 15:08:58 -04:00
|
|
|
|
|
|
|
lint:
|
2018-01-30 09:54:45 -05:00
|
|
|
$(ESLINT) . --ext .js,.jsx,.json
|
2015-09-02 15:08:58 -04:00
|
|
|
|
2015-11-09 11:40:36 -05:00
|
|
|
unit:
|
2016-10-28 17:56:41 -04:00
|
|
|
$(TAP) ./test/unit/*.js
|
2015-11-09 11:40:36 -05:00
|
|
|
|
|
|
|
functional:
|
2016-10-28 17:56:41 -04:00
|
|
|
$(TAP) ./test/functional/*.js
|
2015-11-09 11:40:36 -05:00
|
|
|
|
|
|
|
integration:
|
2016-10-28 17:56:41 -04:00
|
|
|
$(TAP) ./test/integration/*.js
|
2015-11-09 11:40:36 -05:00
|
|
|
|
2017-04-19 17:14:02 -04:00
|
|
|
smoke:
|
|
|
|
$(TAP) ./test/integration/smoke-testing/*.js --timeout=3600
|
2018-07-27 10:49:08 -04:00
|
|
|
|
2018-05-08 16:43:41 -04:00
|
|
|
smoke-verbose:
|
|
|
|
$(TAP) ./test/integration/smoke-testing/*.js --timeout=3600 -R spec
|
2017-04-19 17:14:02 -04:00
|
|
|
|
2016-03-22 16:26:16 -04:00
|
|
|
localization:
|
2016-10-28 17:56:41 -04:00
|
|
|
$(TAP) ./test/localization/*.js
|
|
|
|
|
|
|
|
tap:
|
|
|
|
$(TAP) ./test/{unit,functional,localization}/*.js
|
2016-10-23 18:08:13 -04:00
|
|
|
|
|
|
|
coverage:
|
2016-10-28 17:56:41 -04:00
|
|
|
$(TAP) ./test/{unit,functional,localization}/*.js --coverage --coverage-report=lcov
|
2016-03-22 16:26:16 -04:00
|
|
|
|
2015-09-02 15:08:58 -04:00
|
|
|
# ------------------------------------
|
|
|
|
|
2016-10-28 17:56:41 -04:00
|
|
|
.PHONY: build clean deploy translations webpack start test lint unit functional integration localization tap coverage
|