2020-08-03 21:17:56 +02:00
|
|
|
.PHONY: up
|
|
|
|
up: ## Start all the services
|
|
|
|
docker-compose up -d --remove-orphans
|
|
|
|
|
|
|
|
.PHONY: start
|
2020-08-03 21:24:05 +02:00
|
|
|
start: up install-deps ## Start openpod application
|
2020-08-03 21:17:56 +02:00
|
|
|
docker-compose exec open-pod iex -S mix phx.server
|
|
|
|
|
2020-09-11 12:00:41 +02:00
|
|
|
.PHONY: install-deps
|
2020-12-07 12:24:26 +01:00
|
|
|
install-deps: container/open-pod ## Install open-pod dependencies
|
2020-08-03 21:24:05 +02:00
|
|
|
docker-compose exec open-pod mix deps.get
|
|
|
|
|
2020-09-11 12:00:41 +02:00
|
|
|
.PHONY: stop
|
2020-08-03 21:17:56 +02:00
|
|
|
stop: ## Shoutdown services
|
|
|
|
docker-compose down -v
|
|
|
|
|
2020-09-11 12:00:41 +02:00
|
|
|
.PHONY: help
|
2020-08-03 21:17:56 +02:00
|
|
|
help:
|
|
|
|
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
2020-08-03 21:24:05 +02:00
|
|
|
|
|
|
|
container/%:
|
|
|
|
@docker ps -q --no-trunc --filter status=running | grep $$(docker-compose ps -q $*) >/dev/null 2>&1 || docker-compose up -d $*
|
2020-09-11 12:00:41 +02:00
|
|
|
|
2020-12-07 12:24:26 +01:00
|
|
|
.PHONY: build
|
|
|
|
build: check-version
|
2020-09-11 12:00:41 +02:00
|
|
|
@docker build -t openpod/open-pod:latest .
|
|
|
|
@docker push openpod/open-pod:latest
|
|
|
|
@docker build -t openpod/open-pod:${VERSION} .
|
2020-12-07 12:24:26 +01:00
|
|
|
|
|
|
|
.PHONY: publish
|
|
|
|
publish: check-version
|
2020-09-11 12:00:41 +02:00
|
|
|
@docker push openpod/open-pod:${VERSION}
|
|
|
|
|
2020-12-07 12:24:26 +01:00
|
|
|
.PHONY: build-publish
|
|
|
|
build-publish: check-version build publish
|
|
|
|
|
2020-09-11 12:00:41 +02:00
|
|
|
check-version:
|
|
|
|
ifndef VERSION
|
|
|
|
$(error VERSION is undefined)
|
|
|
|
endif
|