PROJECT_NAME := LindgrensWares
.PHONY: help
help:
@echo "------------------------------------------------------------------------"
@echo "${PROJECT_NAME}"
@echo "------------------------------------------------------------------------"
@grep -E '^[a-zA-Z0-9_/%\-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: build
build: ## build application binaries
go build -race ./cmd/web
build-frontend: ## build application frontend
cd static/html; npm run build
cd static/html; npm install -g serve
build-frontend-dev: ## build application frontend
cd static/html; npm run build-dev
.PHONY: build
update: ## build application binaries
go build -race ./cmd/web
systemctl stop LindgrensWares
mv web /opt/LindgrensWares
cp -R static /opt/LindgrensWares
cp -R config/production.json /opt/LindgrensWares/config/production.json
systemctl start LindgrensWares
.PHONY: deps
deps: ## install latest build of dependency manager and linters
go get -u github.com/golang/dep/cmd/dep
go get -v github.com/rubenv/sql-migrate/...
.PHONY: deps-ensure
deps-ensure: ## ensure dependencies are safely vendored in the project
dep ensure
.PHONY: install
install: ## install application binaries
go install ./cmd/web
.PHONY: integration-test
integration-test:
go run -v -race ./integration/...
.PHONY: test
test: ## run unit tests
go test -v -race ./cmd/... ./internal/...
migrate
sql-migrate up