cc1ce7bd49
In an ember environment `config/environment.js` exports a JSON object whereas the file itself exports a function that receives a string of the environment name that would like returning. This is so ember can automatically provide you with an already configured object containing configuration values dependent on which environment you passed to `ember-cli` using `serve`, `build` or `test`. In order to bypass this so we can easily test what is returned for different environments, we've installed a lightweight functional test harness that is simple to use `substack/tape`, that can be run easily outside of ember. We've then written as simple test case using this to enable us to test/assert that different environments return the correct configuration values. Additionally we've added some yarn scripts/make targets (yarn run test-node / make test-node) to make this easy to run. We're yet to integrate this into CI.
63 lines
1,006 B
Makefile
63 lines
1,006 B
Makefile
ROOT:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
|
|
|
all: build
|
|
|
|
deps: node_modules clean
|
|
|
|
clean:
|
|
rm -rf ./tmp
|
|
|
|
# target for netlify ui previews
|
|
# Netlify Settings
|
|
# base-directory: ui-v2
|
|
# build command: make netlify
|
|
# publish directory: ui-v2/ui-dist
|
|
netlify: build-staging
|
|
mkdir -p ui-dist/ui \
|
|
&& mv dist/* ui-dist/ui/ \
|
|
&& cp _redirects ui-dist/_redirects
|
|
|
|
build-staging: deps
|
|
yarn run build:staging
|
|
|
|
build-ci: deps
|
|
yarn run build:ci --output-path=dist
|
|
|
|
build: deps
|
|
yarn run build
|
|
|
|
start: deps
|
|
yarn run start
|
|
|
|
start-consul: deps
|
|
yarn run start:consul
|
|
|
|
start-api: deps
|
|
yarn run start:api
|
|
|
|
test: deps test-node
|
|
yarn run test
|
|
|
|
test-view: deps test-node
|
|
yarn run test:view
|
|
|
|
test-parallel: deps
|
|
yarn run test:parallel
|
|
|
|
test-node:
|
|
yarn run test:node
|
|
|
|
lint: deps
|
|
yarn run lint:hbs && yarn run lint:js
|
|
|
|
format: deps
|
|
yarn run format:js
|
|
|
|
steps:
|
|
yarn run steps:list
|
|
|
|
node_modules: yarn.lock package.json
|
|
yarn install
|
|
|
|
.PHONY: all deps build start test test-view lint format clean
|