| |
| SITE := twebkie.org |
| DEST ?= testing |
| BUCKET := gs://$(SITE)/$(DEST)/ |
| GS_URL := $(BUCKET:prod/=) |
| |
| META_PREFIX := x-goog-meta- |
| GIT_SHA := $(shell git rev-parse HEAD) |
| META_SHA := $(META_PREFIX)git-sha:$(GIT_SHA) |
| |
| # Support having a 'nodejs' binary rather than 'node' |
| LOCALBIN := node_modules/.bin |
| __create_LOCALBIN_dir := $(shell mkdir -p "${LOCALBIN}") |
| PATH := $(PATH):$(LOCALBIN) |
| NODE_BIN := $(shell command -v node 2> /dev/null) |
| NODEJS_BIN := $(shell command -v nodejs 2> /dev/null) |
| ifndef NODE_BIN |
| ifdef NODEJS_BIN |
| __use_NODEJS_BIN := $(shell ln -sfT "$(NODEJS_BIN)" "$(LOCALBIN)/node") |
| endif |
| endif |
| |
| dist: |
| gulp |
| |
| serve: |
| gulp serve |
| |
| serve-dist: |
| gulp serve:dist |
| |
| lint: |
| gulp lint |
| |
| clean: |
| gulp clean |
| |
| publish: dist |
| @echo "Pushing files at rev $(GIT_SHA) to $(GS_URL)" |
| gsutil -h "$(META_SHA)" -m cp -a public-read -r "dist/*" "$(GS_URL)" |
| |
| configure: |
| node -v |
| npm install |
| |
| audit: |
| node -v |
| npm audit fix --force |
| |
| update: |
| node -v |
| npm update |
| |
| .PHONY: dist serve serve-dist lint clean publish configure |