-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (26 loc) · 1.24 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
.PHONY: help clean build image run release image docker
APP_NAME ?= `grep 'app:' apps/ha_server/mix.exs | sed -e 's/\[//g' -e 's/ //g' -e 's/app://' -e 's/[:,]//g'`
APP_VSN ?= `grep 'version:' apps/ha_server/mix.exs | cut -d '"' -f2`
BUILD ?= `git rev-parse --short HEAD`
help:
@echo "$(APP_NAME):$(APP_VSN)-$(BUILD)"
@perl -nle'print $& if m{^[a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
clean: ## Clean build artifacts
mix clean
test: ## Run and watch testing suite
source .env.test && mix test.watch --stale
server: ## Start application server
source .env.development && iex -S mix
env: ## Bootstrap dockerised development dependencies
docker-compose up
image: ## Build a Docker image
docker build --build-arg APP_NAME=$(APP_NAME) \
--build-arg APP_VSN=$(APP_VSN) \
-t $(APP_NAME):$(APP_VSN)-$(BUILD) \
-t $(APP_NAME):latest .
update_dsl: ## Bump the DSL to the latest version
npm i @harvestio/harvest-sql@latest --save
cp node_modules/@harvestio/harvest-sql/dist/bundle.js apps/ha_dsl/priv/parser.js
link_dsl: ## Link the DSL to the latest version
npm link @harvestio/harvest-sql
cp node_modules/@harvestio/harvest-sql/dist/bundle.js apps/ha_dsl/priv/parser.js