-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
56 lines (42 loc) · 1.63 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
#!/usr/bin/env bash
# Setup environment variables
sinclude .env
export $(shell [ -f .env ] && sed 's/=.*//' .env)
APP := di2-front-end-render
# ./node_modules/.bin on the PATH
SHELL := /bin/bash
export PATH := ./node_modules/.bin:$(PATH)
# set path so it see eb command
export PATH := ~/.local/bin:$(PATH)
.PHONY:test
# Utility to get app name
APP_NAME = $(shell node -e 'process.stdout.write(require("./package.json").name)')
install:
npm rebuild node-sass
# if node_modules are present, npm i will be faster, otherwise npm ci will be faster
# (if npm version does not support ci command, install current npm version)
if [ -d node_modules ]; \
then npm i; \
else npm ci || npx npm@latest ci; \
fi
build:
mkdir -p public
# Order is important as server config uses manifest file generated by client config
NODE_ENV=production webpack --mode production --config-name client
NODE_ENV=production webpack --mode production --config-name server
xbrowser-post-test-run:
# Upload visual regression screenshots to AWS s3
sudo apt-get -y -qq install awscli
aws s3 cp --recursive ./__test__/__webdriver__/screenshots s3://di2-front-end-render-x-browser-test-screenshots/${CIRCLE_BRANCH}/${CIRCLE_SHA1}
create-x-browser-test-screenshots-stack-and-s3-bucket:
npm run create-x-browser-test-screenshots-stack-and-s3-bucket
sync-x-browser-screenshots-with-s3:
npm run sync-x-browser-screenshots-with-s3
revise-x-browser-screenshots:
npm run revise-x-browser-screenshots
deploy-latest: # deployments to other environments are handled by the Heroku Pipeline
eb deploy di2-front-end-test --message "master"
run:
npm run dev
snyk-test:
npm run snyk-test