forked from mdn/kumascript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
42 lines (34 loc) · 1.33 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
VERSION ?= $(shell git describe --tags --exact-match 2>/dev/null || git rev-parse --short HEAD)
REGISTRY ?= quay.io/
IMAGE_PREFIX ?= mozmar
IMAGE_NAME ?= kumascript
IMAGE ?= ${REGISTRY}${IMAGE_PREFIX}/${IMAGE_NAME}\:${VERSION}
MOUNT_DIR ?= $(shell pwd)
APP_DIR ?= /app
PORT ?= 9080
DOCKER_RUN_ARGS ?= -v ${MOUNT_DIR}\:${APP_DIR} -w ${APP_DIR}
DOCKER_PORT_ARGS ?= -p "${PORT}:${PORT}"
TEST_RUN_ARGS ?=
TEST_RUN_TIMEOUT ?= 10000
run:
docker run ${DOCKER_RUN_ARGS} ${DOCKER_PORT_ARGS} ${IMAGE} node run.js
test:
docker run ${DOCKER_RUN_ARGS} ${IMAGE} \
/node_modules/.bin/mocha --timeout=${TEST_RUN_TIMEOUT} ${TEST_RUN_ARGS} tests
test-macros:
docker run ${DOCKER_RUN_ARGS} ${IMAGE} \
/node_modules/.bin/mocha --timeout=${TEST_RUN_TIMEOUT} ${TEST_RUN_ARGS} tests/macros
lint:
docker run ${DOCKER_RUN_ARGS} ${IMAGE} \
/node_modules/.bin/jshint --show-non-errors lib tests
lint-macros:
docker run ${DOCKER_RUN_ARGS} ${IMAGE} \
/node_modules/.bin/ejslint "macros/**/*.ejs"
docker run ${DOCKER_RUN_ARGS} ${IMAGE} \
/node_modules/.bin/jsonlint-cli "macros/**/*.json"
bash:
docker run -it ${DOCKER_RUN_ARGS} ${IMAGE} bash
shrinkwrap:
docker run -it -v ${MOUNT_DIR}\:${APP_DIR} -w / -u root ${IMAGE} \
bash -c "npm shrinkwrap && cp npm-shrinkwrap.json ${APP_DIR}"
.PHONY: run test test-macros lint lint-macros bash shrinkwrap