-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·73 lines (61 loc) · 2.04 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
NODE_CONTAINER=node
NODE=docker run -it --rm -v "$(PWD)":/usr/src/app -w /usr/src/app $(NODE_CONTAINER) nodejs
YARN=docker run -it --rm -v "$(PWD)":/usr/src/app -w /usr/src/app $(NODE_CONTAINER) yarn
NPM=docker run -it --rm -v "$(PWD)":/usr/src/app -w /usr/src/app $(NODE_CONTAINER) npm
.PHONY: build watch prod
all: clean build
install-docker-node:
docker pull $(NODE_CONTAINER)
$(NPM) set init.author.name "Alister Bulman"
$(NPM) set init.author.email "[email protected]"
$(NPM) set init.author.url "https://abulman.co.uk"
$(NPM) set init.license "MIT"
$(NPM) set init.version "1.0.0"
# install-yarn:
# #curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
# #echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
# #sudo apt-get update && sudo apt-get install yarn
# $(YARN) add @symfony/webpack-encore --dev
yarn-install:
$(YARN) install
yarn-outdated:
$(YARN) outdated
yarn-upgrade:
$(YARN) upgrade
yarn-audit:
$(YARN) audit
webserver:
symfony server:start --allow-http --no-tls --document-root=docs/ --daemon
webserver-stop:
symfony server:stop
webserver-logs:
symfony server:log
assets: build
dev: build
build:
clear
$(YARN) encore dev
watch:
clear
$(YARN) encore dev --watch
# see: https://gist.github.com/ErickPetru/b1b3138ab0fc6c82cd19ea3a1a944ba6
prod:
clear
sudo rm -rf docs
$(YARN) encore production
deploy-gh-pages:
cd docs && git add --all && git commit -m "Deploy on gh-pages updated" && git push # origin gh-pages
clean:
sudo rm -rf docs/*
########################################################################
# from: https://github.com/kvz/fakefile/blob/master/Makefile
# define npm_script_targets
# TARGETS := $(shell ${NODE} -e 'for (var k in require("./package.json").scripts) {console.log(k.replace(/:/g, "-"));}')
# $$(TARGETS):
# ${NPM} run $(subst -,:,$(MAKECMDGOALS))
# .PHONY: $$(TARGETS)
# endef
# $(eval $(call npm_script_targets))
# # These npm run scripts are available, without needing to be mentioned in `package.json`
# install:
# ${NPM} install